Download Schaeckermann_RScript_JAPPL.

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Mission blue butterfly habitat conservation wikipedia , lookup

Biological Dynamics of Forest Fragments Project wikipedia , lookup

Habitat destruction wikipedia , lookup

Habitat conservation wikipedia , lookup

Habitat wikipedia , lookup

Transcript
#Statistical analysis script to be used in R software, to test our hypotheses about the
influence of natural and semi-natural habitat on vertebrates and on their crop seed
predation. We used generalized linear mixed models (glmm) with penalized quasi
likelihood (PQL) and poisson or quasipoisson error distribution.
#correlations between explanatory variables tested for two sets of data:
#Set one: (Percentage natural habitat, Percentage semi-natural habitat, Size of study
sites, Age of study sites)
#Set two: (Abundance of all birds, Species richness of all birds, Abundance of
granivorous birds, Species richness of granivorous birds)
#The script shown is for Set 1, to test Set 2 variables need to be fitted.
suncor<- cbind(Percentage_natural-habitat, Percentage_semi-natural_habitat, Size_of
study_sites, Age_of_study_sites)
colnames(suncor) <- c("Percentage_natural_habitat "," Percentage_semi-natural_habitat
"," Size_of_study_sites "," Age_of_study_sites ")
suncor<- as.data.frame(suncor)
cor.prob <- function(X, dfr=nrow(X) -2) { R <- cor(X) above <- row(R) < col (R)
r2 <- R[above]^ Fstat <- r2 * dfr / (1-r2)R[above] <- 1-pf(Fstat,1,dfr) R}
suncor<- na.omit(suncor)
X <- suncor
cor.prob(X)
# Vertebrate variables in relation to Percentage natural habitat, Percentage seminatural habitat, Size of study sites, Age of study sites, Sampling point
(Explanatory variables).
# Script shown for Percentage_natural_habitat. To test other explanatory variables
Percentage natural habitat needs to be replaced with the explanatory variable to be
tested. If sampling point is explanatory variable it is not random factor.
model1<glmmPQL(Abundance_of_all_birds~Percentage_natural_habitat,random=~1|Crop_identi
ty/Study_site/Sampling_point,family=quasipoisson)
summary(model1)
model2<glmmPQL(Species_richness_of_all_birds~Percentage_natural_habitat,random=~1|Crop
_identity/Study_site/Sampling_point,family=quasipoisson)
summary(model2)
model3<-glmmPQL(Abundance_of_granivorous_birds
~Percentage_natural_habitat,random=~1|Crop_identity/Study_site/Sampling_point,famil
y=quasipoisson)
summary(model3)
model4<-glmmPQL(Species_richness_of_granivorous_birds
~Percentage_natural_habitat,random=~1|Crop_identity/Study_site/Sampling_point,famil
y=quasipoisson)
summary(model4)
# Seed predation in relation to Abundance of all birds, Species richness of all
birds, Abundance of granivorous birds, Species richness of granivorous birds,
Percentage natural habitat, Percentage semi-natural habitat, Sampling point
(Explanatory variables)
# Script shown for Abundance_of_all_birds. To test other explanatory variables
Abundance of all birds needs to be replaced with the explanatory variable to be tested. If
sampling point is explanatory variable it is not random factor.
model_predation<-glmmPQL(Seed_predation~Abundance_of_all_birds,random=~1|
Crop_identity/Study_site/Sampling_point,family=quasipoisson)
summary(model_predation)
# The differences between different Treatments of the exclusion experiment.
Statistics comparing “all excluded” with birds (rodents excluded, birds had
access to almonds, rodents (birds excluded, rodents had access to almonds),
birds/rodents (both groups had access to almonds)
model_exclusion<glmmPQL(Seed_predation~Treatment,random=~1|Study_site/Sampling_point/Tree,famil
y=quasipoisson)
summary(model_exclusion)