# How do you deal with overdispersion in a zero-inflated negative binomial regression AND when you expect data to have zeros?

Background: I am analyzing the effect of multiple variables (lineage, ancestral plant species, plant species reared from, larval density, body mass) on different traits: ovigeny index (initial egg load/fecundity) and initial egg load (continuous).

1. I have an overdispersion problem with my initial egg load data. There are many virgin females that emerge from plants with 0 eggs, but this is expected. Anyway, I figured out how to do a zero-inflated negative binomial regression to test for overdispersion on the non-zero count data. My Log(theta) is significant, indicating overdispersion. My question is, can I still accept this model? I do not really know how to correct for overdispersion of it is necessary.

Output:

Call:
zeroinfl(formula = iel ~ population * adapthost + population * expthost + adapthost *
expthost + expthost * f1dens2 + mass | population * adapthost + population * expthost +
adapthost * expthost + expthost * f1dens2 + mass, data = data124.fem, dist = "negbin")

Pearson residuals:
Min      1Q  Median      3Q     Max
-1.6907 -0.7544 -0.1254  0.5934  5.5976

Count model coefficients (negbin with log link):
Estimate Std. Error z value Pr(>|z|)
(Intercept)              2.51482    0.14779  17.016  < 2e-16 ***
populationSI             0.18640    0.06065   3.073 0.002118 **
expthostm               -0.70048    0.10820  -6.474 9.55e-11 ***
f1dens2                 -0.07933    0.02396  -3.311 0.000928 ***
mass                     0.04979    0.02010   2.477 0.013235 *
populationSI:expthostm  -0.20515    0.08391  -2.445 0.014489 *
expthostm:f1dens2        0.07014    0.03570   1.965 0.049453 *
Log(theta)               1.29683    0.06938  18.693  < 2e-16 ***

Zero-inflation model coefficients (binomial with logit link):
Estimate Std. Error z value Pr(>|z|)
(Intercept)             -3.17317    1.41181  -2.248   0.0246 *
populationSI            -2.10861    1.74115  -1.211   0.2259
expthostm                2.38466    1.29428   1.842   0.0654 .
f1dens2                  0.16995    0.37446   0.454   0.6499
mass                    -0.14929    0.10097  -1.479   0.1393
populationSI:expthostm   1.61634    1.75901   0.919   0.3582
expthostm:f1dens2       -0.05971    0.38912  -0.153   0.8780
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Theta = 3.6577
Number of iterations in BFGS optimization: 32
Log-likelihood: -3352 on 21 Df

1. I tried doing both a binomial and quasibinomial logistic regression on my ovigeny data, which is the ratio of initial egg load/lifetime fecundity. This response is set up as two columns: initial egg load and remaining eggs. The latter of which is the difference of initial egg load and lifetime fecundity. Both analyses showed overdispersion, perhaps because of the number of females that emerged with no eggs. I tried searching for "zero-inflated logistic regression", but no luck or nobody thinks it is a model that could be done. What should I do?

Note: Ovigeny index and initial egg load are different ways of assessing a female's tendency to reproduce early.

Output:
Call:
glm(formula = oibound2 ~ population * adapthost + population *
expthost + adapthost * expthost + expthost * f1dens2 + mass,
family = "binomial", data = data124.fem)

Deviance Residuals:
Min       1Q   Median       3Q      Max
-5.8838  -2.0061  -0.3359   1.2893   9.0248

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)             -1.89575    0.07926 -23.917  < 2e-16 ***
populationSI             0.31761    0.02988  10.631  < 2e-16 ***
adapthostm              -0.14315    0.03888  -3.681 0.000232 ***
expthostm               -0.97427    0.05862 -16.621  < 2e-16 ***
f1dens2                 -0.09291    0.01175  -7.905 2.68e-15 ***
mass                     0.07947    0.01104   7.197 6.18e-13 ***
populationSI:adapthostm -0.25905    0.05978  -4.333 1.47e-05 ***
populationSI:expthostm  -0.20346    0.04491  -4.530 5.90e-06 ***
adapthostm:expthostm     0.20463    0.05243   3.903 9.52e-05 ***
expthostm:f1dens2        0.06222    0.01946   3.197 0.001389 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 7775.9  on 1084  degrees of freedom
Residual deviance: 5970.6  on 1075  degrees of freedom
AIC: 9681

Number of Fisher Scoring iterations: 5

Output:
Call:
glm(formula = oibound2 ~ population * adapthost + population *
expthost + adapthost * expthost + expthost * f1dens2 + mass,
family = "quasibinomial", data = data124.fem)

Deviance Residuals:
Min       1Q   Median       3Q      Max
-5.8838  -2.0061  -0.3359   1.2893   9.0248

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)             -1.89575    0.18048 -10.504  < 2e-16 ***
populationSI             0.31761    0.06803   4.669 3.41e-06 ***
expthostm               -0.97427    0.13347  -7.300 5.60e-13 ***
f1dens2                 -0.09291    0.02676  -3.472 0.000538 ***
mass                     0.07947    0.02514   3.161 0.001619 **
populationSI:adapthostm -0.25905    0.13612  -1.903 0.057288 .
populationSI:expthostm  -0.20346    0.10227  -1.990 0.046898 *
adapthostm:expthostm     0.20463    0.11939   1.714 0.086838 .
expthostm:f1dens2        0.06222    0.04431   1.404 0.160595
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for quasibinomial family taken to be 5.184705)

Null deviance: 7775.9  on 1084  degrees of freedom
Residual deviance: 5970.6  on 1075  degrees of freedom
AIC: NA

Number of Fisher Scoring iterations: 5


The book Zur et al 2009 Mixed effects models in R chapter 9 discusses count data and zero inflated negative binomials that may help you. If you have unwanted zeroes and wanted zero data with counts displaying overdisperion then a ZINB model e.g. zeroinfl(... works. If your zero data are what actually occurred and not erroneous then a hurdle model will be the approach. I carried out both and they were nearly identical.
model <- hurdle(formula, dist = "negbin", link = "logit", data = YourDF)