Schefferville - generalists/specialists; pairwise co-occurrence; modelling

Includes OLS analyses with 34 focal species (including T. alpinum)

Author: Tammy L. Elliott

Date: March 1, 2015

R version 3.1.0

Plot showing relationships between mean, absolute niche width, phylogenetic distance and co-occurrence

#dev.new(width=6.8, height=6.8)
layout(matrix(1:4,ncol=2), width = c(1,1),height = c(1,1))
par(mfrow=c(2,3))
par(mar=c(3.5,3,2.75,0.75), mgp=c(1.5,0.3,0), las=0)

plot(data.cooc$gen.spec,data.cooc$cooc.z,  ylab="Co-occurrence", xlab="Difference in niche width",lwd=2, pch=16, col="black", cex.axis=1.25, cex.lab=1.5,bty="n", cex=1,tck=0.03)
#abline(cooc.z.gen.spec.lm, lwd=2)
box( lwd=3)

plot(data.cooc.mean$gen.spec,data.cooc.mean$cooc.z,  ylab="Co-occurrence", xlab="Mean niche width",lwd=2, pch=16, col="black", cex.axis=1.25, cex.lab=1.5,bty="n", cex=1,tck=0.03)
#abline(cooc.z.gen.spec.lm, lwd=2)
box( lwd=3)

plot(sqrt(data.cooc$phy.dist),data.cooc$cooc.z,  ylab="Co-occurrence", xlab="Phylogenetic distance (sqrt)",lwd=2, pch=16, col="black", cex.axis=1.25, cex.lab=1.5,bty="n", cex=1,tck=0.03)
#abline(cooc.z.phy.dist.lm, lwd=2)
box( lwd=3)

plot((data.cooc.30$gen.spec),data.cooc.30$cooc.z, ylab="Co-occurrence",xlab="Difference in niche width", lwd=2, pch=16, col="black", cex.axis=1.25, cex.lab=1.5,bty="n", cex=1,tck=0.03)
#abline(cooc.z.gen.spec.lm.30, lwd=2)
box(lwd=3)

plot((data.cooc.mean.30$gen.spec),data.cooc.mean.30$cooc.z, ylab="Co-occurrence",xlab="Mean niche width", lwd=2, pch=16, col="black", cex.axis=1.25, cex.lab=1.5,bty="n", cex=1,tck=0.03)
#abline(cooc.z.gen.spec.lm.30, lwd=2)
box(lwd=3)

plot(sqrt(data.cooc.30$phy.dist),data.cooc.30$cooc.z,  ylab="Co-occurrence", xlab="Phylogenetic distance (sqrt)",lwd=2, pch=16, col="black", cex.axis=1.25, cex.lab=1.5,bty="n", cex=1,tck=0.03)
box(lwd=3)

#abline(cooc.z.phy.dist.lm.30, lwd=2)

#textClick("(a)",cex=c(size=1.5, font=2) )
#textClick("(b)", cex=c(size=1.5, font=2))
#textClick("(c)", cex=c(size=1.5, font=2))
#textClick("(d)", cex=c(size=1.5, font=2))
#textClick("(e)", cex=c(size=1.5, font=2))
#textClick("(f)", cex=c(size=1.5, font=2))
# Set up matrices for Mantel/partial Mantel
#mean.final.h.inv
#phy.dist.cyp #ordered by species names (including names), matrix form

#Create a matrix for cooc
z.mat<-(veg.out-meanmat)/sdmat
diag(z.mat)<-0

Mantel and partial mantel tests for mean niche differences

# Partial mantel
sedges.mean.partial.mantel<-mantel.partial(phy.dist.cyp, mean.final.h.inv, z.mat, method = "pearson", permutations = 999)
sedges.mean.partial.mantel
## 
## Partial Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel.partial(xdis = phy.dist.cyp, ydis = mean.final.h.inv,      zdis = z.mat, method = "pearson", permutations = 999) 
## 
## Mantel statistic r: 0.06363 
##       Significance: 0.31 
## 
## Upper quantiles of permutations (null model):
##   90%   95% 97.5%   99% 
## 0.148 0.186 0.216 0.256 
## Permutation: free
## Number of permutations: 999
# Mantel 
sedges.mean.phy.dist.mantel<-mantel(phy.dist.cyp, z.mat, method = "pearson", permutations = 999)
sedges.mean.phy.dist.mantel
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = phy.dist.cyp, ydis = z.mat, method = "pearson",      permutations = 999) 
## 
## Mantel statistic r: 0.0957 
##       Significance: 0.008 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0566 0.0674 0.0753 0.0910 
## Permutation: free
## Number of permutations: 999
sedges.mean.gen.spec.mantel<-mantel(mean.final.h.inv, z.mat,method = "pearson", permutations = 999)
sedges.mean.gen.spec.mantel 
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = mean.final.h.inv, ydis = z.mat, method = "pearson",      permutations = 999) 
## 
## Mantel statistic r: -0.03132 
##       Significance: 0.725 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0647 0.0812 0.0991 0.1217 
## Permutation: free
## Number of permutations: 999