I am learning how to do PERMANOVA
, it is really a challenge when I started from the example. The following code is from the help page in adonis
. I can go through the example, but can't figure out why it is incorrect (no strata)
? Does that mean I have to obtain strata data to use adonis
?
data(dune)
data(dune.env)
### Example of use with strata, for nested (e.g., block) designs.
dat <- expand.grid(rep=gl(2,1), NO3=factor(c(0,10)),field=gl(3,1) )
Agropyron <- with(dat, as.numeric(field) + as.numeric(NO3)+2) +rnorm(12)/2
Schizachyrium <- with(dat, as.numeric(field)-as.numeric(NO3)+2) +rnorm(12)/2
Y <- data.frame(Agropyron, Schizachyrium)
mod <- metaMDS(Y)
plot(mod)
### Hulls show treatment
with(dat, ordihull(mod, group=NO3, show="0"))
with(dat, ordihull(mod, group=NO3, show="10", col=3))
### Spider shows fields
with(dat, ordispider(mod, group=field, lty=3, col="red"))
### Correct hypothesis test (with strata)
adonis(Y ~ NO3, data=dat, strata=dat$field, perm=999)
### Incorrect (no strata)
adonis(Y ~ NO3, data=dat, perm=999)