* Negative binomial Chapter drop _all input LOS count time 0 5.500 . 13 5.500 7.875 13 5.625 8.000 13 5.750 10.000 13 5.875 9.125 13 6.000 7.775 13 6.125 6.500 13 6.250 6.125 13 6.375 5.875 13 6.500 . 0 6.500 . 11 6.500 5.875 11 6.625 6.000 11 6.750 8.000 11 6.875 7.125 11 7.000 5.775 11 7.125 4.500 11 7.250 4.125 11 7.375 3.875 11 7.500 . 0 7.500 . 8 7.500 2.875 8 7.625 3.000 8 7.750 5.000 8 7.875 4.125 8 8.000 2.775 8 8.125 1.500 8 8.250 1.125 8 8.375 0.875 8 8.500 . 0 8.500 . end capture program drop doit program define doit version 6.0 graph LOS time count, c(l.) s(.o) xlab(5,6,7,8,9) ylab(0,1,2,3,4,5,6,7,8,9,10,11,12,13) /* */ l2("Count") b2("LOS") t2("Discharges follow Gamma distribution") saving(negbin, replace) end doit graph export negbin.eps, replace use medpar, clear nbreg los hmo white type2 type3, irr nolog glm los hmo white type2 type3, family(nb .4457567) eform nolog negbin los hmo white type2 type3, eform use doll, clear glm deaths smokes a2-a5, family(nb 0.000001) lnoffset(pyears) eform nolog drop _all input LOS count 1 50 2 40 3 30 4 20 5 15 6 12 7 10 8 7 9 6 10 6 11 5 12 5 13 4 14 3 15 2 16 0 end capture program drop doit program define doit version 6.0 graph count LOS, xlab(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) ylab(0,2,4,6,8,10,20,30,40,50) /* */ c(.) s(o) saving(geomlos, replace) end doit graph export geomlos.eps, replace use medpar, clear glm los white type2 type3, family(nb 1) link(nb) eform nolog glm los white type2 type3, family(nb 1) link(nb) irls scale(dev) eform nolog noheader glm los white type2 type3, family(nb 1) link(nb) cluster(provnum) eform nolog noheader