[R] lme() F-values disagree with aov()

William Simpson wsimpson at utsc.utoronto.ca
Mon Aug 14 17:48:46 CEST 2006


Thanks very much Peter!
>> > Your lme statement is OK. To get the usual split-plot anova, your aov
>> > statement should be
>> >
>> > fit2 <- aov(y ~ a*b*c + Error(s), data = d)
>>
>> No, this gives wrong F-values. By "wrong" I mean it does not agree with the
>> published table.
>
> Well, it's the model that is equivalent to your lme() model....
Yes, I thought my lme() model was wrong but couldn't figure out how to do it properly.

> Thing is that you want to add random effects of s:b and s:c, which are
> crossed factors, so somewhat tricky to code with lme() (this sort of
> thing is easier in lmer() from the lme4 packages).
I am happy to do it that way if you show me how...

> The generic way to handle this in lme() is via something like
>
>            random=list(s=pdBlocked(list(
>                      pdIdent(~1),
>                      pdIdent(~b-1),
>                      pdIdent(~c-1))))
>
I see. Thanks very much Peter!!

Bill



More information about the R-help mailing list