|
|
|
||||
|
|
|||||
Example 1. School administrators study the attendance behavior of high school juniors at two schools. Predictors of the number of days of absence include gender of the student and standardized test scores in math and language arts.
Example 2. The state wildlife biologists want to model how many fish are being caught by fishermen at a state park. Visitors are asked how long they stayed, how many people were in the group, were there children in the group and how many fish were caught. Some visitors do not fish, but there is no data on whether a person fished or not. Some visitors who did fish did not catch any fish so there are excess zeros in the data because of the people that did not fish.
We have attendance data on 316 high school juniors from two urban high schools in the file poissonreg.dta The response variable of interest is days absent, daysabs. The variables math and langarts give the standardized test scores for math and language arts respectively. The variable male is a binary indicator of student gender.
In addition to predicting the number of days absent there is interest in predicting the existence of excess zeros, i.e., the probability that a student will have zero absences. We will use the variable school to investigate this.
Let's look at the data.
use http://www.ats.ucla.edu/stat/stata/dae/poissonreg, clear
summarize daysabs math langarts male
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
daysabs | 316 5.810127 7.449003 0 45
math | 316 48.75101 17.88076 1.007114 98.99289
langarts | 316 50.06379 17.93921 1.007114 98.99289
male | 316 .4873418 .5006325 0 1
school | 316 1.496835 .500783 1 2
tabstat daysabs, stat(n mean var)
variable | N mean variance
-------------+------------------------------
daysabs | 316 5.810127 55.48764
--------------------------------------------
histogram daysabs, discrete freq
tab1 male school
-> tabulation of male
male | Freq. Percent Cum.
------------+-----------------------------------
0 | 162 51.27 51.27
1 | 154 48.73 100.00
------------+-----------------------------------
Total | 316 100.00
-> tabulation of school
school | Freq. Percent Cum.
------------+-----------------------------------
1 | 159 50.32 50.32
2 | 157 49.68 100.00
------------+-----------------------------------
Total | 316 100.00
zinb daysabs math langarts male, inflate(school) vuong
Fitting constant-only model:
Iteration 0: log likelihood = -989.38831
Iteration 1: log likelihood = -898.18259
Iteration 2: log likelihood = -889.68818
Iteration 3: log likelihood = -888.03208
Iteration 4: log likelihood = -887.7173
Iteration 5: log likelihood = -887.66641
Iteration 6: log likelihood = -887.65515
Iteration 7: log likelihood = -887.65269
Iteration 8: log likelihood = -887.65226
Iteration 9: log likelihood = -887.65216
Iteration 10: log likelihood = -887.65214
Fitting full model:
Iteration 0: log likelihood = -887.65214
Iteration 1: log likelihood = -879.10154
Iteration 2: log likelihood = -878.2199
Iteration 3: log likelihood = -878.21612
Iteration 4: log likelihood = -878.21612
Zero-inflated negative binomial regression Number of obs = 316
Nonzero obs = 254
Zero obs = 62
Inflation model = logit LR chi2(3) = 18.87
Log likelihood = -878.2161 Prob > chi2 = 0.0003
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
daysabs |
math | -.0009049 .0047223 -0.19 0.848 -.0101605 .0083506
langarts | -.0135826 .0054659 -2.48 0.013 -.0242956 -.0028696
male | -.4124475 .135929 -3.03 0.002 -.6788635 -.1460316
_cons | 2.694427 .2236049 12.05 0.000 2.256169 3.132684
-------------+----------------------------------------------------------------
inflate |
school | 19.31956 5997.093 0.00 0.997 -11734.77 11773.41
_cons | -40.6701 11994.19 -0.00 0.997 -23548.84 23467.5
-------------+----------------------------------------------------------------
/lnalpha | .0967353 .1146672 0.84 0.399 -.1280084 .3214789
-------------+----------------------------------------------------------------
alpha | 1.101569 .1263138 .879846 1.379166
------------------------------------------------------------------------------
Vuong test of zinb vs. standard negative binomial: z = 1.12 Pr>z = 0.1311
The output looks very much like the output from an OLS regression. The output begins
the iteration log giving the values of the log likelihoods starting
with a model that has no predictors. The last value in the log is the final value
of the log likelihood for the full model and is repeated below.Next comes the header information. On the right-hand side the number of observations used (316) is given along with the likelihood ratio chi-squared with three degrees of freedom for the full model, followed by the p-value for the chi-square. The model, as a whole, is statistically significant. The header also includes a pseudo-R2 which is 0.0536 in this example.
Below the header you will find the poisson regression coefficients for each of the variables along with standard errors, z-scores, p-values and 95% confidence intervals for the coefficients. Following these, are probit coefficients for predicting excess zeros along with their standard errors, z-scores, p-values and confidence intervals.
Below the various coefficients you will find the results of the Vuong test. The Vuong test compares the zero-inflated model with an ordinary poisson regression model. A significant z-test indicates that the zero-inflated model is better.
Since math is clearly not significant, let's rerun the model without it.
zinb daysabs langarts male, inflate(school) vuong zip
Fitting constant-only model:
Iteration 0: log likelihood = -989.38831
Iteration 1: log likelihood = -898.18259
Iteration 2: log likelihood = -889.68818
Iteration 3: log likelihood = -888.03208
Iteration 4: log likelihood = -887.7173
Iteration 5: log likelihood = -887.66641
Iteration 6: log likelihood = -887.65515
Iteration 7: log likelihood = -887.65269
Iteration 8: log likelihood = -887.65226
Iteration 9: log likelihood = -887.65216
Iteration 10: log likelihood = -887.65214
Fitting full model:
Iteration 0: log likelihood = -887.65214
Iteration 1: log likelihood = -879.11709
Iteration 2: log likelihood = -878.23821
Iteration 3: log likelihood = -878.23446
Iteration 4: log likelihood = -878.23446
Zero-inflated negative binomial regression Number of obs = 316
Nonzero obs = 254
Zero obs = 62
Inflation model = logit LR chi2(2) = 18.84
Log likelihood = -878.2345 Prob > chi2 = 0.0001
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
daysabs |
langarts | -.0143223 .0038697 -3.70 0.000 -.0219068 -.0067378
male | -.4123582 .1359164 -3.03 0.002 -.6787495 -.1459669
_cons | 2.687697 .2207211 12.18 0.000 2.255092 3.120302
-------------+----------------------------------------------------------------
inflate |
school | 19.32026 5999.448 0.00 0.997 -11739.38 11778.02
_cons | -40.66774 11998.9 -0.00 0.997 -23558.07 23476.74
-------------+----------------------------------------------------------------
/lnalpha | .0963472 .1146165 0.84 0.401 -.1282969 .3209913
-------------+----------------------------------------------------------------
alpha | 1.101141 .1262089 .8795922 1.378494
------------------------------------------------------------------------------
Likelihood-ratio test of alpha=0: chibar2(01) = 943.87 Pr>=chibar2 = 0.0000
Vuong test of zinb vs. standard negative binomial: z = 1.13 Pr>z = 0.1298
In the main body of the output contains the poisson and probit coefficients, robust standard
errors, z-scores, p-values and 95% confidence intervals for the coefficients. The robust
standard errors attempt to adjust for heterogeneity in the model. Finally, we will use the prchange command (findit prchange) by J. Scott Long and Jeremy Freese to get the predicted change in days absent.
prchange
zinb: Changes in Rate for daysabs
min->max 0->1 -+1/2 -+sd/2
langarts -8.9375 -0.1710 -0.0841 -1.5121
male -2.4247 -2.4247 -2.4374 -1.2138
exp(xb): 5.8691
base x values for count equation:
langarts male
x= 50.0638 .487342
sd(x)= 17.9392 .500633
base x values for binary equation:
school
x= 1.49684
sd(x)= .500783
The first indication that something is amiss is that the standard errors for the constant and coefficient for the inflation part of the model are so large. The associated z-scores are zero and the p-values are close to 1.0. The other indicator is that the Vuong test is not significant, i.e., the zero-inflated negative binomial model is not significantly better than the standard negative binomial model.
Although the count part of the model is still valid and you can obtain predicted counts you are probably better off running this model as an ordinary negative binimial regression model.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services