Solved – Boxplot with glme

boxplotrrepeated measures

I am examining the difference between a physical feature of different species of animals. Due to the nature of my experiments I'm using a nonlinear mixed model with the following setup:

lme(log10(feature) ~ log10(Body.mass) + factor(Trial.Number), random = ~1 | IndividualID, data=animals, subset=Frfactor=="low", na.action=na.omit )

where subset=Frfactor=="low" refers to a specific speed range that I'm interested in.

I get great results which I'm happy about. But now I want to see how species affects my feature. Since the same conditions apply (tons of repeated effects) I've kept the lme and changed the structure to:

lme(log10(feature) ~ specfactor + factor(Trial.Number), random = ~1 | IndividualID, data=animals, subset=Frfactor=="low", na.action=na.omit )

where specfactor lists the names of the species. Looking at the p values it looks like these species are not significantly different from the intercept (which is specfactorserval). However when I create a boxplot, it certainly looks like there are some big interspecies differences!

I guess because the lme is a test for regressions, it doesn't really make sense to use when comparing the feature against categorical variables. But I still need to account for repeated effects. My question is if there's a better way to test for significance between species using the boxplot? I need the usual- p-values, confidence intervals. The "list" command seems to fall short of such comparisons. I don't know if a t-test would cut it.

Thanks!

PS I originally posted an image of my test results and of the boxplot, but I'm too new of a user to be allowed….

Best Answer

Your model (I think) is using the same slopes for all species, and perhaps this is why the boxplots look different.

If the feature shows an allometric reln with the body mass, then there are various possible models about that relationship varies with species and individuals within a species. Species in different groups (eg Reptiles vs mammals vs birds) might share a relationship (= slope) but they could also be in different size ranges.

I think you should add body mass to the second model and test for interaction terms between species and bodywt.