Another PGLS in R question. I really like the caper package, as I think it's the most intuitive for PGLS analyses. I'd like to include a factor variable in my models, namely here trophic level (herbivore, omnivore, carnivore). When I've run the pgls function with factors with only two levels (e.g., terrestrial versus arboreal), the anova function prints out a nice anova table telling me the general significance of that factor. However, when I try and use anova on a pgls object with this three-level factor, I get the following error message:
> full=pgls(zscore~diet+lifespan+trophic,data=cdat,lambda="ML")
> anova(full)
Error in terms.formula(formula, data = data) :
invalid model formula in ExtractVars
Has anyone else had this problem when including a 2+ level factor in PGLS? I did some google digging, but nothing has really turned up. If caper just doesn't like these kind of categorical variables, has anyone had better luck in another package?
Thank you