Title: Mantel tests of distance matrices

Name: Tammy L. Elliott

Date: October 8, 2017

R version 3.2

Mantel tests with site environment; vasculars and presence-abscence data

#Compare dissimilarity matrices before ordination
#Mantel tests with site environment; vasculars
 #mantel.pa<-mantel(site.env.dist, raoD.pa.dist)
 #saveRDS(mantel.pa, file="mantel.pa.rds")
 mantel.pa<-readRDS("mantel.pa.rds")
 #Mantel tests with site environment, phylogenetic distances, and vascular data set
 #mantel.pa.phy<-lapply(raoD.pa.phy.dist, function(k){
 #  mantel(site.env.dist, k)
 #  })
 #saveRDS(mantel.pa.phy, file="mantel.pa.phy.rds")
 mantel.pa.phy<-readRDS("mantel.pa.phy.rds")
 mantel.pa.phy.stat<-lapply(mantel.pa.phy, function(l){
    l$statistic
    })
#normal distribution assumed for 95% confidence interval
mantel.pa.phy.stat.mean<-mean(unlist(mantel.pa.phy.stat))
mantel.pa.phy.stat.E<-qnorm(0.975)*sd(unlist(mantel.pa.phy.stat))/sqrt(length(unlist(mantel.pa.phy.stat)))
(mantel.pa.phy.stat.left<-mantel.pa.phy.stat.mean-mantel.pa.phy.stat.E)
## [1] 0.1394647
(mantel.pa.phy.stat.right<-mantel.pa.phy.stat.mean+mantel.pa.phy.stat.E)
## [1] 0.1434628
mantel.pa.phy.signif<-lapply(mantel.pa.phy, function(m){
    m$signif
    })
#normal distribution assumed for 95% confidence interval
mantel.pa.phy.signif.mean<-mean(unlist(mantel.pa.phy.signif))
mantel.pa.phy.signif.E<-qnorm(0.975)*sd(unlist(mantel.pa.phy.signif))/sqrt(length(unlist(mantel.pa.phy.signif)))
(mantel.pa.phy.signif.left<-mantel.pa.phy.signif.mean-mantel.pa.phy.signif.E)
## [1] 0.0009923967
(mantel.pa.phy.signif.right<-mantel.pa.phy.signif.mean+mantel.pa.phy.signif.E)
## [1] 0.001087603

Mantel tests with vasculars, BD and phylogenetic beta diversity measures for presence-abscence data

  #Mantel tests with BD and PhBD
 #mantel.pa.pa.phy<-lapply(raoD.pa.phy.dist, function(k){
 #  mantel(raoD.pa.dist, k)
 #  })
 #saveRDS(mantel.pa.pa.phy, file="mantel.pa.pa.phy.rds")
 mantel.pa.pa.phy<-readRDS("mantel.pa.pa.phy.rds")
 mantel.pa.pa.phy.stat<-lapply(mantel.pa.pa.phy, function(l){
    l$statistic
    })
#normal distribution assumed for 95% confidence interval
mantel.pa.pa.phy.stat.mean<-mean(unlist(mantel.pa.pa.phy.stat))
mantel.pa.pa.phy.stat.E<-qnorm(0.975)*sd(unlist(mantel.pa.pa.phy.stat))/sqrt(length(unlist(mantel.pa.pa.phy.stat)))
(mantel.pa.pa.phy.stat.left<-mantel.pa.pa.phy.stat.mean-mantel.pa.pa.phy.stat.E)
## [1] 0.4353929
(mantel.pa.pa.phy.stat.right<-mantel.pa.pa.phy.stat.mean+mantel.pa.pa.phy.stat.E)
## [1] 0.4432878
mantel.pa.pa.phy.signif<-lapply(mantel.pa.pa.phy, function(m){
    m$signif
    })
