Case study analysed in Bonat et. al. (2016) concernings on data of animals hunted in the village of Basile Fang, Bioko Norte Province, Bioko Island, Equatorial Guinea. Monthly number of blue duikers and other small animals shot or snared was collected for a random sample of 52 commercial hunters from August 2010 to September 2013. For each animal caught, the species, sex, method of capture and altitude were documented. The data set has 1216 observations.
ALT
- Factor five levels indicating the Altitude where
the animal was caught.
SEX
- Factor two levels Female
and Male
.
METHOD
- Factor two levels Escopeta
and
Trampa
.
OT
- Monthly number of other small animals hunted.
BD
- Monthly number of blue duikers hunted.
OFFSET
- Monthly number of hunter days.
HUNTER
- Hunter index.
MONTH
- Month index.
MONTHCALENDAR
- Month using calendar numbers
(1-January, ..., 12-December).
YEAR
- Year calendar (2010--2013).
HUNTER.MONTH
- Index indicating observations taken at
the same HUNTER and MONTH.
data(Hunting)
a data.frame
with 1216 records and 11 variables.
Bonat, et. al. (2017). Modelling the covariance structure in marginal multivariate count models: Hunting in Bioko Island. Journal of Agricultural Biological and Environmental Statistics, 22(4):446--464.
Bonat, W. H. (2018). Multiple Response Variables Regression Models in R: The mcglm Package. Journal of Statistical Software, 84(4):1--30.
library(mcglm) library(Matrix) data(Hunting, package="mcglm") formu <- OT ~ METHOD*ALT + SEX + ALT*poly(MONTH, 4) Z0 <- mc_id(Hunting) Z1 <- mc_mixed(~0 + HUNTER.MONTH, data = Hunting) fit <- mcglm(linear_pred = c(formu), matrix_pred = list(c(Z0, Z1)), link = c("log"), variance = c("poisson_tweedie"), power_fixed = c(FALSE), control_algorithm = list(max_iter = 100), offset = list(log(Hunting$OFFSET)), data = Hunting)#> Automatic initial values selected.summary(fit)#> Call: OT ~ METHOD * ALT + SEX + ALT * poly(MONTH, 4) #> <environment: 0x55608cca7048> #> #> Link function: log #> Variance function: poisson_tweedie #> Covariance function: identity #> Regression: #> Estimates Std.error Z value Pr(>|z|) #> (Intercept) 0.13089587 0.14031792 0.9328521 3.508963e-01 #> METHODTrampa 0.18769806 0.19190240 0.9780913 3.280292e-01 #> ALT2 -1.19765449 0.22748893 -5.2646715 1.404403e-07 #> ALT3 -2.28296770 0.21058201 -10.8412283 2.195038e-27 #> ALT4 -1.82046741 0.20019745 -9.0933594 9.602518e-20 #> ALT5 -0.72642486 0.20917598 -3.4727928 5.150728e-04 #> SEXMale -0.62263799 0.07726418 -8.0585596 7.719871e-16 #> poly(MONTH, 4)1 -4.32955737 4.24654169 -1.0195490 3.079424e-01 #> poly(MONTH, 4)2 0.63606608 4.06550558 0.1564544 8.756749e-01 #> poly(MONTH, 4)3 3.81570790 3.90271565 0.9777058 3.282198e-01 #> poly(MONTH, 4)4 -6.81676586 3.87137317 -1.7608134 7.826999e-02 #> METHODTrampa:ALT2 0.48507919 0.28765723 1.6863097 9.173616e-02 #> METHODTrampa:ALT3 0.50980890 0.28150282 1.8110259 7.013684e-02 #> METHODTrampa:ALT4 -0.07346138 0.31124559 -0.2360238 8.134142e-01 #> METHODTrampa:ALT5 -0.87459090 0.26873038 -3.2545294 1.135804e-03 #> ALT2:poly(MONTH, 4)1 11.90946536 6.00988368 1.9816466 4.751881e-02 #> ALT3:poly(MONTH, 4)1 -5.69052448 6.59207032 -0.8632378 3.880067e-01 #> ALT4:poly(MONTH, 4)1 19.08245831 6.10984981 3.1232287 1.788787e-03 #> ALT5:poly(MONTH, 4)1 7.49413970 5.93001530 1.2637640 2.063148e-01 #> ALT2:poly(MONTH, 4)2 -21.49972800 5.75101119 -3.7384257 1.851762e-04 #> ALT3:poly(MONTH, 4)2 7.74842342 6.14524717 1.2608807 2.073518e-01 #> ALT4:poly(MONTH, 4)2 -3.32316409 6.06102570 -0.5482841 5.834968e-01 #> ALT5:poly(MONTH, 4)2 -10.01467508 5.79764812 -1.7273686 8.410149e-02 #> ALT2:poly(MONTH, 4)3 -10.74942077 5.86361121 -1.8332424 6.676653e-02 #> ALT3:poly(MONTH, 4)3 16.11160568 6.42675201 2.5069593 1.217747e-02 #> ALT4:poly(MONTH, 4)3 10.12952233 6.21855478 1.6289190 1.033302e-01 #> ALT5:poly(MONTH, 4)3 -15.22569504 5.65927702 -2.6903958 7.136732e-03 #> ALT2:poly(MONTH, 4)4 2.10375138 6.17790642 0.3405282 7.334588e-01 #> ALT3:poly(MONTH, 4)4 5.34872114 6.80568130 0.7859200 4.319143e-01 #> ALT4:poly(MONTH, 4)4 4.55954897 6.22349967 0.7326342 4.637815e-01 #> ALT5:poly(MONTH, 4)4 12.17402736 5.84782958 2.0818027 3.736050e-02 #> #> Power: #> Estimates Std.error Z value Pr(>|z|) #> 1 1.796619 0.2198597 8.171661 3.041726e-16 #> #> Dispersion: #> Estimates Std.error Z value Pr(>|z|) #> 1 0.2432901 0.1015518 2.395725 1.658753e-02 #> 2 0.6191428 0.1022463 6.055408 1.400623e-09 #> #> Algorithm: chaser #> Correction: TRUE #> Number iterations: 39anova(fit)#> Wald test for fixed effects #> Call: OT ~ METHOD * ALT + SEX + ALT * poly(MONTH, 4) #> <environment: 0x55608cca7048> #> #> Covariate Chi.Square Df p.value #> 1 METHODTrampa 0.9567 1 0.3280 #> 2 ALT2 149.8056 4 0.0000 #> 3 SEXMale 64.9404 1 0.0000 #> 4 poly(MONTH, 4)1 6.8163 4 0.1459 #> 5 METHODTrampa:ALT2 30.8194 4 0.0000 #> 6 ALT2:poly(MONTH, 4)1 93.7551 16 0.0000 #>