library(tidyverse)
library(MASS)
library(ggplot2)ARU Stats update
Description
Quick stats update regarding ARU data
In this part I seek to answer: does species richness vary between the two land types (residential and private)? And is the effect of canopy (a well established predictor of bird species richness) different between the two?
(Question to be worded better in thesis hehe)
Part 1: Choosing the scale
I first ran the same model at the 4 scales I extracted canopy cover data for (50, 100, 200, 400). I chose to an upper limit of 400 since beyond that we’d be overlapping quite a bit of ARU sites
I compared the AIC of the models to select that which had the lowest. It is this model that I would actually look at the coefficients and p-values for
spring_data <- read.csv("3-Output/moddata_spring.csv")
# --- 50m ---#
mod_50m <- glm(species_richness ~ LanduseType*canopy_50,
family=poisson, data = spring_data)
# --- 100m ---#
mod_100m <- glm(species_richness ~ LanduseType*canopy_100,
family=poisson, data = spring_data)
# --- 200m ---#
mod_200m <- glm(species_richness ~ LanduseType*canopy_200,
family=poisson, data = spring_data)
# --- 400m ---#
mod_400m <- glm(species_richness ~ LanduseType*canopy_400,
family=poisson (link=log), data = spring_data)
# --- NULL ---#
null <- glm(species_richness ~ 1,
family=poisson (link=log), data = spring_data)summary(mod_50m) # AIC: 103.85
summary(mod_100m) # AIC: 107.56
summary(mod_200m) # AIC: 102.61
summary(mod_400m) # AIC: 101.47
summary(null) # AIC: 109.71#--- Summary of 200m model ---#
summary(mod_200m)
Call:
glm(formula = species_richness ~ LanduseType * canopy_200, family = poisson,
data = spring_data)
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.1633 0.2988 13.935 < 2e-16 ***
LanduseTyperesidential -0.9772 0.3637 -2.687 0.00722 **
canopy_200 -0.8351 1.1256 -0.742 0.45813
LanduseTyperesidential:canopy_200 3.4491 1.3484 2.558 0.01053 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 27.538 on 13 degrees of freedom
Residual deviance: 14.437 on 10 degrees of freedom
AIC: 102.61
Number of Fisher Scoring iterations: 4
Bullet-point results
Land use type is a significant predictor of bird species richness
The interaction between land use type and canopy cover is significant
#--- Checking diagnostics ---#
plot(mod_200m)#--- Checking overdispersion ---#
disp_ratio <- deviance(mod_200m) / df.residual(mod_200m)
disp_ratio[1] 1.443673
disp_p <- pchisq(deviance(mod_200m), df.residual(mod_200m), lower.tail = FALSE)
disp_p [1] 0.1539865
#--- Species richness by land use type ---#
ggplot(spring_data, aes(x=LanduseType, y=species_richness, fill = LanduseType)) +
geom_boxplot() +
geom_jitter(width = 0.2, size = 2, alpha = 0.6)#--- Scatter plot of species richness by canopy coverage ---#
ggplot(spring_data, aes(x=canopy_400, y=species_richness, color=LanduseType)) +
geom_point()+
stat_smooth(method = "glm") `geom_smooth()` using formula = 'y ~ x'
Interpretation
The variability of residential areas is reflected in more variable bird species richness
Canopy cover is a significant indicator of species richness in residential areas, but not in public parks
however, because of the small sample size and narrow range of canopy cover in public parks, we might just have not obtained a large enough sample size to detect an effect