#normal distribution assumed for 95% confidence interval
mantel.pa.pa.phy.signif.mean<-mean(unlist(mantel.pa.pa.phy.signif))
mantel.pa.pa.phy.signif.E<-qnorm(0.975)*sd(unlist(mantel.pa.pa.phy.signif))/sqrt(length(unlist(mantel.pa.pa.phy.signif)))
(mantel.pa.pa.phy.signif.left<-mantel.pa.pa.phy.signif.mean-mantel.pa.pa.phy.signif.E)
## [1] 0.001
(mantel.pa.pa.phy.signif.right<-mantel.pa.pa.phy.signif.mean+mantel.pa.pa.phy.signif.E)
## [1] 0.001
mantel.pa.vasc.site.env.BD<-c(round(mantel.pa$statistic,2), mantel.pa$signif)
mantel.pa.vasc.site.env.PhBD<-c(round(mantel.pa.phy.stat.mean,2), mantel.pa.phy.signif.mean)
mantel.pa.pa.phy.BD.PhBD<-c(round(mantel.pa.pa.phy.stat.mean,2), mantel.pa.pa.phy.signif.mean)
mantel.pa.vasc.df<-rbind(mantel.pa.vasc.site.env.BD,mantel.pa.vasc.site.env.PhBD, mantel.pa.pa.phy.BD.PhBD)
colnames(mantel.pa.vasc.df)<-c("r", "P")
rownames(mantel.pa.vasc.df)<-c("SiteEnv x BD", "SiteEnv x PhBD", "BD x PhBD")

write.table(mantel.pa.vasc.df)
## "r" "P"
## "SiteEnv x BD" 0.35 0.001
## "SiteEnv x PhBD" 0.14 0.00104
## "BD x PhBD" 0.44 0.001

Mantel tests with abundance data comparing site.env and phylogenetic beta diversity

#Calculate dissimilarity matrices before ordination
#Mantel tests with site environment; vasculars and abundance data
 #mantel.abd<-mantel(site.env.dist, raoD.abd.dist)
 #saveRDS(mantel.abd, file="mantel.abd.rds")
 mantel.abd<-readRDS("mantel.abd.rds")
 #Mantel tests with site environment, phylogenetic distances, and vascular data set; abundance data
 #mantel.abd.phy<-lapply(raoD.abd.phy.dist, function(n){
 #  mantel(site.env.dist, n)
 #  })
 #saveRDS(mantel.abd.phy, file="mantel.abd.phy.rds")
 mantel.abd.phy<-readRDS("mantel.abd.phy.rds")
 mantel.abd.phy.stat<-lapply(mantel.abd.phy, function(o){
    o$statistic
    })
#normal distribution assumed for 95% confidence interval
mantel.abd.phy.stat.mean<-mean(unlist(mantel.abd.phy.stat))
mantel.abd.phy.stat.E<-qnorm(0.975)*sd(unlist(mantel.abd.phy.stat))/sqrt(length(unlist(mantel.abd.phy.stat)))
(mantel.abd.phy.stat.left<-mantel.abd.phy.stat.mean-mantel.abd.phy.stat.E)
## [1] 0.08962308
(mantel.abd.phy.stat.right<-mantel.abd.phy.stat.mean+mantel.abd.phy.stat.E)
## [1] 0.09129233
mantel.abd.phy.signif<-lapply(mantel.abd.phy, function(p){
    p$signif
    })
#normal distribution assumed for 95% confidence interval
mantel.abd.phy.signif.mean<-mean(unlist(mantel.abd.phy.signif))
mantel.abd.phy.signif.E<-qnorm(0.975)*sd(unlist(mantel.abd.phy.signif))/sqrt(length(unlist(mantel.abd.phy.signif)))
(mantel.abd.phy.signif.left<-mantel.abd.phy.signif.mean-mantel.abd.phy.signif.E)
## [1] 0.01072023
(mantel.abd.phy.signif.right<-mantel.abd.phy.signif.mean+mantel.abd.phy.signif.E)
## [1] 0.01227977

