我试图理解组间的PERMANOVA
假设multivariate spread
类似于方差同质性univariate ANOVA
,为此我制作了一个 R 代码,但我没有找到这个结果,为什么?
我的代码:
library(vegan)
# Four similar populations:
spdf <- matrix(NA, 60, 4, dimnames =
list(1:60, c("sp1", "sp2", "sp3", "sp4")))
spdf <- as.data.frame(spdf)
eff <- sort(rep(1:6, 10))
spdf$sp1 = eff + rnorm(60, 0, 0.25)
spdf$sp2 = eff + rnorm(60, 0, 0.25)
spdf$sp3 = eff + rnorm(60, 0, 0.25)
spdf$sp4 = eff + rnorm(60, 0, 0.25)
#3 Treatment
treat <- gl(3, 20, labels = paste("t", 1:3, sep=""))
# distance matrix
envdist <- vegdist(spdf, method="euclidean")
# when computing beta-dispersion in anova we have no group differences
# but in adonis is different
anova(betadisper(envdist, treat))
adonis(spdf~treat)