[R-sig-eco] Adonis for significance of clusteredness from hclust (vegan package)
Ansley Silva
daily.puja at gmail.com
Mon Oct 3 21:52:12 CEST 2016
Hello:
I have created a dendrograms using hierarchical cluster analysis with the
vegan package (function: hclust).
By visually observing the dendrogram, I have determined that there are 3
main clusters if I "cut" the tree at the height 0.25 (please see the
dendrogram from the code).
I then created a new dataset, which is essentially the same as the
original, but I have added the categorical variable Group to represent
these 3 main clusters.
ST0 is group a, AP0 and AP100 is group b, and AP200 AP300 ST100 ST200 ST
300 is group c.
I want to now if they are significantly different from each other. I
understand, from the output pasted below, that I can accept that there is a
significant effect of Group. Is this the only thing I can say from
Permanova? What would be the code for a follow up test to look at
pair-wise significant differences?
Thanks very much.
Call:
adonis(formula = species ~ Group, data = environ, permutations = 999)
Permutation: free
Number of permutations: 999
Terms added sequentially (first to last)
Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
Group 2 0.40244 0.201219 4.969 0.66528 0.007 **
Residuals 5 0.20248 0.040495 0.33472
Total 7 0.60492 1.00000
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
--
Ansley Silva
*"The clearest way into the Universe is through a forest wilderness." John
Muir*
*Graduate Research Assistant*
*University of Georgia*
*D.B. Warnell School of Forestry and Natural Resources*
*180 East Green Street*
*Athens, GA 30602*
-------------- next part --------------
R version 3.3.1 Package:Vegan
data<-structure(list(necsur = c(1L, 4L, 0L, 8L, 0L, 1L), necame = c(4L,
5L, 9L, 9L, 4L, 7L), niccar = c(1L, 1L, 1L, 2L, 1L, 4L), nicorb = c(2L,
20L, 23L, 26L, 3L, 12L), nicpus = c(0L, 0L, 1L, 0L, 0L, 0L),
nictor = c(0L, 2L, 1L, 3L, 2L, 1L), oicina = c(0L, 0L, 0L,
0L, 0L, 0L), delgib = c(10L, 31L, 47L, 48L, 15L, 55L), cancha = c(5L,
6L, 4L, 4L, 1L, 6L), melbis = c(3L, 0L, 1L, 3L, 0L, 1L),
atelec = c(4L, 6L, 28L, 22L, 8L, 52L), copmin = c(0L, 0L,
1L, 1L, 0L, 1L), ontcon = c(3L, 3L, 11L, 7L, 1L, 2L), ontdep = c(2L,
0L, 0L, 0L, 0L, 0L), onthec = c(17L, 15L, 9L, 6L, 6L, 2L),
ontstr = c(0L, 0L, 0L, 1L, 1L, 0L), onttau = c(20L, 13L,
6L, 2L, 0L, 2L), ontpen = c(2L, 3L, 5L, 3L, 2L, 4L), onttub = c(2L,
3L, 4L, 1L, 1L, 0L), ontsub = c(0L, 0L, 0L, 0L, 0L, 0L),
phaign = c(0L, 0L, 0L, 0L, 0L, 0L), phavin = c(1L, 0L, 0L,
0L, 0L, 1L), Phyili = c(0L, 0L, 0L, 0L, 0L, 1L), canvir = c(0L,
1L, 0L, 0L, 0L, 0L), hybill = c(1L, 0L, 0L, 0L, 0L, 0L),
chlema = c(0L, 0L, 0L, 0L, 0L, 0L), cyclev = c(0L, 0L, 0L,
0L, 1L, 1L), dicdil = c(0L, 0L, 0L, 0L, 0L, 0L), galjan = c(0L,
0L, 1L, 1L, 0L, 0L), cyclosig = c(0L, 0L, 0L, 0L, 1L, 0L),
omomon = c(1L, 2L, 4L, 10L, 1L, 6L), trofov = c(1L, 2L, 3L,
1L, 0L, 1L), trouni = c(1L, 0L, 0L, 1L, 0L, 0L), troter = c(0L,
1L, 1L, 0L, 0L, 0L), eusass = c(9L, 8L, 23L, 14L, 11L, 28L
), hiscoe = c(2L, 1L, 10L, 4L, 2L, 4L), hisabb = c(0L, 0L,
0L, 0L, 2L, 0L), sappen = c(0L, 0L, 0L, 0L, 0L, 0L), dercan = c(0L,
0L, 0L, 0L, 0L, 0L), cremax = c(4L, 7L, 1L, 2L, 2L, 5L),
plamac = c(1L, 0L, 3L, 2L, 2L, 2L), plafem = c(0L, 0L, 0L,
0L, 0L, 0L), plafos = c(1L, 1L, 3L, 2L, 1L, 2L), placom = c(6L,
3L, 3L, 10L, 13L, 7L), tacfim = c(0L, 0L, 1L, 0L, 0L, 0L),
cicsex = c(0L, 0L, 0L, 0L, 0L, 0L), spsK = c(0L, 0L, 0L,
0L, 0L, 0L)), .Names = c("necsur", "necame", "niccar", "nicorb",
"nicpus", "nictor", "oicina", "delgib", "cancha", "melbis", "atelec",
"copmin", "ontcon", "ontdep", "onthec", "ontstr", "onttau", "ontpen",
"onttub", "ontsub", "phaign", "phavin", "Phyili", "canvir", "hybill",
"chlema", "cyclev", "dicdil", "galjan", "cyclosig", "omomon",
"trofov", "trouni", "troter", "eusass", "hiscoe", "hisabb", "sappen",
"dercan", "cremax", "plamac", "plafem", "plafos", "placom", "tacfim",
"cicsex", "spsK"), row.names = c("AP-0", "AP-100", "AP-200",
"AP-300", "ST-0", "ST-100"), class = "data.frame")
> apst.log <- decostand(apst, "log")
> apst.bray <- vegdist(apst.log)
> apst.clusters <- hclust(apst.bray, method = "average")
> dev.new()
> plot(apst.clusters, which.plot=2, hang=-1)
#Create dataset with Groups a, b, cco
##Data1 <- read.csv(file="APSTperma.csv", header=TRUE, row.names=NULL, sep=",")
Data1<- structure(list(ID = structure(1:6, .Label = c("AP0", "AP100",
"AP200", "AP300", "ST0", "ST100", "ST200", "ST300"), class = "factor"),
Treat = c(1L, 1L, 1L, 1L, 0L, 0L), Group = structure(c(2L,
2L, 3L, 3L, 1L, 3L), .Label = c("a", "b", "c"), class = "factor"),
necsur = c(1L, 4L, 0L, 8L, 0L, 1L), necame = c(4L, 5L, 9L,
9L, 4L, 7L), niccar = c(1L, 1L, 1L, 2L, 1L, 4L), nicorb = c(2L,
20L, 23L, 26L, 3L, 12L), nicpus = c(0L, 0L, 1L, 0L, 0L, 0L
), nictor = c(0L, 2L, 1L, 3L, 2L, 1L), delgib = c(10L, 31L,
47L, 48L, 15L, 55L), cancha = c(5L, 6L, 4L, 4L, 1L, 6L),
melbis = c(3L, 0L, 1L, 3L, 0L, 1L), atelec = c(4L, 6L, 28L,
22L, 8L, 52L), copmin = c(0L, 0L, 1L, 1L, 0L, 1L), ontcon = c(3L,
3L, 11L, 7L, 1L, 2L), ontdep = c(2L, 0L, 0L, 0L, 0L, 0L),
onthec = c(17L, 15L, 9L, 6L, 6L, 2L), ontstr = c(0L, 0L,
0L, 1L, 1L, 0L), onttau = c(20L, 13L, 6L, 2L, 0L, 2L), ontpen = c(2L,
3L, 5L, 3L, 2L, 4L), onttub = c(2L, 3L, 4L, 1L, 1L, 0L),
phavin = c(1L, 0L, 0L, 0L, 0L, 1L), Phyili = c(0L, 0L, 0L,
0L, 0L, 1L), canvir = c(0L, 1L, 0L, 0L, 0L, 0L), hybill = c(1L,
0L, 0L, 0L, 0L, 0L), cyclev = c(0L, 0L, 0L, 0L, 1L, 1L),
galjan = c(0L, 0L, 1L, 1L, 0L, 0L), cyclosig = c(0L, 0L,
0L, 0L, 1L, 0L), omomon = c(1L, 2L, 4L, 10L, 1L, 6L), trofov = c(1L,
2L, 3L, 1L, 0L, 1L), trouni = c(1L, 0L, 0L, 1L, 0L, 0L),
troter = c(0L, 1L, 1L, 0L, 0L, 0L), eusass = c(9L, 8L, 23L,
14L, 11L, 28L), hiscoe = c(2L, 1L, 10L, 4L, 2L, 4L), hisabb = c(0L,
0L, 0L, 0L, 2L, 0L), cremax = c(4L, 7L, 1L, 2L, 2L, 5L),
plamac = c(1L, 0L, 3L, 2L, 2L, 2L), plafem = c(0L, 0L, 0L,
0L, 0L, 0L), plafos = c(1L, 1L, 3L, 2L, 1L, 2L), placom = c(6L,
3L, 3L, 10L, 13L, 7L), tacfim = c(0L, 0L, 1L, 0L, 0L, 0L)), .Names = c("ID",
"Treat", "Group", "necsur", "necame", "niccar", "nicorb", "nicpus",
"nictor", "delgib", "cancha", "melbis", "atelec", "copmin", "ontcon",
"ontdep", "onthec", "ontstr", "onttau", "ontpen", "onttub", "phavin",
"Phyili", "canvir", "hybill", "cyclev", "galjan", "cyclosig",
"omomon", "trofov", "trouni", "troter", "eusass", "hiscoe", "hisabb",
"cremax", "plamac", "plafem", "plafos", "placom", "tacfim"), row.names = c(NA,
6L), class = "data.frame")
species<-(Data1[,4:41])
environ<-(Data1[,1:3])
species.dist<-vegdist(species, method="bray")
M1<-adonis(species~Group, data=environ, permutations = 999)
M1
More information about the R-sig-ecology
mailing list