Mantel tests comparing abundance-weighted BD and PhBD

  #Mantel tests with BD and PhBD; abundance-weighted vascular data
 #mantel.abd.abd.phy<-lapply(raoD.abd.phy.dist, function(k){
 #  mantel(raoD.abd.dist, k)
 #  })
 #saveRDS(mantel.abd.abd.phy, file="mantel.abd.abd.phy.rds")
 mantel.abd.abd.phy<-readRDS("mantel.abd.abd.phy.rds")
 mantel.abd.abd.phy.stat<-lapply(mantel.abd.abd.phy, function(l){
    l$statistic
    })
#normal distribution assumed for 95% confidence interval
mantel.abd.abd.phy.stat.mean<-mean(unlist(mantel.abd.abd.phy.stat))
mantel.abd.abd.phy.stat.E<-qnorm(0.975)*sd(unlist(mantel.abd.abd.phy.stat))/sqrt(length(unlist(mantel.abd.abd.phy.stat)))
(mantel.abd.abd.phy.stat.left<-mantel.abd.abd.phy.stat.mean-mantel.abd.abd.phy.stat.E)
## [1] 0.4222144
(mantel.abd.abd.phy.stat.right<-mantel.abd.abd.phy.stat.mean+mantel.abd.abd.phy.stat.E)
## [1] 0.4322472
mantel.abd.abd.phy.signif<-lapply(mantel.abd.abd.phy, function(m){
    m$signif
    })
#normal distribution assumed for 95% confidence interval
mantel.abd.abd.phy.signif.mean<-mean(unlist(mantel.abd.abd.phy.signif))
mantel.abd.abd.phy.signif.E<-qnorm(0.975)*sd(unlist(mantel.abd.abd.phy.signif))/sqrt(length(unlist(mantel.abd.abd.phy.signif)))
(mantel.abd.abd.phy.signif.left<-mantel.abd.abd.phy.signif.mean-mantel.abd.abd.phy.signif.E)
## [1] 0.001
(mantel.abd.abd.phy.signif.right<-mantel.abd.abd.phy.signif.mean+mantel.abd.abd.phy.signif.E)
## [1] 0.001
mantel.abd.vasc.site.env.BD<-c(round(mantel.abd$statistic,2), mantel.abd$signif)
mantel.abd.vasc.site.env.PhBD<-c(round(mantel.abd.phy.stat.mean,2), mantel.abd.phy.signif.mean)
mantel.abd.abd.phy.BD.PhBD<-c(round(mantel.abd.abd.phy.stat.mean,2), mantel.abd.abd.phy.signif.mean)
mantel.abd.vasc.df<-rbind(mantel.abd.vasc.site.env.BD,mantel.abd.vasc.site.env.PhBD, mantel.abd.abd.phy.BD.PhBD)
colnames(mantel.abd.vasc.df)<-c("r", "P")
rownames(mantel.abd.vasc.df)<-c("SiteEnv x BD", "SiteEnv x PhBD", "BD x PhBD")

write.table(mantel.abd.vasc.df)
## "r" "P"
## "SiteEnv x BD" 0.21 0.001
## "SiteEnv x PhBD" 0.09 0.0115
## "BD x PhBD" 0.43 0.001

Angiosperm data

Mantel tests for presence-abscence site.env and phylogenetic beta diversity measures

#Calculate dissimilarity matrices before ordination
#Mantel tests with site environment; angiosperms and presence-abscence data
 #mantel.angio.pa<-mantel(site.env.dist, raoD.pa.angio.dist)
 #saveRDS(mantel.angio.pa, file="mantel.angio.pa.rds")
 mantel.angio.pa<-readRDS("mantel.angio.pa.rds")
 #Mantel tests with site environment, phylogenetic distances, and angiosperm data set; presence-abscence data
 #mantel.angio.pa.phy<-lapply(raoD.angio.pa.phy.dist, function(r){
 #  mantel(site.env.dist, r)
 #  })
 #saveRDS(mantel.angio.pa.phy, file="mantel.angio.pa.phy.rds")
 mantel.angio.pa.phy<-readRDS("mantel.angio.pa.phy.rds")
 mantel.angio.pa.phy.stat<-lapply(mantel.angio.pa.phy, function(o){
    o$statistic
    })
