Schefferville - generalists/specialists; pairwise co-occurrence; 0.2 m2 plots

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

Author: Tammy L. Elliott

Date: March 5, 2015

R version 3.1.0

Final GAM Models

Absolute difference in generalism and specialism, 0.2 m2 plots

cooc.gam.sqrt.te<-gam(cooc.z~te(phy.dist.sqrt,gen.spec), dat=data.cooc)
summary(cooc.gam.sqrt.te)
## 
## Family: gaussian 
## Link function: identity 
## 
## Formula:
## cooc.z ~ te(phy.dist.sqrt, gen.spec)
## 
## Parametric coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  -0.1695     0.1006  -1.685   0.0926 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Approximate significance of smooth terms:
##                              edf Ref.df     F  p-value    
## te(phy.dist.sqrt,gen.spec) 4.964  5.656 5.192 5.72e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## R-sq.(adj) =  0.0441   Deviance explained = 5.26%
## GCV = 5.7365  Scale est. = 5.6755    n = 561

Absolute difference in generalism and specialism, 0.2 m2 plots, only those plots < 30 my

cooc.gam.30<-gam(cooc.z.30~te(phy.dist.30.sqrt,gen.spec.30), dat=data.cooc.30)
summary(cooc.gam.30)
## 
## Family: gaussian 
## Link function: identity 
## 
## Formula:
## cooc.z.30 ~ te(phy.dist.30.sqrt, gen.spec.30)
## 
## Parametric coefficients:
##             Estimate Std. Error t value Pr(>|t|)   
## (Intercept)  -0.6138     0.1840  -3.336  0.00114 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Approximate significance of smooth terms:
##                                    edf Ref.df     F p-value  
## te(phy.dist.30.sqrt,gen.spec.30) 3.045  3.088 3.657  0.0138 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## R-sq.(adj) =  0.0642   Deviance explained = 8.78%
## GCV = 4.2729  Scale est. = 4.1312    n = 122

Mantel and partial Mantels for absolute differences

Partial mantel for absolute difference in niche width

sedges.02.partial.mantel<-mantel.partial(phy.dist.cyp, final.h.inv, z.mat, method = "pearson", permutations = 999)
sedges.02.partial.mantel
## 
## Partial Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel.partial(xdis = phy.dist.cyp, ydis = final.h.inv, zdis = z.mat,      method = "pearson", permutations = 999) 
## 
## Mantel statistic r: -0.09168 
##       Significance: 0.866 
## 
## Upper quantiles of permutations (null model):
##   90%   95% 97.5%   99% 
## 0.104 0.149 0.187 0.230 
## Permutation: free
## Number of permutations: 999

Mantel test for phylogenetic distance and co-occurrence

sedges.02.phy.dist.mantel<-mantel(phy.dist.cyp, z.mat, method = "pearson", permutations = 999)
sedges.02.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.09951 
##       Significance: 0.002 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0573 0.0687 0.0795 0.0887 
## Permutation: free
## Number of permutations: 999

Mantel test for absolute difference in niche width and co-occurrence

sedges.02.gen.spec.mantel<-mantel(final.h.inv, z.mat,method = "pearson", permutations = 999)
sedges.02.gen.spec.mantel
## 
## Mantel statistic based on Pearson's product-moment correlation 
## 
## Call:
## mantel(xdis = final.h.inv, ydis = z.mat, method = "pearson",      permutations = 999) 
## 
## Mantel statistic r: -0.08876 
##       Significance: 0.972 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0553 0.0696 0.0818 0.0960 
## Permutation: free
## Number of permutations: 999
#I don't think that this is possible for <30 my because not a symmetrical matrix

Mean between generalism and specialism


GAM models for mean niche differences, 0.2 m2 plots

mean.cooc.gam.sqrt.te<-gam(cooc.z~te(mean.phy.dist.sqrt,gen.spec), dat=mean.data.cooc)
summary(mean.cooc.gam.sqrt.te)
## 
## Family: gaussian 
## Link function: identity 
## 
## Formula:
## cooc.z ~ te(mean.phy.dist.sqrt, gen.spec)
## 
## Parametric coefficients:
##             Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  -0.1695     0.1007  -1.682   0.0931 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Approximate significance of smooth terms:
##                                   edf Ref.df     F p-value   
## te(mean.phy.dist.sqrt,gen.spec) 7.595  9.646 2.668 0.00397 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## R-sq.(adj) =  0.0411   Deviance explained = 5.41%
## GCV = 5.7821  Scale est. = 5.6935    n = 561

GAM model for only those species pairs <30my, mean niche differences, 0.2 m2 plots.

