[R] broken example: lme() + multcomp() Tukey on repeated measures design

William Simpson william.a.simpson at gmail.com
Wed Apr 22 11:15:29 CEST 2009


Thanks for the helpful replies.
I will try updating R and see how it goes.

MASS, nlme, multcomp are all the most recent.

Bill

On Tue, Apr 21, 2009 at 3:12 PM, William Simpson
<william.a.simpson at gmail.com> wrote:
> I am trying to do Tukey HSD comparisons on a repeated measures expt.
> I found the following example on r-help and quoted approvingly elsewhere.
> It is broken. Can anyone please tell me how to get it to work?
>
> I am using R 2.4.1.
>
>> require(MASS) ## for oats data set
>> require(nlme) ## for lme()
>> require(multcomp) ## for multiple comparison stuff
>> Aov.mod <- aov(Y ~ N + V + Error(B/V), data = oats)
>> Lme.mod <- lme(Y ~ N + V, random = ~1 | B/V, data = oats)
>> summary(Aov.mod)
>> anova(Lme.mod)
>> summary(Lme.mod)
>> summary(glht(Lme.mod, linfct=mcp(V="Tukey")))
> Error in eval(expr, envir, enclos) : object "Y" not found
> Error in factor_contrasts(model) : no 'model.matrix' method for 'model' found!
>
> It all went ok until the last line, where the actual Tukey multiple
> comparisons was requested.
>
> Thanks very much for any help!
>
> Bill
>




More information about the R-help mailing list