[R-sig-ME] Deviance tests and contrasts
Adam D. I. Kramer
adik at ilovebacon.org
Mon Jun 14 00:21:10 CEST 2010
Dear Kay and David,
These models are indeed nested, but they do not test what I am
trying to test. What I am interested in testing is the main effect of sex
when the interaction is in the model. Or, a type-III sum of squares
approach. David's solution below will give me the main effect of sex, but
will not tell me whether the sex effect is significant when the interaction
is in the model.
On Fri, 11 Jun 2010, Kay Cecil Cichini wrote:
> hello adam, david and others,
> i recently was trying to figure out the same problem. i think that
> anova(l2,l0) is not appropiate because the models ar not nested.
> i ended up testing anova(l2,l1) for the interaction and anova(l1,l0) for the
> main effect of sex. any thoughts on this?
> David Duffy schrieb:
>> On Tue, 8 Jun 2010, Adam D. I. Kramer wrote:
>>> l2 <- lmer(score ~ sex * condition + (1 + condition | subject), data=d)
>>> ...the main effect for sex, which has only one contrast?
>> Being very simple minded, I would have run something like:
>> l2 <- lmer(score ~ sex * condition + (1 + condition | subject), data=d)
>> l1 <- lmer(score ~ sex + condition + (1 + condition | subject), data=d)
>> l0 <- lmer(score ~ condition + (1 + condition | subject), data=d,
>> anova(l2, l1, l0)
More information about the R-sig-mixed-models