[R-lang] Investigating random slope variance
Titus von der Malsburg
malsburg@posteo.de
Thu Apr 3 10:10:37 PDT 2014
I have eyetracking data from an experiment in which 45 participants read
a longer text. There was a manipulation at the beginning of the text
and the participants either read the original version of the text or the
manipulated version. Measurements were made in 40 regions of interest
that occurred later in the text. The regions consisted of two to five
words. So we have a between-subjects design and every participant
contributed 40 measurements for either condition A or condition B.
Condition was coded using contr.sdif(2), i.e., as -0.5 and 0.5. The
measure of interest is total reading time (trt). Log-transforming the
reading times produced beautifully normally distributed residuals.
Through a series of likelihood-ratio tests, I arrived at this model:
log(trt) ~ 1 + item.length + (1 | subj) + (cond | item)
where item.length is the length of the region in characters centered on
zero and scaled to unit variance.
The fixed effect of condition was not significant according to the
likelihood-ratio test but the random slopes were. This is plausible
because the manipulation is expected to have a different impact on the
various regions; some regions may be read faster in the manipulated
version and some slower.
This is the summary of the model:
Linear mixed model fit by maximum likelihood ['lmerMod']
Formula: log(tt) ~ 1 + Region.length + (1 | subj) + (cond | item)
Data: d
AIC BIC logLik deviance df.resid
2361.8 2400.2 -1173.9 2347.8 1780
Scaled residuals:
Min 1Q Median 3Q Max
-3.8627 -0.6263 -0.0081 0.6288 3.5806
Random effects:
Groups Name Variance Std.Dev. Corr
subj (Intercept) 0.078967 0.2810
item (Intercept) 0.063726 0.2524
condB-A 0.008118 0.0901 -0.59
Residual 0.189555 0.4354
Number of obs: 1787, groups: subj, 45; item, 40
Fixed effects:
Estimate Std. Error t value
(Intercept) 6.45069 0.05858 110.11
Region.length 0.15927 0.03893 4.09
Correlation of Fixed Effects:
(Intr)
Regin.lngth 0.002
Having established that the manipulation had a different impact on the
various regions, I was interested in seeing how the individual regions
were affected. Perhaps foolishly, I thought that I could simply inspect
the dotplot of the random effects:
dotplot(ranef(mer, postVar=T))
Here's the plot: http://users.ox.ac.uk/~sjoh3968/R/dotplot.png
While this plot shows a lot of action in the intercepts (some regions
were read considerably slower or faster than could be expected based on
their length) none of the individual random slopes was significantly
different from zero except perhaps that for item 25.
I'm a bit puzzled by that because the likelihood-ratio test provided
strong support for having these random slopes in the model. For that
reason, I expected to see more slopes that are significantly different
from zero. But as things stand I do not even see the expected rate of
false alarms in the dotplot.
My questions:
- Do I misunderstand something here?
- What's the proper way to find out which regions were significantly
slowed down and which were speeded up by the manipulation?
To address the second question, I tried a model that had item (sum
contrast) and the interaction of item with condition as fixed
effects. Likelihood-ratio tests suggested that both factors should be
in the model.
log(trt) ~ item * cond + (1|subj)
The summary of this model is at the end of this email.
In this model, three interactions of item and condition were significant
(items 23, 35, 40). Interestingly, these three items don't look
conspicuous in the dotplot. So this exercise unfortunately only added
to my confusion.
Thanks in advance for your suggestions.
Titus
Linear mixed model fit by maximum likelihood ['lmerMod']
Formula: log(tt) ~ item * cond + (1 | subj)
Data: d
AIC BIC logLik deviance df.resid
2311.5 2761.5 -1073.7 2147.5 1705
Scaled residuals:
Min 1Q Median 3Q Max
-3.8821 -0.6375 -0.0172 0.6402 3.5181
Random effects:
Groups Name Variance Std.Dev.
subj (Intercept) 0.07732 0.2781
Residual 0.18107 0.4255
Number of obs: 1787, groups: subj, 45
Fixed effects:
Estimate Std. Error t value
(Intercept) 6.92778 0.07580 91.40
item2 -0.09968 0.08973 -1.11
item3 -0.69521 0.09024 -7.70
item4 -0.54653 0.09029 -6.05
item5 -0.64580 0.08973 -7.20
item6 -0.97031 0.09029 -10.75
item7 -0.58442 0.08973 -6.51
item8 -0.47393 0.08973 -5.28
item9 -0.63300 0.08973 -7.05
item10 -0.66822 0.08973 -7.45
item11 -0.45895 0.08973 -5.11
item12 -0.82386 0.09029 -9.12
item13 -0.05979 0.08973 -0.67
item14 -0.21521 0.08973 -2.40
item15 -0.38548 0.08973 -4.30
item16 -0.05204 0.08973 -0.58
item17 0.02707 0.08973 0.30
item18 -0.58561 0.08973 -6.53
item19 -0.67088 0.09024 -7.43
item20 -0.65725 0.08973 -7.32
item21 -0.82779 0.09079 -9.12
item22 -0.01609 0.08973 -0.18
item23 -0.69240 0.08973 -7.72
item24 -0.72076 0.09024 -7.99
item25 -1.18346 0.09029 -13.11
item26 -0.40633 0.08973 -4.53
item27 0.29774 0.08973 3.32
item28 -0.54638 0.08973 -6.09
item29 -0.40471 0.08973 -4.51
item30 -1.01018 0.09079 -11.13
item31 -0.22745 0.09024 -2.52
item32 -0.50937 0.08973 -5.68
item33 -0.41883 0.08973 -4.67
item34 -0.37041 0.08973 -4.13
item35 -0.27538 0.08973 -3.07
item36 -0.06910 0.08973 -0.77
item37 -0.71859 0.08973 -8.01
item38 -0.77471 0.08973 -8.63
item39 -0.37623 0.09024 -4.17
item40 -0.79180 0.08973 -8.82
condB-A -0.03665 0.15159 -0.24
item2:condB-A 0.21595 0.17946 1.20
item3:condB-A -0.02540 0.18048 -0.14
item4:condB-A 0.26856 0.18058 1.49
item5:condB-A 0.10936 0.17946 0.61
item6:condB-A 0.12858 0.18058 0.71
item7:condB-A -0.06066 0.17946 -0.34
item8:condB-A 0.18173 0.17946 1.01
item9:condB-A 0.01036 0.17946 0.06
item10:condB-A 0.06748 0.17946 0.38
item11:condB-A -0.21589 0.17946 -1.20
item12:condB-A 0.29605 0.18058 1.64
item13:condB-A -0.03878 0.17946 -0.22
item14:condB-A -0.09393 0.17946 -0.52
item15:condB-A -0.08954 0.17946 -0.50
item16:condB-A 0.07551 0.17946 0.42
item17:condB-A 0.04650 0.17946 0.26
item18:condB-A 0.13694 0.17946 0.76
item19:condB-A 0.08740 0.18048 0.48
item20:condB-A -0.03577 0.17946 -0.20
item21:condB-A 0.31060 0.18159 1.71
item22:condB-A -0.08494 0.17946 -0.47
item23:condB-A 0.41837 0.17946 2.33
item24:condB-A 0.08108 0.18048 0.45
item25:condB-A 0.31598 0.18058 1.75
item26:condB-A -0.09289 0.17946 -0.52
item27:condB-A 0.02541 0.17946 0.14
item28:condB-A -0.04806 0.17946 -0.27
item29:condB-A 0.04336 0.17946 0.24
item30:condB-A 0.19097 0.18159 1.05
item31:condB-A 0.15455 0.18048 0.86
item32:condB-A 0.26954 0.17946 1.50
item33:condB-A 0.07763 0.17946 0.43
item34:condB-A 0.17493 0.17946 0.97
item35:condB-A 0.36112 0.17946 2.01
item36:condB-A -0.21705 0.17946 -1.21
item37:condB-A 0.10128 0.17946 0.56
item38:condB-A 0.25708 0.17946 1.43
item39:condB-A 0.20449 0.18048 1.13
item40:condB-A 0.36386 0.17946 2.03
Correlation matrix not shown by default, as p = 80 > 20.
Use print(...., correlation=TRUE) or
vcov(....) if you need it
--
Dr Titus von der Malsburg
University of Oxford
http://users.ox.ac.uk/~sjoh3968/
More information about the ling-r-lang-L
mailing list