Skip to content
Prev 173232 / 398503 Next

help structuring mixed model using lmer()

Hi Simon,

Have a look at Chap. 11 of "An Introduction to R" (one of R's manuals),
which explains the different ways of specifying models using formulae.

Briefly, y ~ x1 * x2 expands to y ~ x1 + x2 + x1:x2, where the last term
(interaction term) amounts to a test of slope. Normally you would read its
significance from F/chisq/p-value. Many practitioners consider the L.Ratio
test to be a better option. For the fixed effects part in lmer() do:

mod1 <- y ~ x1 + x2  == y ~ x1 + x2
mod2 <- y ~ x1 * x2  == y ~ x1 + x2 + x1:x2

anova(mod1, mod2)

This will tell you if you need to worry about interaction or whether slopes
are parallel.

Regards, Mark.
Simon Pickett-4 wrote: