Allan Carson
2011-Sep-22 22:22 UTC
[R] How to do Multiple Comparisons for a Mixed Effects Model
Hello everyone I am currently trying to conduct analysis of my graduate thesis data using a mixed effects model and I have reached an impass. When I try to conduct a multiple comparison, I get an error (See below): > fm3<- lme(abovegroundbiomass.m.2~medium*amelioration*fertilizer*treatment, random=~1|block/medium/amelioration/fertilizer) > tukeytest<-glht(fm3, linfct=mcp(treatment="Tukey")) Error in contrMat(table(mf[[nm]]), type = types[pm]) : less than two groups I wonder if anyone could help me interpret this error. Many thanks. Allan Carson [[alternative HTML version deleted]]
Ben Bolker
2011-Sep-23 13:01 UTC
[R] How to do Multiple Comparisons for a Mixed Effects Model
Allan Carson <acarson <at> unbc.ca> writes: [snip]> When I try to conduct a > multiple comparison, I get an error (See below): > fm3<- lme(abovegroundbiomass.m.2~medium*amelioration*fertilizer*treatment, > random=~1|block/medium/amelioration/fertilizer) > tukeytest<-glht(fm3, linfct=mcp(treatment="Tukey")) > Error in contrMat(table(mf[[nm]]), type = types[pm]) : > less than two groupsYou should probably re-post this question to the r-sig-mixed-models mailing list, which specializes (as you would guess) in mixed models. I'm a little suspicious of your random effects specification. Are there really random effects at all four levels? i.e., are there four separate hierarchical levels at which the predictors vary? It's hard to diagnose this problem without a reproducible example. Is your model fit otherwise sensible?