8.3 Chapter 4 Supplementary Materials
8.3.2 Experiment 4.2
8.3.2.1 Target-heading angle as a function of distance 8.3.2.1.1 Building up the growth model
To examine the effect of target distance (Scene) on the rate of change in the target- heading angle as a function of distance, distance (0.5m ~ 6m from starting point) and Scene (Near and Far) were respectively added into the model as the level-1 and level-2 predictors. On the basis of model baseline, model distRI included distance and model distRS included random slopes. Model scne.int included Scene and model scne.slp included Scene × distance, respectively for testing the effect of target distance on the magnitude of the target-heading angle at 0.5m and slope of target-heading angle against distance. The R code is shown below.
# Setting up a baseline model that includes only random intercepts
baseline <- lme(target-heading_angle ~ 1, random = ~ 1|SubjectNo/Scene, data = o ffset_trial1, method = "ML", na.action = na.exclude, control = list(opt="optim")) # Adding "distance" as the level-1 fixed effect
distRI <- update(baseline, .~. + distance) # Introducing random slopes
distRS <- update(distRI, random = ~ distance|SubjectNo/Scene) # Adding Scene (landmark layout) as the level-2 fixed effect
# Effects of Scene on the intercept
scne.int <- update(distRS, .~. + Scene) # Effects of Scene on the slope
180 8.3.2.1.2 Comparing the models
Then we made a decision about the significance of each predictor. This was done using the likelihood-ratio test that compares -2LL (minus 2 times the log-likelihood) between the models before and after including the predictor. The R code and output for the model comparisons are listed below. In the output list, the first column shows the name of the model. The column logLik shows the magnitude of log-likelihood of the model. The column L.Ratioshows the -2LL between the current model and the previous model before the predictor was added in. The p-values can be used to determine whether the improvement of model fit is significant. Here we can see that model scne.slp is marginally better than model scne.int [χ2(1) = 2.92, p = 0.088], suggesting that target distance has an effect on the rate of change in the target-heading angle against distance.
# Code
anova(baseline, distRI, distRS, scne.int, scne.slp) # Output
## Model df AIC BIC logLik Test L.Ratio p-value ## baseline 1 4 23459.12 23485.03 -11725.56 ## distRI 2 5 22843.75 22876.13 -11416.88 1 vs 2 617.3696 <.0001 ## distRS 3 9 21605.55 21663.83 -10793.78 2 vs 3 1246.2008 <.0001 ## scne.int 4 10 21607.25 21672.01 -10793.62 3 vs 4 0.3040 0.5814 ## scne.slp 5 11 21606.33 21677.56 -10792.17 4 vs 5 2.9178 0.0876
8.3.2.1.3 Parameters in the model scne.slp
To see how the two conditions (Near and Far) differed in the rate of change in target- heading angle over distance (0.5m ~ 6m), we examined the model parameters estimated. The R code to show the parameter estimates and the output is listed below. In the output list, the column Value shows the estimated values of the model parameters. The column t-value and p-value can be used for hypothesis tests of whether the corresponding estimated parameter is different from 0. As the Far condition was the reference condition, the rows Intercept and distance show the estimated intercept (target-heading angle at 0.5m) and slope (rate of change) in the Far condition. The row Near and distance:Near respectively show the difference in the estimated intercept and slope between the Near and Far condition. Here we can see that the slope of the Far condition is significantly different from 0 [estimated slope = -0.41, t = -2.53, p = 0.011], and there is a marginal difference in slope between the Near and Far conditions [estimated difference = -0.38, t = -1.78, p = 0.075].
# Code
181 # Output
## Fixed effects: target-heading_angle ~ distance + Scene + distance:Scene ## Value Std.Error DF t-value p-value ## (Intercept) 8.993957 0.7267292 4747 12.375941 0.0000 ## distance -0.407102 0.1606113 4747 -2.534703 0.0113 ## Near 0.640817 1.0252988 23 0.625005 0.5381 ## distance:Near -0.377906 0.2123493 4747 -1.779644 0.0752
8.3.2.2 Mean target-heading angles of the early and later parts as a function of test trial
8.3.2.2.1 Building the growth model
A taxonomy of models was fitted on the mean target-heading angles that were averaged over the early (0.5m ~ 1m) and late (5.5m ~ 6m) parts. On the basis of model baseline, model TrialRI included the level-1 predictor Trial. Model TrialRS included the associated random effects and model TrialAR took autocorrelation into account. Model PartRI and model PartRS included the level-2 predictor Part (early and late) and interaction with Trial. Model sceneRI and model sceneRS included the level-2 predictor Scene (Near and Far) and interaction with Trial. Model ScenePartI and model ScenePartS included the interaction between the two level-2 predictors Part and Scene as well as their interaction with Trial.
# Setting up a baseline model that includes only random intercepts
baseline <- lme(target-heading_angle ~ 1, random = ~1|SubjectNo/Scene/Part, d
ata = offset.end.long, method = "ML", na.action = na.exclude, control = list(opt =
"optim"))
# Adding Trial as the level-1 fixed effect
TrialRI <- update(baseline, .~. + Trial) # Introducing random slopes
TrialRS <- update(TrialRI, random = ~ Trial|SubjectNo/Scene/Part) # Modelling a first-order autoregressive covariance structure
TrialAR <- update(TrialRS, correlation = corAR1()) # Effects of Part on the intercept
PartRI <- update(TrialAR, .~. + Part) # Effects of Part on the slope
PartRS <- update(PartRI, .~. + Part : Trial) # Effects of Scene on the intercept
sceneRI <- update(PartRS, .~. + Scene) # Effects of Scene on the intercept
sceneRS <- update(sceneRI, .~. + Scene : Trial) # Effects of interaction on the intercept
ScenePartI <- update(sceneRS, .~. + Scene : Part) # Effects of interaction on the intercept
182 8.3.2.2.2 Comparing the models
Then we compared the fit of the models for testing the significance of the predictors. The R code and output are listed below. In the output list, the first column shows the name of the model. The column logLik shows the magnitude of log-likelihood of the model. The column L.Ratioshows the -2LL between the current model and the previous model before the predictor was added in. The p-values can be used to determine whether the improvement of model fit is significant. Here we can see that model PartRI and PartRS are significantly better than the previous one, suggesting an effect of Part (early and late) on the intercept (magnitude of the target-heading angle at 0.5m) and slope (rate of change as a function of distance).
# Code
anova(baseline0, baseline, TrialRI, TrialRS, TrialAR, PartRI, PartRS, sceneRI, sce neRS, ScenePartI, ScenePartS)
# Output
## Model df AIC BIC logLik Test L.Ratio p-value ## baseline 1 5 2068.398 2088.099 -1029.199 ## TrialRI 2 6 2069.967 2093.608 -1028.984 1 vs 2 0.43133 0.5113 ## TrialRS 3 12 2078.055 2125.337 -1027.027 2 vs 3 3.91250 0.6885 ## TrialAR 4 13 2074.856 2126.078 -1024.428 3 vs 4 5.19890 0.0226 ## PartRI 5 14 2050.827 2105.990 -1011.414 4 vs 5 26.02851 <.0001 ## PartRS 6 15 2047.944 2107.046 -1008.972 5 vs 6 4.88363 0.0271 ## sceneRI 7 16 2048.156 2111.198 -1008.078 6 vs 7 1.78786 0.1812 ## sceneRS 8 17 2050.141 2117.124 -1008.071 7 vs 8 0.01470 0.9035 ## ScenePartI 9 18 2050.296 2121.219 -1007.148 8 vs 9 1.84507 0.1744 ## ScenePartS 10 19 2052.290 2127.153 -1007.145 9 vs 10 0.00586 0.9390
8.3.2.2.3 Separate one-sample tests on the slope parameters
The slopes of the early part in the two conditions were assessed by evaluating the estimated slope parameters in the model ScenePartS. The R code and output are shown below. In the output list, the column Estimateshows the estimated slope of the early part for each condition. The z- and p-values can be used for hypothesis tests of whether the estimated slope in the corresponding condition is different from 0.
# Code
contrast.matrix <- rbind(
"Far - 0" = c(0, 1, 0, 0, 0, 0, 0, 0), "Near - 0" = c(0, 1, 0, 0, 0, 1, 0, 0) )
postHocs <-glht(ScenePartS, contrast.matrix) summary(postHocs, test = adjusted("none")) # Output
## Simultaneous Tests for General Linear Hypotheses ##
183
## Trial:Scene + Part:Scene + Trial:Part:Scene, data = offset.end.long, ## random = ~Trial | SubjectNo/Scene/Part, correlation = corAR1(), ## method = "ML", na.action = na.exclude, control = list(opt = "optim")) ##
## Linear Hypotheses:
## Estimate Std. Error z value Pr(>|z|) ## Far - 0 == 0 -0.2953 0.2686 -1.100 0.272 ## Near - 0 == 0 -0.3782 0.2648 -1.428 0.153
## (Adjusted p values reported -- none method)
8.4 Chapter 5 - Supplementary Materials