Description Usage Format Details Source References Examples
Data on counts of coffee berry borer obtained using different traps through time.
1 |
A data frame with 288 observations on the following 4 variables.
week | numeric | week of observation (1 to 24) |
block | factor | levels I II III IV |
trap | factor | levels CV F SF |
count | numeric | number of observed insects |
The coffee berry borer is a major pest of commercial coffee. The insect directly attacks the coffee fruit in development causing severe losses in bean production and quality.
This data set was obtained in an experiment conducted by Mota (2013), where three types of traps (SF
, F
, CV
) were randomized in each of four equidistant lines (blocks) of a coffee field. Each week, over a 24 week period, the insects were removed from the traps and counted.
Demétrio, C. G. B., Hinde, J. and Moral, R. A. (2014) Models for overdispersed data in entomology. In Godoy, W. A. C. and Ferreira, C. P. (Eds.) Ecological modelling applied to entomology. Springer.
Mota, L. H. C. (2013) Desenvolvimento de armadilha de auto-inoculacao para o controlde de Hypothenemus hampei (Ferrari, 1867) (Coleoptera: Curculionidae) com Beauveria bassiana (Bals.) Vuil (Ascomycota: Hypocreales) em tecido sinetico. Master's dissertation, ESALQ-USP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | data(cbb)
# exploratory plot
require(latticeExtra)
trellis.par.set(strip.background=list(col="lightgrey"))
useOuterStrips(xyplot(count ~ week | block + trap, data=cbb,
layout=c(3,1),type="l", col=1, xlab="Week", ylab="Insect counts"))
# Poisson fit
model1 <- glm(count ~ block + trap*factor(week),
data=cbb, family=poisson)
anova(model1, test="Chisq")
sum(resid(model1, ty="pearson")^2)
summary(model1)
hnp(model1, sim=19, conf=1)
## Not run:
hnp(model1) # default call
## End(Not run)
# Quasi-Poisson fit
model2 <- glm(count ~ block + trap*factor(week), data=cbb,
family=quasipoisson)
anova(model2, test="F")
summary(model2)
hnp(model2, sim=19, conf=1)
## Not run:
hnp(model2) # default call
## End(Not run)
## for discussion on the analysis of this data set,
## see Demetrio et al. (2014)
|
Loading required package: MASS
Loading required package: latticeExtra
Loading required package: lattice
Analysis of Deviance Table
Model: poisson, link: log
Response: count
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev Pr(>Chi)
NULL 287 17688.2
block 3 243.6 284 17444.6 < 2.2e-16 ***
trap 2 5721.4 282 11723.2 < 2.2e-16 ***
factor(week) 23 8539.4 259 3183.7 < 2.2e-16 ***
trap:factor(week) 46 454.3 213 2729.5 < 2.2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
[1] 2695.667
Call:
glm(formula = count ~ block + trap * factor(week), family = poisson,
data = cbb)
Deviance Residuals:
Min 1Q Median 3Q Max
-10.9119 -1.7382 -0.3523 1.0971 13.0833
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.48219 0.05060 88.580 < 2e-16 ***
blockII 0.36597 0.03226 11.344 < 2e-16 ***
blockIII 0.44109 0.03178 13.879 < 2e-16 ***
blockIV 0.40526 0.03201 12.662 < 2e-16 ***
trapF -1.12996 0.09180 -12.309 < 2e-16 ***
trapSF -1.75539 0.11816 -14.856 < 2e-16 ***
factor(week)2 -2.25438 0.14719 -15.316 < 2e-16 ***
factor(week)3 -0.53723 0.07469 -7.193 6.35e-13 ***
factor(week)4 0.02439 0.06376 0.383 0.702063
factor(week)5 -0.53372 0.07461 -7.154 8.45e-13 ***
factor(week)6 0.77414 0.05483 14.119 < 2e-16 ***
factor(week)7 -1.36593 0.10061 -13.577 < 2e-16 ***
factor(week)8 0.27213 0.06021 4.520 6.19e-06 ***
factor(week)9 -0.30568 0.06965 -4.389 1.14e-05 ***
factor(week)10 0.16642 0.06164 2.700 0.006938 **
factor(week)11 -1.01572 0.08797 -11.546 < 2e-16 ***
factor(week)12 0.41366 0.05847 7.075 1.49e-12 ***
factor(week)13 -1.06821 0.08970 -11.909 < 2e-16 ***
factor(week)14 -1.74356 0.11757 -14.830 < 2e-16 ***
factor(week)15 -2.96733 0.20508 -14.469 < 2e-16 ***
factor(week)16 -2.60269 0.17273 -15.068 < 2e-16 ***
factor(week)17 -2.54862 0.16844 -15.130 < 2e-16 ***
factor(week)18 -3.78831 0.30490 -12.425 < 2e-16 ***
factor(week)19 -3.88362 0.31946 -12.157 < 2e-16 ***
factor(week)20 -0.12475 0.06625 -1.883 0.059681 .
factor(week)21 -2.04307 0.13391 -15.258 < 2e-16 ***
factor(week)22 -1.81676 0.12131 -14.976 < 2e-16 ***
factor(week)23 -1.25895 0.09646 -13.052 < 2e-16 ***
factor(week)24 -1.49486 0.10598 -14.105 < 2e-16 ***
trapF:factor(week)2 -0.60464 0.37302 -1.621 0.105036
trapSF:factor(week)2 -0.79014 0.53251 -1.484 0.137864
trapF:factor(week)3 -1.15172 0.21548 -5.345 9.05e-08 ***
trapSF:factor(week)3 -1.81414 0.37747 -4.806 1.54e-06 ***
trapF:factor(week)4 -0.42668 0.14128 -3.020 0.002526 **
trapSF:factor(week)4 -0.09850 0.16968 -0.581 0.561574
trapF:factor(week)5 -0.69388 0.18351 -3.781 0.000156 ***
trapSF:factor(week)5 0.29256 0.18062 1.620 0.105283
trapF:factor(week)6 -0.43222 0.11790 -3.666 0.000246 ***
trapSF:factor(week)6 0.20669 0.13920 1.485 0.137573
trapF:factor(week)7 0.33503 0.18533 1.808 0.070649 .
trapSF:factor(week)7 0.40085 0.23082 1.737 0.082452 .
trapF:factor(week)8 0.31353 0.11636 2.694 0.007051 **
trapSF:factor(week)8 0.37846 0.14745 2.567 0.010267 *
trapF:factor(week)9 -0.15545 0.14602 -1.065 0.287059
trapSF:factor(week)9 0.03374 0.17995 0.188 0.851260
trapF:factor(week)10 -0.67937 0.14425 -4.710 2.48e-06 ***
trapSF:factor(week)10 -1.50620 0.24730 -6.090 1.13e-09 ***
trapF:factor(week)11 -0.57479 0.21298 -2.699 0.006958 **
trapSF:factor(week)11 -0.93019 0.32090 -2.899 0.003748 **
trapF:factor(week)12 -0.82552 0.13929 -5.926 3.10e-09 ***
trapSF:factor(week)12 -0.63979 0.17392 -3.679 0.000235 ***
trapF:factor(week)13 -0.43268 0.20733 -2.087 0.036896 *
trapSF:factor(week)13 -1.16538 0.36202 -3.219 0.001286 **
trapF:factor(week)14 -0.74774 0.31163 -2.399 0.016421 *
trapSF:factor(week)14 -0.49003 0.36992 -1.325 0.185265
trapF:factor(week)15 -0.70262 0.54628 -1.286 0.198381
trapSF:factor(week)15 -1.46348 1.02663 -1.426 0.154005
trapF:factor(week)16 -0.25633 0.38382 -0.668 0.504231
trapSF:factor(week)16 0.11778 0.42965 0.274 0.783978
trapF:factor(week)17 -1.12133 0.53361 -2.101 0.035607 *
trapSF:factor(week)17 -1.18905 0.73504 -1.618 0.105733
trapF:factor(week)18 0.52383 0.51575 1.016 0.309795
trapSF:factor(week)18 -0.64250 1.05113 -0.611 0.541033
trapF:factor(week)19 0.43682 0.55536 0.787 0.431550
trapSF:factor(week)19 0.55142 0.66879 0.825 0.409651
trapF:factor(week)20 -0.37762 0.14589 -2.588 0.009644 **
trapSF:factor(week)20 -0.01561 0.17318 -0.090 0.928199
trapF:factor(week)21 0.48334 0.23367 2.068 0.038600 *
trapSF:factor(week)21 0.70330 0.27439 2.563 0.010373 *
trapF:factor(week)22 0.37143 0.21935 1.693 0.090385 .
trapSF:factor(week)22 0.43047 0.27247 1.580 0.114137
trapF:factor(week)23 -1.60007 0.35607 -4.494 7.00e-06 ***
trapSF:factor(week)23 -2.07325 0.59543 -3.482 0.000498 ***
trapF:factor(week)24 -1.25880 0.34293 -3.671 0.000242 ***
trapSF:factor(week)24 0.15509 0.26190 0.592 0.553743
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 17688.2 on 287 degrees of freedom
Residual deviance: 2729.5 on 213 degrees of freedom
AIC: 3997.8
Number of Fisher Scoring iterations: 6
Poisson model
Poisson model
Analysis of Deviance Table
Model: quasipoisson, link: log
Response: count
Terms added sequentially (first to last)
Df Deviance Resid. Df Resid. Dev F Pr(>F)
NULL 287 17688.2
block 3 243.6 284 17444.6 6.4161 0.0003517 ***
trap 2 5721.4 282 11723.2 226.0417 < 2.2e-16 ***
factor(week) 23 8539.4 259 3183.7 29.3369 < 2.2e-16 ***
trap:factor(week) 46 454.3 213 2729.5 0.7803 0.8408547
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Call:
glm(formula = count ~ block + trap * factor(week), family = quasipoisson,
data = cbb)
Deviance Residuals:
Min 1Q Median 3Q Max
-10.9119 -1.7382 -0.3523 1.0971 13.0833
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.48219 0.18001 24.900 < 2e-16 ***
blockII 0.36597 0.11477 3.189 0.001645 **
blockIII 0.44109 0.11306 3.901 0.000128 ***
blockIV 0.40526 0.11387 3.559 0.000459 ***
trapF -1.12996 0.32657 -3.460 0.000652 ***
trapSF -1.75539 0.42036 -4.176 4.33e-05 ***
factor(week)2 -2.25438 0.52363 -4.305 2.54e-05 ***
factor(week)3 -0.53723 0.26571 -2.022 0.044441 *
factor(week)4 0.02439 0.22683 0.108 0.914470
factor(week)5 -0.53372 0.26542 -2.011 0.045600 *
factor(week)6 0.77414 0.19506 3.969 9.88e-05 ***
factor(week)7 -1.36593 0.35791 -3.816 0.000178 ***
factor(week)8 0.27213 0.21419 1.271 0.205289
factor(week)9 -0.30568 0.24777 -1.234 0.218678
factor(week)10 0.16642 0.21929 0.759 0.448751
factor(week)11 -1.01572 0.31297 -3.245 0.001362 **
factor(week)12 0.41366 0.20799 1.989 0.047996 *
factor(week)13 -1.06821 0.31910 -3.348 0.000964 ***
factor(week)14 -1.74356 0.41825 -4.169 4.46e-05 ***
factor(week)15 -2.96733 0.72957 -4.067 6.70e-05 ***
factor(week)16 -2.60269 0.61448 -4.236 3.39e-05 ***
factor(week)17 -2.54862 0.59924 -4.253 3.16e-05 ***
factor(week)18 -3.78831 1.08469 -3.493 0.000582 ***
factor(week)19 -3.88362 1.13649 -3.417 0.000758 ***
factor(week)20 -0.12475 0.23567 -0.529 0.597117
factor(week)21 -2.04307 0.47637 -4.289 2.72e-05 ***
factor(week)22 -1.81676 0.43155 -4.210 3.77e-05 ***
factor(week)23 -1.25895 0.34315 -3.669 0.000308 ***
factor(week)24 -1.49486 0.37703 -3.965 0.000100 ***
trapF:factor(week)2 -0.60464 1.32702 -0.456 0.649117
trapSF:factor(week)2 -0.79014 1.89441 -0.417 0.677032
trapF:factor(week)3 -1.15172 0.76656 -1.502 0.134464
trapSF:factor(week)3 -1.81414 1.34284 -1.351 0.178139
trapF:factor(week)4 -0.42668 0.50259 -0.849 0.396856
trapSF:factor(week)4 -0.09850 0.60363 -0.163 0.870533
trapF:factor(week)5 -0.69388 0.65283 -1.063 0.289033
trapSF:factor(week)5 0.29256 0.64254 0.455 0.649349
trapF:factor(week)6 -0.43222 0.41943 -1.030 0.303947
trapSF:factor(week)6 0.20669 0.49519 0.417 0.676807
trapF:factor(week)7 0.33503 0.65932 0.508 0.611876
trapSF:factor(week)7 0.40085 0.82113 0.488 0.625937
trapF:factor(week)8 0.31353 0.41396 0.757 0.449653
trapSF:factor(week)8 0.37846 0.52454 0.721 0.471395
trapF:factor(week)9 -0.15545 0.51946 -0.299 0.765038
trapSF:factor(week)9 0.03374 0.64016 0.053 0.958013
trapF:factor(week)10 -0.67937 0.51316 -1.324 0.186956
trapSF:factor(week)10 -1.50620 0.87978 -1.712 0.088350 .
trapF:factor(week)11 -0.57479 0.75766 -0.759 0.448911
trapSF:factor(week)11 -0.93019 1.14160 -0.815 0.416093
trapF:factor(week)12 -0.82552 0.49554 -1.666 0.097204 .
trapSF:factor(week)12 -0.63979 0.61872 -1.034 0.302286
trapF:factor(week)13 -0.43268 0.73758 -0.587 0.558077
trapSF:factor(week)13 -1.16538 1.28790 -0.905 0.366557
trapF:factor(week)14 -0.74774 1.10863 -0.674 0.500743
trapSF:factor(week)14 -0.49003 1.31597 -0.372 0.709984
trapF:factor(week)15 -0.70262 1.94340 -0.362 0.718054
trapSF:factor(week)15 -1.46348 3.65221 -0.401 0.689034
trapF:factor(week)16 -0.25633 1.36543 -0.188 0.851267
trapSF:factor(week)16 0.11778 1.52847 0.077 0.938648
trapF:factor(week)17 -1.12133 1.89832 -0.591 0.555351
trapSF:factor(week)17 -1.18905 2.61488 -0.455 0.649772
trapF:factor(week)18 0.52383 1.83479 0.285 0.775541
trapSF:factor(week)18 -0.64250 3.73938 -0.172 0.863741
trapF:factor(week)19 0.43682 1.97569 0.221 0.825230
trapSF:factor(week)19 0.55142 2.37920 0.232 0.816942
trapF:factor(week)20 -0.37762 0.51901 -0.728 0.467672
trapSF:factor(week)20 -0.01561 0.61609 -0.025 0.979815
trapF:factor(week)21 0.48334 0.83129 0.581 0.561566
trapSF:factor(week)21 0.70330 0.97614 0.720 0.472013
trapF:factor(week)22 0.37143 0.78032 0.476 0.634561
trapSF:factor(week)22 0.43047 0.96931 0.444 0.657423
trapF:factor(week)23 -1.60007 1.26671 -1.263 0.207909
trapSF:factor(week)23 -2.07325 2.11825 -0.979 0.328811
trapF:factor(week)24 -1.25880 1.21997 -1.032 0.303323
trapSF:factor(week)24 0.15509 0.93170 0.166 0.867957
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for quasipoisson family taken to be 12.65572)
Null deviance: 17688.2 on 287 degrees of freedom
Residual deviance: 2729.5 on 213 degrees of freedom
AIC: NA
Number of Fisher Scoring iterations: 6
Quasi-Poisson model
Quasi-Poisson model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.