First, I have looked at other posts but none address this specific question. I am trying to evaluate goodness of fit for a negative binomial regression, and what the dispersion parameter indicates in this case. First I tried Poisson (and quasipoisson) glm, but the goodness of fit test resulted in a rejection of fit.
Here are my data:
season e.total hunting gosh o.traps
2012 93 7 0 0
2013 61 10 5 14
2014 4 20 58 9
2015 10 10 27 15
2016 3 5 64 1
2017 0 4 46 0
Briefly, e.total is the number of eggs of an endangered species that were depredated due to a predator. Hunting, gosh, and o.traps are the number of those predators removed via human control methods. I am trying to determine which predictor has strongest relationship to e.total.
First I tried poisson and quasiposisson with all variations of the 3 predictors, but whenever I tested for goodness of fit, I would always reject.
So I try negative binomial:
nb.1 <- glm.nb(e.total ~ hunting + gosh + o.traps, data = pred.data)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.77051 0.86806 4.344 0.0491 *
hunting 0.10873 0.12086 0.900 0.4633
gosh -0.07331 0.01841 -3.983 0.0576 .
o.traps -0.02903 0.03510 -0.827 0.4951
No great result. Also I should note I try everything up to saturated model and get similar results. So I tried collapsing the hunting and o.traps data into one variable and call it non.gosh:
nb.5 <- glm.nb(e.total ~ gosh + non.gosh, data = pred.data)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.517387 0.299408 15.088 0.000632 ***
gosh -0.069117 0.013874 -4.982 0.015547 *
non.gosh -0.002412 0.018570 -0.130 0.904869
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for Negative Binomial(80519.82) family taken to be 3.990911)
Finally to my explicit question: Can I test goodness of fit here using:
1 - pchisq(summary(nb.5)$deviance,
summary(nb.5)$df.residual
)
and the dispersion parameter seems way too large here. How do I interpret 80519.82? Am I correctly going about model selection?
e.total
andlog(1+gosh)
, suggesting the simple Poisson model fit withglm(total ~ I(log(1 + gosh)), family="poisson", data=pred.data)
might work quite well. Your models use so many variables--five parameters for six observations!--that they're unlikely to be useful. A scatterplot matrix of your data makes it abundantly clear thatgosh
has the strongest relationship withe.total
, regardless: seewith(data.pred, pairs(cbind(e.total, hunting, o.traps, log.gosh=log(1+gosh))))
. $\endgroup$