#normal distribution assumed for 95% confidence interval
mantel.angio.pa.phy.stat.mean<-mean(unlist(mantel.angio.pa.phy.stat))
mantel.angio.pa.phy.stat.E<-qnorm(0.975)*sd(unlist(mantel.angio.pa.phy.stat))/sqrt(length(unlist(mantel.angio.pa.phy.stat)))
(mantel.angio.pa.phy.stat.left<-mantel.angio.pa.phy.stat.mean-mantel.angio.pa.phy.stat.E)
## [1] 0.03106853
(mantel.angio.pa.phy.stat.right<-mantel.angio.pa.phy.stat.mean+mantel.angio.pa.phy.stat.E)
## [1] 0.03285126
mantel.angio.pa.phy.signif<-lapply(mantel.angio.pa.phy, function(p){
    p$signif
    })
#normal distribution assumed for 95% confidence interval
mantel.angio.pa.phy.signif.mean<-mean(unlist(mantel.angio.pa.phy.signif))
mantel.angio.pa.phy.signif.E<-qnorm(0.975)*sd(unlist(mantel.angio.pa.phy.signif))/sqrt(length(unlist(mantel.angio.pa.phy.signif)))
(mantel.angio.pa.phy.signif.left<-mantel.angio.pa.phy.signif.mean-mantel.angio.pa.phy.signif.E)
## [1] 0.1294646
(mantel.angio.pa.phy.signif.right<-mantel.angio.pa.phy.signif.mean+mantel.angio.pa.phy.signif.E)
## [1] 0.1414154

Mantel tests with BD and PhBD; presence-abscence angiosperm data

#mantel.angio.pa.pa.phy<-lapply(raoD.angio.pa.phy.dist, function(q){
#   mantel(raoD.pa.angio.dist, q)
#   })
#saveRDS(mantel.angio.pa.pa.phy, file="mantel.angio.pa.pa.phy.rds")
 mantel.angio.pa.pa.phy<-readRDS("mantel.angio.pa.pa.phy.rds")
 mantel.angio.pa.pa.phy.stat<-lapply(mantel.angio.pa.pa.phy, function(l){
    l$statistic
    })
#normal distribution assumed for 95% confidence interval
mantel.angio.pa.pa.phy.stat.mean<-mean(unlist(mantel.angio.pa.pa.phy.stat))
mantel.angio.pa.pa.phy.stat.E<-qnorm(0.975)*sd(unlist(mantel.angio.pa.pa.phy.stat))/sqrt(length(unlist(mantel.angio.pa.pa.phy.stat)))
(mantel.angio.pa.pa.phy.stat.left<-mantel.angio.pa.pa.phy.stat.mean-mantel.angio.pa.pa.phy.stat.E)
## [1] 0.3896277
(mantel.angio.pa.pa.phy.stat.right<-mantel.angio.pa.pa.phy.stat.mean+mantel.angio.pa.pa.phy.stat.E)
## [1] 0.397844
mantel.angio.pa.pa.phy.signif<-lapply(mantel.angio.pa.pa.phy, function(m){
    m$signif
    })
