Christian Kost
2007-Aug-28 03:06 UTC
[R] Problem with lme using glht for multiple comparisons
Hi everyone, I am new to R and have a question that relates to unplanned post-hoc comparisons using the multcomp package after a mixed effects model. I couldn't find the answer to it in the archive or in any manual. I have a dataset in which several plants have been treated in a particular way and a continuous response variable has been measured depending on several leaves per plant. I am now interested in the effect of the treatment depending on the age of the leaves examined. So the dataset (L1) consists of a continuous response variable (EFN), a fixed factor (Leafage), and a random factor (Plant). I have set up the following mixed effects model, which works fine:> > LM<-lme(EFN~Leafage,L1,~1|Plant) >Now all I want to do is a post-hoc analysis (multiple comparisons) for the fixed factor EFN. I tried the following code. According to the documentation this should work:> > Post <- glht(LM, linfct = mcp(Leafage = "Tukey")) >However, I get this error message and don't know what to do: Error in mcp2matrix(model, linfct = linfct) : Factor(s) Leafage have been specified in ?linfct? but cannot be found in ?model?! The factor is specified, right? So what is the problem? If I do the same with an normal Anova (command: aov), it works. What is the problem with the lme command? Thank you very much in advance for your help. Cheers, Christian
Apparently Analagous Threads
- post hoc test for lme using glht ?
- lme (weights) and glht
- R: Error with glht function: Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'Type' have been specified in 'linfct' but cannot be found in 'model'!
- lme weights glht
- Error with glht function: Error in mcp2matrix(model, linfct = linfct) : Variable(s) 'Type' have been specified in 'linfct' but cannot be found in 'model'!