Import data
clean<-read.csv("/Users/Ang/Documents/Tesis New/Univariates/clean_all.csv")
#create P/A and Forest Type variables
clean$scirtids.pa = decostand(clean$Scirtids,"pa",na.rm=T)
clean$Type<-ifelse((clean$Size=="Intact"),"Continuous","Patch")
#remove NAs:
cl<-na.omit(clean)
#subset lates:
cl.late<-subset(cl, Time=="Late")
Scirtids abundance accross sampling Time:
Presence/absence
table(clean$scirtids.pa,clean$Time)
##
## Early Late
## 0 185 153
## 1 2 39
We found too few scirtids in early samples, so we stick to LATE samples from here on.
s.ab2<-summarySE(cl.late, measurevar="Scirtids", groupvars=c("Leaves","Size"))
s.ab2
## Leaves Size N Scirtids sd se ci
## 1 Native Intact 40 0.5000000 2.407254 0.3806203 0.7698772
## 2 Native Large 29 2.7586207 7.581251 1.4078030 2.8837537
## 3 Native Small 30 3.6000000 13.652333 2.4925637 5.0978651
## 4 Standard Intact 37 1.2162162 4.583395 0.7535055 1.5281799
## 5 Standard Large 30 0.8333333 2.666307 0.4867989 0.9956156
## 6 Standard Small 26 0.9615385 2.999744 0.5882981 1.2116227
Scirtid Mean abundance (bars are Std.Error)
Scirtid Mean abund. (bars are 95% CI):
Not much difference within standard leaves, but with native leaves, Scirtid Abundance Increases in Small Fragments:
Is ABUNDANCE sign. sensitive to Forest Size?
# A poisson glmer attempt with SIZE
ab1<-glmer(Scirtids~Leaves*Size+(1|Site),data=cl.late,family=poisson,control=glmerControl(optimizer="bobyqa"))
overdisp_fun(ab1)
## chisq ratio rdf p
## 1.409400e+03 7.618379e+00 1.850000e+02 3.112149e-187
#crazily overdispersed!. So we move on to glmmADMB model with neg.binomial distribution:
ab2 <- glmmadmb(Scirtids~Leaves*Size+(1|Site),data=cl.late,zeroInflation=TRUE, family="nbinom")
overdisp_fun(ab2)
## chisq ratio rdf p
## 128.6148190 0.6952152 185.0000000 0.9994451
plot(resid(ab2)~fitted.values(ab2))
Anova(ab2)
## Analysis of Deviance Table (Type II tests)
##
## Response: Scirtids
## Df Chisq Pr(>Chisq)
## Leaves 1 1.1762 0.27812
## Size 2 6.0468 0.04864 *
## Leaves:Size 2 5.2955 0.07081 .
## Residuals 183
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Now contrasting patches versus intacts, using forest Type:
ab3 <- glmmadmb(Scirtids~Leaves*Type+(1|Site),data=cl.late,zeroInflation=TRUE, family="nbinom")
overdisp_fun(ab3)
## chisq ratio rdf p
## 131.0729464 0.7009248 187.0000000 0.9993333
plot(resid(ab3)~fitted.values(ab3))
Anova(ab3)
## Analysis of Deviance Table (Type II tests)
##
## Response: Scirtids
## Df Chisq Pr(>Chisq)
## Leaves 1 0.7290 0.39320
## Type 1 4.8181 0.02816 *
## Leaves:Type 1 3.5188 0.06068 .
## Residuals 185
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Scirtids more abundant in patches than continouus forest. Note margin.sign. interaction with leaflitter type
Q:Is PRESENCE sign. sensitive to forest Size??
pa1<- glmmadmb(scirtids.pa~Leaves*Size+(1|Site),data=cl.late,zeroInflation=TRUE, family="binomial")
overdisp_fun(pa1) #decent ratio to work
## chisq ratio rdf p
## 137.3478615 0.7424209 185.0000000 0.9964662
Anova(pa1)
## Analysis of Deviance Table (Type II tests)
##
## Response: scirtids.pa
## Df Chisq Pr(>Chisq)
## Leaves 1 1.0832 0.29799
## Size 2 5.5737 0.06161 .
## Leaves:Size 2 3.0011 0.22301
## Residuals 184
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
A: YES!
Now contrasting patches versus intacts, using TYPE:
# Forest type: Patches vs Continuous forest
pa2<- glmmadmb(scirtids.pa~Leaves*Type+(1|Site),data=cl.late,zeroInflation=TRUE, family="binomial")
overdisp_fun(pa2)
## chisq ratio rdf p
## 137.2121193 0.7337546 187.0000000 0.9975335
#decent overdisp.Sign. effect of forest type:
Anova(pa2)
## Analysis of Deviance Table (Type II tests)
##
## Response: scirtids.pa
## Df Chisq Pr(>Chisq)
## Leaves 1 0.7938 0.37294
## Type 1 4.3378 0.03728 *
## Leaves:Type 1 1.7803 0.18212
## Residuals 186
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Marginally higher presence in patches than in intact forest