Alaerts Katrijn
2009-Jul-02 14:41 UTC
[R] multiple comparisons and generalized least squares
Dear R users, I 'm working on a dataset consisting of 4 different dataframes with tree, leaf, fruit and seed measurements made on 300 trees, coming from 10 provenances (30 trees per provenance, 10 leaves/fruits/seeds per tree). Provenances are fixed effects (they were not randomly chosen), but trees within provenances and leaves/fruits/seeds within trees were randomly assigned. I wanted to check whether there were any between-provenance differences concerning the measured characteristics. For the leaves, fruits and seeds datasets, I tried some lme models of the form: model<- lme(characteristic~1, random=~1|tree, data=leaves) model<- lme(characteristic~provenance, random=~1|tree, data=leaves) or, in case of heteroscedasticity on the provenance level: model<-lme(characteristic~provenance, random=~1|tree, data=leaves, weights=varIdent(form=~1|provenance)). Multiple comparisons were then performed on the best fitting model by using the glht function of the package multcomp, with linfct=mcp(provenance="Tukey"). For the tree characteristics, as far as I understand (but I am quite new to R and mixed effect modeling), no random effects are needed for model specification. But since most tree characteristics (height, stem diameter, crown diameter etc.) have a very different variance for each provenance, I used the function gls with a variance structure: model<-gls(characteristic~provenance, data=trees, weights=varIdent(form=~1|provenance)) Then, using the function glht as before, I get an error message: "no 'model.matrix' method for 'model' found!". I tried to find an explanation in the mailing archives and the glht and gls help files, but I couldn't, so therefore these questions: 1) Is the function glht just not designed for use with gls models, or is there a problem with my model specification? 2) Is this approach (first mixed effect modeling, then multiple comparisons of means) correct to determine the differences in characteristics between provenances? (I cannot use anova because of the variance structure and the hierarchical structure of the measurements) 3) If glht cannot work with gls models, is there another way to include a variance structure in the analysis, when making multiple comparisons? Many thanks in advance and sorry if my questions are not very clear or if I missed some essential help file or mail. Katrijn [[alternative HTML version deleted]]