# Zero inflated negative binomial regression dummy variable effects

I am running a zero inflated negative binomial model (zinb) and want to interpret the main and interaction effects.

I have the following:

People decide whether to purchase a good during a given week and I have their final purchase quantity (Min qty = 0 units and Max qty = 6 units observed from the data). Assume I am looking at the results for a particular week. I have multiple demographics variable but two discrete variables are imp namely:

education (=1 if buyer has college degree, 0 otherwise) and
gender (1 = female, 0 = male).


Due to the presence of a large number of 0's and overdispersion, I use a zinb model.

# The code I use on Stata (providing the code so that people can look up
#  the regression equation):

zinb purchase_qty i.gender##i.educ, inflate (c.age)


The regression results are (I'm not presenting results for the inflation part here):

 purchase_qty              Coef.    P>|z|
1.gender                  -0.26    0.028
1.education               -0.07    0
gender##education 1 1      0.12    0.027
_cons                     -0.5     0.56


What I want to calculate from the above table is the average qty purchased by the four groups:

  (gender=0 & educ=0,gender=1 & educ=0,gender=0 & educ=1 and gender=1 & educ=1).


Could someone please explain how to do this from the above output(taking into account that main effect and interaction effect are significant)?

P.S. Please let me know if you need any clarification from my side.

Edit: I had used the wrong dependent variable initially which I changed later.

Edit 2: Inflation part results -

inflate        Coef.    P>|z|
age            -0.6     0.015
_cons           0.9     0

• From your description expenditure appears to be a continuous variable. Then a count model is probably not the best way to approach the problem. Wouldn't it make more sense to use a tobit-type model? My first guess would be a (Heckman) selection model where the binary selection model is for purchase (y/n) and the outcome model is for log(expenditure). Commented Apr 21, 2017 at 20:18
• Woops wrong variable. I meant quantity.Thanks for pointing that out. Commented Apr 21, 2017 at 20:23

The zero-inflated negative binomial model is a mixture model with two components/clusters. The individuals in one cluster never purchases (i.e., purchase_qty = 0) and the individuals in the other cluster follow a negative binomial distribution (i.e., they may sometimes also have purchase_qty = 0 but also larger values).

The inflation equation controls the probability of belonging to the former cluster. By default, this uses a logit link so that in your case the probability is $\mathrm{invlogit}(0.9 - 0.6 \cdot \mathrm{age})$. The inverse logit link is $\mathrm{invlogit}(x) = \exp(x) / (1 + \exp(x))$.

The expectation within the second cluster can be computed by $\exp(-0.5 -0.26 \cdot \mathrm{gender} -0.07 \cdot \mathrm{education} + 0.12 \cdot (\mathrm{gender} \times \mathrm{education}))$. So you can easily input the four possible combinations of gender and education into this equation.

However, note that this is only the expectation given an observation from the second cluster. But as cluster membership is not directly observed for the zeros, the overall expectation is the product of the count expectation and (1 - inflation probability).

(For more details: The Stata manual for zinb also gives some of the relevant formulas - as does our R-based discussion at http://dx.doi.org/10.18637/jss.v027.i08)

• Awesome. One more question. Would you know how I would calculate the inflation probability? I updated my post with the results from the inflation part of the model. Commented Apr 21, 2017 at 21:34
• I've added some further remarks about the inflation probability. Commented Apr 21, 2017 at 23:08

Not sure how to program this in Stata because I don't use it, but the four quantities you want (in order) should be

exp(_cons)=0.61 units
exp(_cons+gender)=0.47 units
exp(_cons+education)=0.57 units
exp(_cons+gender+education+gender*interaction)=0.81 units


edit: beaten by one minute

• The fourth quantity is missing the interaction term. Also for exp(-0.5) I get 0.607 not 0.78. Commented Apr 21, 2017 at 22:58
• Well, I still get exp(-0.5 - 0.26 - 0.07 + 0.12) = 0.49... Commented Apr 22, 2017 at 0:29
• Not sure what happened. Sorry about that. Commented Apr 22, 2017 at 4:17