[R-sig-eco] adonis question

Kay Cecil Cichini Kay.Cichini at uibk.ac.at
Fri Jun 24 15:30:51 CEST 2011


hi all,

i played around with adonis and came across a result that i can't  
explain - more precisely i get a sign interaction-effect where i  
suppose there should be none:

library(vegan)

# species matrix/df
spdf <- matrix(NA, 60, 4, dimnames = list(1:60, c("sp1", "sp2", "sp3",  
"sp4")))
spdf <- as.data.frame(spdf)

# 1st factor = treatment:
treat <- gl(3, 20, labels = paste(1:3, "t", sep=""))

# 2nd factor = impact:
imp <- rep(gl(2, 10, labels = c("yes", "no")), 3)

# simulating effect -
# simulation will add similar effect
# across level combinations, no interactions:
eff <- sort(rep(1:6, 10))

# add random noise:
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)

# difference imp:yes vs imp:no is the same across all levels of treatment
aggregate(sp1 ~ imp * treat, data = spdf, FUN = mean)

# univariate ANOVAs with no interactions, as expected:
for (i in 1:4) {print(summary(aov(spdf[, i] ~ treat * imp)))}

# PERMANOVA - strangly gives sign. interaction (??)
adonis(spdf ~ treat * imp, dist = "euclidean")

thanks in advance,
kay



More information about the R-sig-ecology mailing list