12.07.2015 Views

Notes on Poisson Regression and Some Extensions

Notes on Poisson Regression and Some Extensions

Notes on Poisson Regression and Some Extensions

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Pr(Y=y)0 .1 .2 .30 2 4 6 8yFigure 1: Comparis<strong>on</strong> of Poiss<strong>on</strong> Model µ = 2 <strong>and</strong> Observed Data. poiss<strong>on</strong> childs c<strong>on</strong>s, noc<strong>on</strong>sPoiss<strong>on</strong> regressi<strong>on</strong> Number of obs = 1501Wald chi2(1) = 1277.14Log likelihood = -2764.5247 Prob > chi2 = 0.0000------------------------------------------------------------------------------childs | Coef. Std. Err. z P>|z| [95% C<strong>on</strong>f. Interval]-------------+----------------------------------------------------------------c<strong>on</strong>s | .6623651 .0185344 35.74 0.000 .6260383 .6986919------------------------------------------------------------------------------. poiss<strong>on</strong>, irrchilds | IRR Std. Err. z P>|z| [95% C<strong>on</strong>f. Interval]-------------+----------------------------------------------------------------c<strong>on</strong>s | 1.939374 .0359452 35.74 0.000 1.870187 2.01112------------------------------------------------------------------------------We find that the average number of kids is roughly 2. Suppose we take this rate as the theoreticalmean rate in the populati<strong>on</strong>. We can generate a Poiss<strong>on</strong> distributi<strong>on</strong> under this assumpti<strong>on</strong> <strong>and</strong>compare to the observed distributi<strong>on</strong> as shown in Figure 1. Below are the Stata comm<strong>and</strong>s to dothis.gen y = childsmatrix bpois = e(b)gen lampois = exp(bpois[1,1])scalar lampois = 2* generate the predicted distributi<strong>on</strong> for this value of lambda* <strong>and</strong> plot against empirical distributi<strong>on</strong>gen PrY_pois = exp(-lampois)*lampois^y/exp(lngamma(y+1))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))A listing of the distributi<strong>on</strong> might also useful for comparis<strong>on</strong> to the theoretical distributi<strong>on</strong>µ = 2.4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!