#normal distribution assumed for 95% confidence interval
mantel.angio.pa.pa.phy.signif.mean<-mean(unlist(mantel.angio.pa.pa.phy.signif))
mantel.angio.pa.pa.phy.signif.E<-qnorm(0.975)*sd(unlist(mantel.angio.pa.pa.phy.signif))/sqrt(length(unlist(mantel.angio.pa.pa.phy.signif)))
(mantel.angio.pa.pa.phy.signif.left<-mantel.angio.pa.pa.phy.signif.mean-mantel.angio.pa.pa.phy.signif.E)
## [1] 0.001
(mantel.angio.pa.pa.phy.signif.right<-mantel.angio.pa.pa.phy.signif.mean+mantel.angio.pa.pa.phy.signif.E)
## [1] 0.001
mantel.angio.pa.vasc.site.env.BD<-c(round(mantel.angio.pa$statistic,2), mantel.angio.pa$signif)
mantel.angio.pa.vasc.site.env.PhBD<-c(round(mantel.angio.pa.phy.stat.mean,2), mantel.angio.pa.phy.signif.mean)
mantel.angio.pa.pa.phy.BD.PhBD<-c(round(mantel.angio.pa.pa.phy.stat.mean,2), mantel.angio.pa.pa.phy.signif.mean)
mantel.angio.pa.vasc.df<-rbind(mantel.angio.pa.vasc.site.env.BD,mantel.angio.pa.vasc.site.env.PhBD, mantel.angio.pa.pa.phy.BD.PhBD)
colnames(mantel.angio.pa.vasc.df)<-c("r", "P")
rownames(mantel.angio.pa.vasc.df)<-c("SiteEnv x BD", "SiteEnv x PhBD", "BD x PhBD")

write.table(mantel.angio.pa.vasc.df)
## "r" "P"
## "SiteEnv x BD" 0.3 0.001
## "SiteEnv x PhBD" 0.03 0.13544
## "BD x PhBD" 0.39 0.001

Mantel tests for abundance-weighted angiosperm data for site.env and phylogenetic beta diversity measures

#Calculate dissimilarity matrices before ordination
#Mantel tests with site environment; vasculars and abundance data
# mantel.angio.abd<-mantel(site.env.dist, raoD.abd.angio.dist)
 #saveRDS(mantel.angio.abd, file="mantel.angio.abd.rds")
 mantel.angio.abd<-readRDS("mantel.angio.abd.rds")
 #Mantel tests with site environment, phylogenetic distances, and vascular data set; abundance data
 #mantel.angio.abd.phy<-lapply(raoD.angio.abd.phy.dist, function(r){
 #  mantel(site.env.dist, r)
 #  })
 #saveRDS(mantel.angio.abd.phy, file="mantel.angio.abd.phy.rds")
 mantel.angio.abd.phy<-readRDS("mantel.angio.abd.phy.rds")
 mantel.angio.abd.phy.stat<-lapply(mantel.angio.abd.phy, function(o){
    o$statistic
    })
#normal distribution assumed for 95% confidence interval
mantel.angio.abd.phy.stat.mean<-mean(unlist(mantel.angio.abd.phy.stat))
mantel.angio.abd.phy.stat.E<-qnorm(0.975)*sd(unlist(mantel.angio.abd.phy.stat))/sqrt(length(unlist(mantel.angio.abd.phy.stat)))
(mantel.angio.abd.phy.stat.left<-mantel.angio.abd.phy.stat.mean-mantel.angio.abd.phy.stat.E)
## [1] 0.04166152
(mantel.angio.abd.phy.stat.right<-mantel.angio.abd.phy.stat.mean+mantel.angio.abd.phy.stat.E)
## [1] 0.04367472
mantel.angio.abd.phy.signif<-lapply(mantel.angio.abd.phy, function(p){
    p$signif
    })
#normal distribution assumed for 95% confidence interval
mantel.angio.abd.phy.signif.mean<-mean(unlist(mantel.angio.abd.phy.signif))
mantel.angio.abd.phy.signif.E<-qnorm(0.975)*sd(unlist(mantel.angio.abd.phy.signif))/sqrt(length(unlist(mantel.angio.abd.phy.signif)))
(mantel.angio.abd.phy.signif.left<-mantel.angio.abd.phy.signif.mean-mantel.angio.abd.phy.signif.E)
## [1] 0.05955293
(mantel.angio.abd.phy.signif.right<-mantel.angio.abd.phy.signif.mean+mantel.angio.abd.phy.signif.E)
## [1] 0.06966707

