[R] How to code repeated measures interaction in lmer?

René Mayer mayer at psychologie.tu-dresden.de
Thu May 6 12:55:22 CEST 2010


Dear Everybody:

I want to test an interaction of two repeated measures in lmer()
I've response times (Y) from N subjects with two within-subject-factors.

aov(Y ~ A*B + Error(subjects/A*B), ...) shows an insigificant  
interaction p(A:B) = .35

now lmer()
lm1 = lmer(Y ~ 1+A+B+(1+A*B|subjects), ...)
lm2 = lmer(Y ~ 1+A*B+(1+A*B|subjects), ...)

p(A:B) = anova(lm1,lm2)
is this right?

and when do I have to write

lm1 = lmer(Y ~ 1+A+B+(1|subjects)+(1|subjects:A:B), ...)
lm2 = lmer(Y ~ 1+A*B+(1|subjects)+(1|subjects:A:B), ...)
p(A:B) = anova(lm1,lm2)
?

many thanks in advance,
René



More information about the R-help mailing list