|
|
|
||||
|
|
|||||
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.
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.
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
tabstat daysabs, stat(n mean var)
variable | N mean variance
-------------+------------------------------
daysabs | 316 5.810127 55.48764
--------------------------------------------
histogram daysabs, discrete freq
tab male
male | Freq. Percent Cum.
------------+-----------------------------------
0 | 162 51.27 51.27
1 | 154 48.73 100.00
------------+-----------------------------------
Total | 316 100.00
poisson daysabs math langarts male
Iteration 0: log likelihood = -1547.9709
Iteration 1: log likelihood = -1547.9709
Poisson regression Number of obs = 316
LR chi2(3) = 175.27
Prob > chi2 = 0.0000
Log likelihood = -1547.9709 Pseudo R2 = 0.0536
------------------------------------------------------------------------------
daysabs | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
math | -.0035232 .0018213 -1.93 0.053 -.007093 .0000466
langarts | -.0121521 .0018348 -6.62 0.000 -.0157483 -.0085559
male | -.4009209 .0484122 -8.28 0.000 -.495807 -.3060348
_cons | 2.687666 .0726512 36.99 0.000 2.545272 2.83006
------------------------------------------------------------------------------
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.
Now, just to be on the safe side, let's rerun the poisson command with the robust option in order to obtain robust standard errors for the poisson regression coefficients.
poisson daysabs math langarts male, robust
Iteration 0: log pseudolikelihood = -1547.9709
Iteration 1: log pseudolikelihood = -1547.9709
Poisson regression Number of obs = 316
Wald chi2(3) = 27.62
Prob > chi2 = 0.0000
Log pseudolikelihood = -1547.9709 Pseudo R2 = 0.0536
------------------------------------------------------------------------------
| Robust
daysabs | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
math | -.0035232 .0076373 -0.46 0.645 -.018492 .0114455
langarts | -.0121521 .0052951 -2.29 0.022 -.0225304 -.0017739
male | -.4009209 .1395915 -2.87 0.004 -.6745153 -.1273266
_cons | 2.687666 .2181435 12.32 0.000 2.260113 3.115219
------------------------------------------------------------------------------
Using the robust option has resulted in a fairly large change in the
model chi-square, which is now a Wald chi-square, based on log pseudolikelihoods, instead of a likelihood ratio
chi-square.In the main body of the output are the poisson coefficients, robust standard errors, z-scores, p-values and 95% confidence intervals for the coefficients. The variable math was border-line significant without the robust option and is clearly not significant with it. The robust standard errors attempt to adjust for heterogeneity in the model.
Since math is not significant in the model with robust standard errors, we will rerun the model dropping that variable.
poisson daysabs langarts male, robust
Iteration 0: log pseudolikelihood = -1549.8567
Iteration 1: log pseudolikelihood = -1549.8567
Poisson regression Number of obs = 316
Wald chi2(2) = 27.31
Prob > chi2 = 0.0000
Log pseudolikelihood = -1549.8567 Pseudo R2 = 0.0524
------------------------------------------------------------------------------
| Robust
daysabs | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
langarts | -.01467 .0034382 -4.27 0.000 -.0214087 -.0079313
male | -.4093528 .1354388 -3.02 0.003 -.674808 -.1438975
_cons | 2.646977 .1826364 14.49 0.000 2.289016 3.004937
------------------------------------------------------------------------------
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
poisson: Changes in Rate for daysabs
min->max 0->1 -+1/2 -+sd/2 MargEfct
langarts -8.6843 -0.1683 -0.0814 -1.4637 -0.0814
male -2.2743 -2.2743 -2.2861 -1.1385 -2.2702
exp(xb): 5.5458
langarts male
x= 50.0638 .487342
sd(x)= 17.9392 .500633
estout, cells(b(star fmt(%8.2f)) se(par fmt(%8.2f))) stats(ll chi2, fmt(%8.2f))
.
b/se
daysabs
langarts -0.01***
(0.00)
male -0.41**
(0.14)
_cons 2.65***
(0.18)
ll -1549.86
chi2 27.31
With a little bit of manual editing
we can produce an acceptable table of the output.
model
language arts -0.01***
(0.00)
male -0.41**
(0.14)
constant 2.65***
(0.18)
log psuedo-
likelihood -1549.86
chi-squared 27.31
legend: coefficient/(standard error) ** p<0.01 *** p<0.001
The poisson regression model predicting days absent from school using
language arts and gender was statistically significant
(chi-squared = 27.31, df = 2, p<.0001).
The predictors
langarts and male were each statically significant.
For these data, the expected log count for a one-unit increase in language arts was -0.0146. Male students had an expected log count -0.41 less than female students.
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