Mantel tests with BD and PhBD; abundance-weighted angiosperm data

## [1] 0.5415251
## [1] 0.557595
## [1] 0.001
## [1] 0.001
## "r" "P"
## "SiteEnv x BD" 0.17 0.001
## "SiteEnv x PhBD" 0.04 0.06461
## "BD x PhBD" 0.55 0.001

Manuscript table will show abundance-weighted vascular and angiosperm data; add in confidence intervals where necessary

vascular results are in two columns to left, whereas angiosperm results are in two colummns to right

mantel.abd.vasc.angio.site.env.BD<-c(round(mantel.abd$statistic,2), mantel.abd$signif, round(mantel.angio.abd$statistic,2), mantel.angio.abd$signif)
mantel.abd.vasc.angio.site.env.PhBD<-c(round(mantel.abd.phy.stat.mean,2), mantel.abd.phy.signif.mean,round(mantel.angio.abd.phy.stat.mean,2), mantel.angio.abd.phy.signif.mean)
mantel.abd.vasc.angio.abd.phy.BD.PhBD<-c(round(mantel.abd.abd.phy.stat.mean,2), mantel.abd.abd.phy.signif.mean,round(mantel.angio.abd.abd.phy.stat.mean,2), mantel.angio.abd.abd.phy.signif.mean)
mantel.abd.vasc.angio.df<-rbind(mantel.abd.vasc.angio.site.env.BD,mantel.abd.vasc.angio.site.env.PhBD, mantel.abd.vasc.angio.abd.phy.BD.PhBD)
colnames(mantel.abd.vasc.angio.df)<-c("r", "P", "r", "P")
rownames(mantel.abd.vasc.angio.df)<-c("SiteEnv x BD", "SiteEnv x PhBD", "BD x PhBD")
write.table(mantel.abd.vasc.angio.df)
## "r" "P" "r" "P"
## "SiteEnv x BD" 0.21 0.001 0.17 0.001
## "SiteEnv x PhBD" 0.09 0.0115 0.04 0.06461
## "BD x PhBD" 0.43 0.001 0.55 0.001

Presence-absence table for the appendices; add in confidence intervals where necessary

vascular results are in two columns to left, whereas angiosperm results are in two colummns to right

mantel.pa.vasc.angio.site.env.BD<-c(round(mantel.pa$statistic,2), mantel.pa$signif, round(mantel.angio.pa$statistic,2), mantel.angio.pa$signif)
mantel.pa.vasc.angio.site.env.PhBD<-c(round(mantel.pa.phy.stat.mean,2), mantel.pa.phy.signif.mean,round(mantel.angio.pa.phy.stat.mean,2), mantel.angio.pa.phy.signif.mean)
mantel.pa.vasc.angio.pa.phy.BD.PhBD<-c(round(mantel.pa.pa.phy.stat.mean,2), mantel.pa.pa.phy.signif.mean,round(mantel.angio.pa.pa.phy.stat.mean,2), mantel.angio.pa.pa.phy.signif.mean)
mantel.pa.vasc.angio.df<-rbind(mantel.pa.vasc.angio.site.env.BD,mantel.pa.vasc.angio.site.env.PhBD, mantel.pa.vasc.angio.pa.phy.BD.PhBD)
colnames(mantel.pa.vasc.angio.df)<-c("r", "P", "r", "P")
rownames(mantel.pa.vasc.angio.df)<-c("SiteEnv x BD", "SiteEnv x PhBD", "BD x PhBD")
write.table(mantel.pa.vasc.angio.df)
## "r" "P" "r" "P"
## "SiteEnv x BD" 0.35 0.001 0.3 0.001
## "SiteEnv x PhBD" 0.14 0.00104 0.03 0.13544
## "BD x PhBD" 0.44 0.001 0.39 0.001