mean.cooc.gam.30<-gam(cooc.z~te(mean.phy.dist.30.sqrt,gen.spec), dat=mean.data.cooc.30)
summary(mean.cooc.gam.30)
## 
## Family: gaussian 
## Link function: identity 
## 
## Formula:
## cooc.z ~ te(mean.phy.dist.30.sqrt, gen.spec)
## 
## Parametric coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  -0.6138     0.1711  -3.587  0.00051 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Approximate significance of smooth terms:
##                                      edf Ref.df     F p-value  
## te(mean.phy.dist.30.sqrt,gen.spec) 16.05  18.13 2.079   0.011 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## R-sq.(adj) =  0.191   Deviance explained = 29.8%
## GCV = 4.1527  Scale est. = 3.5725    n = 122

Plot four GAMs side-by-side

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

my.vis.gam(cooc.gam.sqrt.te, axes=FALSE, type="response", plot.type = "contour", color="gray",  main="", mgp=c(1.75,0.5,0),xlab="Phylogenetic distance (sqrt)",cex.main=0.1, lwd=2,cex.lab=1.15, cex=2, ylab="Difference in niche width", font.lab=1)
axis(1,  tck=0.025, cex.lab=1.25, cex.axis=1)
axis(2, tck=0.025,  cex.lab=1.25, cex.axis=1)
box(bty="o", lwd=2)

my.vis.gam(mean.cooc.gam.sqrt.te,axes=FALSE, type="response", plot.type = "contour", color="gray",  main="", mgp=c(1.75,0.5,0),xlab="Phylogenetic distance (sqrt)",cex.main=0.1, lwd=2,cex.lab=1.15, cex=2, ylab="Mean niche width", font.lab=1)
axis(1,  tck=0.025, cex.lab=1.25, cex.axis=1)
axis(2, tck=0.025,  cex.lab=1.25, cex.axis=1)
box(bty="o", lwd=2)

my.vis.gam(cooc.gam.30, axes=FALSE, type="response", plot.type = "contour", color="gray",  main="", mgp=c(1.75,0.5,0),xlab="Phylogenetic distance (sqrt)",cex.main=0.1, lwd=2,cex.lab=1.15, cex=2, ylab="Difference in niche width", font.lab=1)
axis(1,  tck=0.025, cex.lab=1.25, cex.axis=1)
axis(2, tck=0.025,  cex.lab=1.25, cex.axis=1)
box(bty="o", lwd=2)

my.vis.gam(mean.cooc.gam.30, axes=FALSE, type="response", plot.type = "contour", color="gray",  main="", mgp=c(1.75,0.5,0),xlab="Phylogenetic distance (sqrt)",cex.main=0.1, lwd=2,cex.lab=1.15, cex=2, ylab="Mean niche width", font.lab=1)
axis(1,  tck=0.025, cex.lab=1.5, cex.axis=1)
axis(2, tck=0.025,  cex.lab=1.5, cex.axis=1)
box(bty="o", lwd=2)

#textClick("(a)", cex=1.25)
#textClick("(b)", cex=1.25)
#textClick("(c)", cex=1.25)
#textClick("(d)", cex=1.25)

Plot pairwise relationships for 0.2 m2 plots

#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(mean.data.cooc$gen.spec,mean.data.cooc$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((mean.data.cooc.30$gen.spec),mean.data.cooc.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))

Mantel tests

Partial mantel for mean niche width differences of 0.2 m2 plots

mean.sedges.partial.mantel<-mantel.partial(phy.dist.cyp, mean.final.h.inv, z.mat, method = "pearson", permutations = 999)
mean.sedges.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.1186 
##       Significance: 0.153 
## 
## Upper quantiles of permutations (null model):
##   90%   95% 97.5%   99% 
## 0.149 0.196 0.230 0.266 
## Permutation: free
## Number of permutations: 999

Mantel test for mean niche width differences of 0.2 m2 plots

# Phylogenetic distance and co-occurrence
mean.sedges.phy.dist.mantel<-mantel(phy.dist.cyp, z.mat, method = "pearson", permutations = 999)
mean.sedges.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.09951 
##       Significance: 0.008 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0599 0.0737 0.0845 0.0955 
## Permutation: free
## Number of permutations: 999
# Mean niche width and co-occurrence
mean.sedges.gen.spec.mantel<-mantel(mean.final.h.inv, z.mat,method = "pearson", permutations = 999)
mean.sedges.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.03127 
##       Significance: 0.694 
## 
## Upper quantiles of permutations (null model):
##    90%    95%  97.5%    99% 
## 0.0713 0.0886 0.1023 0.1211 
## Permutation: free
## Number of permutations: 999