Notes on Poisson Regression and Some Extensions
Notes on Poisson Regression and Some Extensions
Notes on Poisson Regression and Some Extensions
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
------------------------------------------------------------------------------childs | Coef. Std. Err. z P>|z| [95% C<strong>on</strong>f. Interval]-------------+----------------------------------------------------------------childs |boomer | -.4280169 .0415171 -10.31 0.000 -.509389 -.3466449married | .0851949 .0454331 1.88 0.061 -.0038523 .1742421_Ideg_2 | -.2272821 .0532389 -4.27 0.000 -.3316285 -.1229357_Ideg_3 | -.4033855 .0640953 -6.29 0.000 -.5290099 -.2777611n<strong>on</strong>wht | .1115982 .0490869 2.27 0.023 .0153897 .2078068income | -.0271459 .0083784 -3.24 0.001 -.0435673 -.0107244_c<strong>on</strong>s | 1.473333 .0846589 17.40 0.000 1.307404 1.639261-------------+----------------------------------------------------------------inflate |boomer | 1.486534 .2721459 5.46 0.000 .9531378 2.01993_Ideg_2 | .0095591 .3414682 0.03 0.978 -.6597061 .6788244_Ideg_3 | .7008029 .355765 1.97 0.049 .0035162 1.39809n<strong>on</strong>wht | -1.289767 .3455102 -3.73 0.000 -1.966955 -.6125796_c<strong>on</strong>s | -2.027314 .3265346 -6.21 0.000 -2.66731 -1.387317------------------------------------------------------------------------------Here we find that having less than a HS educati<strong>on</strong> ( Ideg 2) has a negligible effect <strong>on</strong> beingchildless, but a large effect <strong>on</strong> the rate of childbearing. We can use BIC/AIC criteria to check thismodel against the Poiss<strong>on</strong> regressi<strong>on</strong> model (these are not nested). It is worthwhile to examinehow well it fits the observed distributi<strong>on</strong> compared to the Poiss<strong>on</strong> model. Fig. 2 examines the nullmodel of each specificati<strong>on</strong>. Below is the code to make the graph.*do Poiss<strong>on</strong> Assumpti<strong>on</strong>s hold?* zero inflati<strong>on</strong> NULL model accounts for excess 0 counts --> compare to Poiss<strong>on</strong> NULL model*gen c<strong>on</strong>s = 1zip childs, inflate(c<strong>on</strong>s)matrix bzip = e(b)gen lamzip = exp(bzip[1,1])gen p1 = exp(bzip[1,2])/(1 + exp(bzip[1,2]))gen p0 = 1 - p1gen PrY_zip = p1 + p0*( exp(-lamzip)*lamzip^y/exp(lngamma(y+1)) ) if y==0replace PrY_zip = p0*( exp(-lamzip)*lamzip^y/exp(lngamma(y+1)) ) if (y ~=0)twoway (histogram y, discrete fracti<strong>on</strong> blcolor(black) bfcolor(n<strong>on</strong>e) ///legend(off) ytitle(Pr(Y=y)) ) (c<strong>on</strong>nected PrY_pois y, sort legend(off)) ///(c<strong>on</strong>nected PrY_zip y, sort legend(off))There is always the questi<strong>on</strong> of which variables should appear in each secti<strong>on</strong> of the zip model.It is best to retain the complete model specificati<strong>on</strong> in the Poiss<strong>on</strong> part <strong>and</strong> attempt to justify(theoretically) which variables should should be predictive of zeros, <strong>and</strong> included in the zeroinflati<strong>on</strong> porti<strong>on</strong> of the model. Then we can trim the model accordingly based <strong>on</strong> significancetests. How well does this model compare to the st<strong>and</strong>ard Poiss<strong>on</strong> model. They are not nested, sowe should use other ad-hoc criteria such as AIC or BIC. We can use L<strong>on</strong>g <strong>and</strong> Freese fitstatroutine. However, it is not hard to do this by h<strong>and</strong>. First, we need a definiti<strong>on</strong>. There are severalversi<strong>on</strong> of these statistics. Here we adopt <strong>on</strong>e that is <strong>on</strong> the same scale as −2 log L. Both of thesefit statistics provide penalties for over fitting the model. In the case of BIC, there is a sample sizepenalty also.AIC = −2 log L + 2df9