[R-sig-eco] Adonis and Random Effects

Erin Nuccio enuccio at gmail.com
Mon Feb 4 08:14:05 CET 2013


Hello List,

Is adonis capable of modeling random effects?  I'm analyzing the impact of a treatment on the microbial community in a split-plot design (2 treatments per plot, 4 plots per grassland, 3 grasslands total). I would like to quantify how much of the variance is due to the Treatment versus the Grassland.  It seems like Grassland should be a random effect, since there are thousands of grasslands, and I'm only looking at 3.

I have tried to use the notation that works with lme4, and it's not working for me (see below for formula and error messages).  If adonis can't do random effects, are there any alternatives?  Or, considering my goal, are there any other programs I should look into?  Any suggestions would be highly appreciated!

Thanks for your help,
Erin



Here's what I think I should run:
adonis(formula = community_distance_matrix ~ Treatment + (1|Grassland) + (1|GrasslandPlot), strata = GrasslandPlot)

Here are my factors:
'data.frame':	24 obs. of  4 variables:
 $ Treatment    : Factor w/ 2 levels "T1","T2": 1 1 1 1 1 2 2 2 1 1 ...
 $ Grassland    : Factor w/ 3 levels "G1","G2","G3": 3 3 1 1 1 2 2 1 2 2 ...
 $ Plot         : Factor w/ 4 levels "P1","P2","P3","P4": 1 2 2 3 4 1 3 2 1 2 ...
 $ GrasslandPlot: Factor w/ 12 levels "G1:P1","G1:P2","G1:P3"..: 9 10 2 3 4 5 7 2 5 6 ...

And here's the error message:
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : 
  contrasts can be applied only to factors with 2 or more levels
In addition: Warning messages:
1: In Ops.factor(1, Grassland) : | not meaningful for factors
2: In Ops.factor(1, GrasslandPlot) : | not meaningful for factors



More information about the R-sig-ecology mailing list