#this analysis is with all data, including control and aptero esc infections. garden<-read.csv("GLM_garden_noADAO.csv",header=T) attach(garden) names(garden) infection<-cbind(Infection,NoInfection) model<-glm(infection ~ GardenType*EscovopsisType,binomial) summary(model) Deviance Residuals: Min 1Q Median 3Q Max -2.2974 -0.6559 -0.6559 1.1436 1.8123 Coefficients: Estimate Std. Error (Intercept) 0.08004 0.40032 GardenTypeC. muelleri -0.26236 0.72589 EscovopsisTypeC. muelleri -1.50716 0.60574 GardenTypeC. muelleri:EscovopsisTypeC. muelleri 4.25443 1.34555 z value Pr(>|z|) (Intercept) 0.200 0.84152 GardenTypeC. muelleri -0.361 0.71777 EscovopsisTypeC. muelleri -2.488 0.01284 * GardenTypeC. muelleri:EscovopsisTypeC. muelleri 3.162 0.00157 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for binomial family taken to be 1) Null deviance: 111.684 on 80 degrees of freedom Residual deviance: 87.443 on 77 degrees of freedom AIC: 95.443 Number of Fisher Scoring iterations: 5 model2<-glm(infection ~ GardenType*EscovopsisType,quasibinomial) summary(model2) Deviance Residuals: Min 1Q Median 3Q Max -2.2974 -0.6559 -0.6559 1.1436 1.8123 Coefficients: Estimate Std. Error (Intercept) 0.08004 0.41059 GardenTypeC. muelleri -0.26236 0.74451 EscovopsisTypeC. muelleri -1.50716 0.62128 GardenTypeC. muelleri:EscovopsisTypeC. muelleri 4.25443 1.38006 t value Pr(>|t|) (Intercept) 0.195 0.84595 GardenTypeC. muelleri -0.352 0.72550 EscovopsisTypeC. muelleri -2.426 0.01761 * GardenTypeC. muelleri:EscovopsisTypeC. muelleri 3.083 0.00285 ** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for quasibinomial family taken to be 1.051949) Null deviance: 111.684 on 80 degrees of freedom Residual deviance: 87.443 on 77 degrees of freedom AIC: NA Number of Fisher Scoring iterations: 5 anova(model2, test="F") model3<-glm(infection ~ GardenType+EscovopsisType,quasibinomial) summary(model3) Deviance Residuals: Min 1Q Median 3Q Max -1.6920 -0.8485 -0.8485 0.8652 1.5468 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.4678 0.3887 -1.203 0.23248 GardenTypeC. muelleri 1.6261 0.5429 2.995 0.00368 ** EscovopsisTypeC. muelleri -0.3686 0.4932 -0.747 0.45704 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (Dispersion parameter for quasibinomial family taken to be 1.047846) Null deviance: 111.68 on 80 degrees of freedom Residual deviance: 100.80 on 78 degrees of freedom AIC: NA Number of Fisher Scoring iterations: 4 - only GardenType is significant alone - use quasibinomial models because null deivance > 1; lower AIC? anova(model2,model3,test="F") Analysis of Deviance Table Model 1: infection ~ GardenType * EscovopsisType Model 2: infection ~ GardenType + EscovopsisType Resid. Df Resid. Dev Df Deviance F Pr(>F) 1 77 87.443 2 78 100.802 -1 -13.36 12.7 0.0006318 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 - there is a signficant interaction between GardenType and EscovopsisType - difference between * and + models?