Skip to content
Prev 156046 / 398506 Next

Help please! How to code a mixed-model with 2 within-subject factors using lme or lmer?

Hi Roberto,

The other thing you can do --- if you don't wish to step across to lmer(),
where you will be able to exactly replicate the crossed-factor error
structure --- is stay with aov(... + Error()), but fit the factor you are
interested in last. Assume it is Sex. Then fit your model as

aov.model <- aov(Volume ~ Lobe * Tissue * Sex + Error(Subject/(Lobe *
Tissue))

This should give you a so-called "Type-II" test for Sex. You may verify this
by fitting the model without the Error term and using Anova() from the car
package (which does Type-II/III tests) to look at the SS and F values.

I say should, because the only concern I have is whether this procedure is
affected by the presence of an Error term in the model. Establishing this is
beyond my capabilities.

Regards, Mark.
roberto toro wrote: