[R-sig-eco] Two-way contrasts with adonis()
ASANTOS
alexandresantosbr at yahoo.com.br
Mon Mar 7 22:02:50 CET 2016
Dear members,
I try to create Two-way PERMANOVA contrasts using model.matrix()
function, but I failed with my output in adonis object. I need all
comparisons with impyes:treatt1, impno:treatt1, impyes:treatt2,
impno:treatt2, impyes:treatt3 and impno:treatt3 factors, this is
possible? In my code:
#1st factor
treat <- gl(3, 20, labels = paste("t", 1:3, sep=""))
#2nd factor
imp <- rep(gl(2, 10, labels = c("yes", "no")), 3)
#create a design matrix of the contrasts for "treat" in "imp"
Treat_Imp<-model.matrix(~ imp:treat-1)
#Variables
eff <- sort(rep(1:6, 10))
# add noise:
sp1 = eff + rnorm(60, 0, 0.25)
sp2 = eff + rnorm(60, 0, 0.25)
sp3 = eff + rnorm(60, 0, 0.25)
sp4 = eff + rnorm(60, 0, 0.25)
sp<-cbind(sp1,sp2,sp3,sp4)
require(vegan)
## do the pm-manova with the orthogonal contrasts for imp and treat'
fm <- adonis(sp ~ Treat_Imp,
method = "euclidean", perm = 999)
fm
Thanks,
--
======================================================================
Alexandre dos Santos
Proteção Florestal
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial
Cáceres - MT CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM) (+55) 65 9686-6970 (VIVO)
alexandre.santos at cas.ifmt.edu.br
Lattes: http://lattes.cnpq.br/1360403201088680
OrcID: orcid.org/0000-0001-8232-6722
Researchgate: https://www.researchgate.net/profile/Alexandre_Santos10
LinkedIn: https://br.linkedin.com/in/alexandre-dos-santos-87961635
More information about the R-sig-ecology
mailing list