Mantel tests with Maximum Clade Credibility tree

1. Mantel for SiteEnv by presence-absence PhBD; vasculars

(mantel.vasc.one.tree.site.env.PhBD<-mantel(site.env.dist, raoD.pa.phy.one.tree.dist))
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = site.env.dist, ydis = raoD.pa.phy.one.tree.dist) 
## 
## Mantel statistic r: 0.1411 
##       Significance: 0.001 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0389 0.0497 0.0585 0.0704 
## Permutation: free
## Number of permutations: 999

2. Mantel for presence-absence BD and PhBD; vasculars

(mantel.vasc.one.tree.BD.PhBD<-mantel(raoD.pa.dist, raoD.pa.phy.one.tree.dist))
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = raoD.pa.dist, ydis = raoD.pa.phy.one.tree.dist) 
## 
## Mantel statistic r: 0.4392 
##       Significance: 0.001 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0745 0.1028 0.1273 0.1562 
## Permutation: free
## Number of permutations: 999

3.Mantel for SiteEnv by abundance-weighted PhBD; vasculars

(mantel.vasc.one.tree.site.env.PhBD.abd<-mantel(site.env.dist, raoD.abd.phy.one.tree.dist))
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = site.env.dist, ydis = raoD.abd.phy.one.tree.dist) 
## 
## Mantel statistic r: 0.08948 
##       Significance: 0.016 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0479 0.0675 0.0810 0.0959 
## Permutation: free
## Number of permutations: 999

4. Mantel for abundance-weighted BD and PhBD; vasculars

(mantel.vasc.one.tree.BD.PhBD.abd<-mantel(raoD.abd.dist, raoD.abd.phy.one.tree.dist))
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = raoD.abd.dist, ydis = raoD.abd.phy.one.tree.dist) 
## 
## Mantel statistic r: 0.423 
##       Significance: 0.001 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0706 0.1034 0.1351 0.1637 
## Permutation: free
## Number of permutations: 999

5. Mantel for SiteEnv by presence-absence PhBD;

(mantel.angio.one.tree.site.env.PhBD<-mantel(site.env.dist, raoD.angio.pa.phy.one.tree.dist))
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = site.env.dist, ydis = raoD.angio.pa.phy.one.tree.dist) 
## 
## Mantel statistic r: 0.0306 
##       Significance: 0.144 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0361 0.0500 0.0638 0.0755 
## Permutation: free
## Number of permutations: 999

6. Mantel for presence-absence BD and PhBD; angiosperms

(mantel.angio.one.tree.BD.PhBD<-mantel(raoD.pa.angio.dist, raoD.angio.pa.phy.one.tree.dist))
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = raoD.pa.angio.dist, ydis = raoD.angio.pa.phy.one.tree.dist) 
## 
## Mantel statistic r: 0.3935 
##       Significance: 0.001 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0731 0.0961 0.1245 0.1557 
## Permutation: free
## Number of permutations: 999

7.Mantel for SiteEnv by abundance-weighted PhBD; angiosperms

(mantel.angio.one.tree.site.env.PhBD.abd<-mantel(site.env.dist, raoD.angio.abd.phy.one.tree.dist))
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = site.env.dist, ydis = raoD.angio.abd.phy.one.tree.dist) 
## 
## Mantel statistic r: 0.04148 
##       Significance: 0.052 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0332 0.0419 0.0496 0.0624 
## Permutation: free
## Number of permutations: 999

8. Mantel for abundance-weighted BD and PhBD; angiosperms

(mantel.angio.one.tree.BD.PhBD.abd<-mantel(raoD.abd.angio.dist, raoD.angio.abd.phy.one.tree.dist))
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = raoD.abd.angio.dist, ydis = raoD.angio.abd.phy.one.tree.dist) 
## 
## Mantel statistic r: 0.5505 
##       Significance: 0.001 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0521 0.0744 0.0928 0.1089 
## Permutation: free
## Number of permutations: 999