[R] help structuring mixed model using lmer()
Ben Bolker
bolker at ufl.edu
Tue Mar 10 23:59:18 CET 2009
Mark Difford <mark_difford <at> yahoo.co.uk> writes:
> 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.
... except that you'd better hope that you have a large number
of random units (years? I forget now), or the LR test will be
unreliable -- see Pinheiro and Bates 2000, and refer further questions
to the r-sig-mixed-models list ...
cheers
Ben Bolker
More information about the R-help
mailing list