-------------------------------------------------------------------------------------------------------- name: log: C:\MyDocs\MPH\LectureNotes\ClassDoLogData\Poisson\9.3.Framingham.log log type: text opened on: 29 Apr 2010, 17:29:23 . * 9.3.Framingham.log . * . * Estimate the effect of age and gender on coronary heart disease (CHD) . * using several Poisson regression models (Levy 1999). . * . use 8.12.Framingham.dta, clear . * . * Fit a multiplicative model of the effect of gender and age on CHD . * . glm chd_cnt i.age_gr male, family(poisson) link(log) /// > lnoffset(pt_yrs) eform Iteration 0: log likelihood = -1627.8408 Iteration 1: log likelihood = -1559.8014 Iteration 2: log likelihood = -1559.2084 Iteration 3: log likelihood = -1559.2065 Iteration 4: log likelihood = -1559.2065 Generalized linear models No. of obs = 1267 Optimization : ML Residual df = 1257 Scale parameter = 1 Deviance = 1391.341888 (1/df) Deviance = 1.106875 Pearson = 1604.542689 (1/df) Pearson = 1.276486 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] AIC = 2.477043 Log likelihood = -1559.206456 BIC = -7589.178 ------------------------------------------------------------------------------ | OIM chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age_gr | 50 | 1.864355 .3337745 3.48 0.001 1.312618 2.648005 55 | 3.158729 .5058088 7.18 0.000 2.307858 4.323303 60 | 4.885053 .7421312 10.44 0.000 3.627069 6.579347 65 | 6.44168 .9620181 12.47 0.000 4.807047 8.632168 70 | 6.725369 1.028591 12.46 0.000 4.983469 9.076127 75 | 8.612712 1.354852 13.69 0.000 6.327596 11.72306 80 | 10.37219 1.749287 13.87 0.000 7.452702 14.43534 81 | 13.67189 2.515296 14.22 0.000 9.532967 19.60781 | male | 1.996012 .1051841 13.12 0.000 1.800144 2.213192 pt_yrs | (exposure) ------------------------------------------------------------------------------ . * . * Tabulate patient-years of follow-up and number of . * CHD events by sex and age group. . * . table sex, contents(sum pt_yrs sum chd_cnt) by(age_gr) -------------------------------------- age_gr | and Sex | sum(pt_yrs) sum(chd_cnt) ----------+--------------------------- <= 45 | Men | 7370 43 Women | 9205 9 ----------+--------------------------- 45-50 | Men | 5835 53 Women | 7595 25 ----------+--------------------------- 50-55 | Men | 6814 110 Women | 9113 46 ----------+--------------------------- 55-60 | Men | 7184 155 Women | 10139 105 ----------+--------------------------- 60-65 | Men | 6678 178 Women | 9946 148 ----------+--------------------------- 65-70 | Men | 4557 121 Women | 7385 120 ----------+--------------------------- 70-75 | Men | 2575 94 Women | 4579 88 ----------+--------------------------- 75-80 | Men | 1205 50 Women | 2428 59 ----------+--------------------------- > 80 | Men | 470 19 Women | 1383 50 -------------------------------------- . * . * Calculate age-sex specific incidence of CHD . * . collapse (sum) patients = pt_yrs chd = chd_cnt, by(age_gr male) . generate rate = 1000*chd/patients . generate men = rate if male == 1 (9 missing values generated) . generate women = rate if male == 0 (9 missing values generated) . graph bar men women, over(age_gr) ytitle(CHD Morbidity Rate per 1000) /// > ylabel(0(5)40, angle(0)) subtitle(Age, position(6)) /// > legend(order(1 "Men" 2 "Women") ring(0) position(11) col(1)) . more . use 8.12.Framingham.dta, clear . * . * Add interaction terms to the model . * . glm chd_cnt age_gr##male, family(poisson) link(log) lnoffset(pt_yrs) Iteration 0: log likelihood = -1621.7301 Iteration 1: log likelihood = -1547.0628 Iteration 2: log likelihood = -1544.3498 Iteration 3: log likelihood = -1544.3226 Iteration 4: log likelihood = -1544.3226 Generalized linear models No. of obs = 1267 Optimization : ML Residual df = 1249 Scale parameter = 1 Deviance = 1361.574107 (1/df) Deviance = 1.090131 Pearson = 1556.644381 (1/df) Pearson = 1.246313 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] AIC = 2.466176 Log likelihood = -1544.322566 BIC = -7561.79 ------------------------------------------------------------------------------ | OIM chd_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age_gr | 50 | 1.213908 .3887301 3.12 0.002 .4520112 1.975805 55 | 1.641462 .3644863 4.50 0.000 .9270817 2.355842 60 | 2.360093 .3473254 6.80 0.000 1.679348 3.040838 65 | 2.722564 .3433189 7.93 0.000 2.049671 3.395457 70 | 2.810563 .3456074 8.13 0.000 2.133185 3.487941 75 | 2.978378 .3499639 8.51 0.000 2.292462 3.664295 80 | 3.212992 .3578551 8.98 0.000 2.511609 3.914375 81 | 3.61029 .3620927 9.97 0.000 2.900602 4.319979 | 1.male | 1.786305 .3665609 4.87 0.000 1.067858 2.504751 | age_gr#male | 50 1 | -.771273 .4395848 -1.75 0.079 -1.632843 .0902975 55 1 | -.623743 .4064443 -1.53 0.125 -1.420359 .1728731 60 1 | -1.052307 .3877401 -2.71 0.007 -1.812263 -.2923503 65 1 | -1.203381 .3830687 -3.14 0.002 -1.954182 -.4525805 70 1 | -1.295219 .3885418 -3.33 0.001 -2.056747 -.5336915 75 1 | -1.144716 .395435 -2.89 0.004 -1.919754 -.3696772 80 1 | -1.251231 .4139035 -3.02 0.003 -2.062467 -.4399949 81 1 | -1.674611 .4549709 -3.68 0.000 -2.566338 -.7828845 | _cons | -6.930278 .3333333 -20.79 0.000 -7.583599 -6.276956 pt_yrs | (exposure) ------------------------------------------------------------------------------ . lincom 1.male, irr ( 1) [chd_cnt]1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 5.96736 2.187401 4.87 0.000 2.909143 12.24051 ------------------------------------------------------------------------------ . lincom 1.male + 50.age_gr#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]50.age_gr#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 2.759451 .6695176 4.18 0.000 1.715134 4.439635 ------------------------------------------------------------------------------ . lincom 1.male + 55.age_gr#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]55.age_gr#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 3.198115 .5615406 6.62 0.000 2.266919 4.511824 ------------------------------------------------------------------------------ . lincom 1.male + 60.age_gr#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]60.age_gr#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 2.083393 .2633282 5.81 0.000 1.626239 2.669057 ------------------------------------------------------------------------------ . lincom 1.male + 65.age_gr#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]65.age_gr#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.791267 .1992637 5.24 0.000 1.44036 2.227663 ------------------------------------------------------------------------------ . lincom 1.male + 70.age_gr#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]70.age_gr#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.634089 .2105236 3.81 0.000 1.269443 2.103478 ------------------------------------------------------------------------------ . lincom 1.male + 75.age_gr#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]75.age_gr#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.899497 .2817533 4.33 0.000 1.420298 2.540374 ------------------------------------------------------------------------------ . lincom 1.male + 80.age_gr#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]80.age_gr#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.707574 .3282327 2.78 0.005 1.171549 2.488851 ------------------------------------------------------------------------------ . lincom 1.male + 81.age_gr#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]81.age_gr#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.11817 .3013496 0.41 0.679 .6593363 1.896308 ------------------------------------------------------------------------------ . display chi2tail(8, 1391.341888 - 1361.574107) .00023231 . * . * Refit model with interaction terms using fewer parameters. . * . generate age_gr2 = recode(age_gr, 45,55,60,80,81) . glm chd_cnt age_gr2##male /// > , family(poisson) link(log) lnoffset(pt_yrs) eform Iteration 0: log likelihood = -1648.0067 Iteration 1: log likelihood = -1566.4477 Iteration 2: log likelihood = -1563.8475 Iteration 3: log likelihood = -1563.8267 Iteration 4: log likelihood = -1563.8267 Generalized linear models No. of obs = 1267 Optimization : ML Residual df = 1257 Scale parameter = 1 Deviance = 1400.582451 (1/df) Deviance = 1.114226 Pearson = 1656.387168 (1/df) Pearson = 1.31773 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] AIC = 2.484336 Log likelihood = -1563.826738 BIC = -7579.937 ------------------------------------------------------------------------------ | OIM chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age_gr2 | 55 | 4.346255 1.537835 4.15 0.000 2.172374 8.695524 60 | 10.59194 3.678849 6.80 0.000 5.362059 20.92278 80 | 17.43992 5.876004 8.48 0.000 9.010534 33.75503 81 | 36.97678 13.38902 9.97 0.000 18.18508 75.18703 | 1.male | 5.96736 2.187401 4.87 0.000 2.909143 12.24051 | age_gr2#male | 55 1 | .5081773 .1998025 -1.72 0.085 .2351496 1.098212 60 1 | .3491314 .1353722 -2.71 0.007 .1632841 .746507 80 1 | .2899566 .1081168 -3.32 0.001 .1396186 .6021748 81 1 | .1873811 .0852529 -3.68 0.000 .0768164 .4570857 pt_yrs | (exposure) ------------------------------------------------------------------------------ . lincom 1.male + 55.age_gr2#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]55.age_gr2#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 3.032477 .4312037 7.80 0.000 2.294884 4.007138 ------------------------------------------------------------------------------ . lincom 1.male + 60.age_gr2#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]60.age_gr2#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 2.083393 .2633282 5.81 0.000 1.626239 2.669057 ------------------------------------------------------------------------------ . lincom 1.male + 80.age_gr2#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]80.age_gr2#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.730275 .1182042 8.03 0.000 1.51344 1.978177 ------------------------------------------------------------------------------ . lincom 1.male + 81.age_gr2#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]81.age_gr2#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.11817 .3013496 0.41 0.679 .6593363 1.896308 ------------------------------------------------------------------------------ . table bmi_gr ---------------------- bmi_gr | Freq. ----------+----------- 22.8 | 312 25.2 | 290 28 | 320 29 | 312 ---------------------- . * . * The i. syntax only works for integer variables. bmi_gr gives the . * quartile boundarys to one decimal place. We multiply this variable . * by 10 in order to be able to use this syntax. Since indicator . * covariates are entered into the model, multiplying by 10 will . * not affect our estimates . * . gen bmi_gr10 = bmi_gr*10 (33 missing values generated) . * . * Adjust analysis for body mass index (BMI) . * . glm chd_cnt age_gr2##male i.bmi_gr10 /// > , family(poisson) link(log) lnoffset(pt_yrs) Iteration 0: log likelihood = -1599.2559 Iteration 1: log likelihood = -1528.2662 Iteration 2: log likelihood = -1526.3848 Iteration 3: log likelihood = -1526.3585 Iteration 4: log likelihood = -1526.3585 Generalized linear models No. of obs = 1234 Optimization : ML Residual df = 1221 Scale parameter = 1 Deviance = 1327.64597 (1/df) Deviance = 1.087343 Pearson = 1569.093606 (1/df) Pearson = 1.285089 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] AIC = 2.494908 Log likelihood = -1526.358498 BIC = -7363.452 ------------------------------------------------------------------------------ | OIM chd_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age_gr2 | 55 | 1.426595 .3538794 4.03 0.000 .7330038 2.120185 60 | 2.293218 .3474423 6.60 0.000 1.612244 2.974192 80 | 2.768015 .3371378 8.21 0.000 2.107237 3.428793 81 | 3.473889 .3625129 9.58 0.000 2.763377 4.184401 | 1.male | 1.665895 .3669203 4.54 0.000 .9467445 2.385046 | age_gr2#male | 55 1 | -.6387422 .3932103 -1.62 0.104 -1.40942 .1319358 60 1 | -.9880222 .3878331 -2.55 0.011 -1.748161 -.2278834 80 1 | -1.147882 .3730498 -3.08 0.002 -1.879046 -.4167177 81 1 | -1.585361 .4584836 -3.46 0.001 -2.483972 -.6867492 | bmi_gr10 | 252 | .231835 .08482 2.73 0.006 .0655909 .3980791 280 | .4071791 .0810946 5.02 0.000 .2482366 .5661216 290 | .6120817 .0803788 7.61 0.000 .4545421 .7696213 | _cons | -7.165097 .3365738 -21.29 0.000 -7.824769 -6.505424 pt_yrs | (exposure) ------------------------------------------------------------------------------ . display chi2tail(3,1400.582451 - 1327.64597) 1.003e-15 . * . * Adjust estimates for BMI and serum cholesterol . * . glm chd_cnt age_gr2##male i.bmi_gr10 i.scl_gr /// > , family(poisson) link(log) lnoffset(pt_yrs) Iteration 0: log likelihood = -1506.494 Iteration 1: log likelihood = -1461.0514 Iteration 2: log likelihood = -1460.2198 Iteration 3: log likelihood = -1460.2162 Iteration 4: log likelihood = -1460.2162 Generalized linear models No. of obs = 1134 Optimization : ML Residual df = 1118 Scale parameter = 1 Deviance = 1207.974985 (1/df) Deviance = 1.080479 Pearson = 1317.922267 (1/df) Pearson = 1.178821 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] AIC = 2.603556 Log likelihood = -1460.216152 BIC = -6655.485 ------------------------------------------------------------------------------ | OIM chd_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age_gr2 | 55 | 1.355072 .3539895 3.83 0.000 .6612658 2.048879 60 | 2.177981 .3477145 6.26 0.000 1.496473 2.859489 80 | 2.606272 .3376428 7.72 0.000 1.944504 3.26804 81 | 3.254865 .3634043 8.96 0.000 2.542605 3.967124 | 1.male | 1.569236 .3671219 4.27 0.000 .8496906 2.288782 | age_gr2#male | 55 1 | -.5924132 .3933748 -1.51 0.132 -1.363414 .1785873 60 1 | -.8886722 .3881045 -2.29 0.022 -1.649343 -.1280013 80 1 | -.9948713 .3734882 -2.66 0.008 -1.726895 -.2628478 81 1 | -1.400993 .4590465 -3.05 0.002 -2.300708 -.5012786 | bmi_gr10 | 252 | .1929941 .0849164 2.27 0.023 .0265609 .3594273 280 | .334175 .0814824 4.10 0.000 .1744724 .4938776 290 | .5230984 .0809496 6.46 0.000 .3644401 .6817566 | scl_gr | 225 | .192923 .0843228 2.29 0.022 .0276532 .3581927 255 | .5262667 .0810581 6.49 0.000 .3673957 .6851377 256 | .6128653 .0814661 7.52 0.000 .4531947 .7725359 | _cons | -7.340659 .3392167 -21.64 0.000 -8.005512 -6.675807 pt_yrs | (exposure) ------------------------------------------------------------------------------ . display chi2tail(3,1327.64597 - 1207.974985) 9.084e-26 . * . * Adjust estimates for BMI, serum cholesterol and . * diastolic blood pressure . * . glm chd_cnt age_gr2##male i.bmi_gr10 i.scl_gr i.dbp_gr /// > , family(poisson) link(log) lnoffset(pt_yrs) eform Iteration 0: log likelihood = -1479.4763 Iteration 1: log likelihood = -1437.4339 Iteration 2: log likelihood = -1436.7761 Iteration 3: log likelihood = -1436.7742 Iteration 4: log likelihood = -1436.7742 Generalized linear models No. of obs = 1134 Optimization : ML Residual df = 1115 Scale parameter = 1 Deviance = 1161.091086 (1/df) Deviance = 1.041337 Pearson = 1228.755896 (1/df) Pearson = 1.102023 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] AIC = 2.567503 Log likelihood = -1436.774203 BIC = -6681.269 ------------------------------------------------------------------------------ | OIM chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age_gr2 | 55 | 3.757544 1.330347 3.74 0.000 1.877322 7.520891 60 | 8.411826 2.926018 6.12 0.000 4.254059 16.63325 80 | 12.78983 4.320508 7.54 0.000 6.596628 24.79748 81 | 23.92787 8.701246 8.73 0.000 11.73192 48.80217 | 1.male | 4.637662 1.703034 4.18 0.000 2.257991 9.525239 | age_gr2#male | 55 1 | .5610101 .2207001 -1.47 0.142 .2594836 1.212918 60 1 | .4230946 .1642325 -2.22 0.027 .1977092 .9054158 80 1 | .3851572 .1438922 -2.55 0.011 .1851974 .8010161 81 1 | .2688892 .1234925 -2.86 0.004 .1093058 .6614603 | bmi_gr10 | 252 | 1.159495 .0991218 1.73 0.083 .9806235 1.370994 280 | 1.298532 .1077862 3.15 0.002 1.103564 1.527944 290 | 1.479603 .1251218 4.63 0.000 1.253614 1.746332 | scl_gr | 225 | 1.189835 .1004557 2.06 0.040 1.008374 1.403952 255 | 1.649807 .1339827 6.16 0.000 1.407039 1.934462 256 | 1.793581 .1466507 7.15 0.000 1.527999 2.105323 | dbp_gr | 80 | 1.18517 .0962869 2.09 0.037 1.010709 1.389744 90 | 1.122983 .0892217 1.46 0.144 .9610473 1.312205 91 | 1.638383 .1302205 6.21 0.000 1.402041 1.914564 pt_yrs | (exposure) ------------------------------------------------------------------------------ . lincom 1.male + 55.age_gr2#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]55.age_gr2#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 2.601775 .3722797 6.68 0.000 1.965505 3.444019 ------------------------------------------------------------------------------ . lincom 1.male + 60.age_gr2#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]60.age_gr2#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.96217 .2491985 5.31 0.000 1.529793 2.516752 ------------------------------------------------------------------------------ . lincom 1.male + 80.age_gr2#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]80.age_gr2#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.786229 .123734 8.37 0.000 1.559457 2.045977 ------------------------------------------------------------------------------ . lincom 1.male + 81.age_gr2#1.male, irr ( 1) [chd_cnt]1.male + [chd_cnt]81.age_gr2#1.male = 0 ------------------------------------------------------------------------------ chd_cnt | IRR Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.247017 .3433152 0.80 0.423 .7269909 2.139026 ------------------------------------------------------------------------------ . display chi2tail(3,1207.974985 - 1161.091086) 3.679e-10 . * . * Compress data set for residual plot . * . sort male bmi_gr10 scl_gr dbp_gr age_gr2 . collapse (sum) pt_yrs=pt_yrs chd_cnt=chd_cnt /// > , by (male bmi_gr10 scl_gr dbp_gr age_gr2) . * . * Re-analyze previous model using collapsed data set. . * . glm chd_cnt age_gr2##male i.bmi_gr10 i.scl_gr i.dbp_gr /// > , family(poisson) link(log) lnoffset(pt_yrs) Iteration 0: log likelihood = -930.67703 Iteration 1: log likelihood = -874.87994 Iteration 2: log likelihood = -872.67922 Iteration 3: log likelihood = -872.64595 Iteration 4: log likelihood = -872.64595 Generalized linear models No. of obs = 623 Optimization : ML Residual df = 604 Scale parameter = 1 Deviance = 600.7760472 (1/df) Deviance = .9946623 Pearson = 633.8816072 (1/df) Pearson = 1.049473 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] AIC = 2.862427 Log likelihood = -872.645946 BIC = -3285.69 ------------------------------------------------------------------------------ | OIM chd_cnt | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age_gr2 | 55 | 1.323765 .3540467 3.74 0.000 .6298461 2.017684 60 | 2.129638 .3478456 6.12 0.000 1.447873 2.811403 80 | 2.54865 .337808 7.54 0.000 1.886558 3.210741 81 | 3.175043 .3636446 8.73 0.000 2.462313 3.887774 | 1.male | 1.53421 .3672182 4.18 0.000 .8144752 2.253944 | age_gr2#male | 55 1 | -.5780157 .3933976 -1.47 0.142 -1.349061 .1930294 60 1 | -.8601589 .3881695 -2.22 0.027 -1.620957 -.0993605 80 1 | -.954103 .3735932 -2.55 0.011 -1.686332 -.2218737 81 1 | -1.313455 .4592688 -2.86 0.004 -2.213605 -.4133048 | bmi_gr10 | 252 | .1479847 .085487 1.73 0.083 -.0195667 .3155362 280 | .261234 .0830063 3.15 0.002 .0985448 .4239233 290 | .3917741 .0845644 4.63 0.000 .2260309 .5575174 | scl_gr | 225 | .1738151 .0844282 2.06 0.040 .0083387 .3392914 255 | .5006586 .0812111 6.16 0.000 .3414877 .6598295 256 | .584214 .0817642 7.15 0.000 .4239591 .7444689 | dbp_gr | 80 | .1698858 .0812431 2.09 0.037 .0106522 .3291194 90 | .1159887 .0794506 1.46 0.144 -.0397316 .2717091 91 | .4937095 .0794811 6.21 0.000 .3379293 .6494897 | _cons | -7.398838 .3407832 -21.71 0.000 -8.066761 -6.730916 pt_yrs | (exposure) ------------------------------------------------------------------------------ . * . * Estimate the expected number of CHD events and the . * standardized deviance residual for each record in the data set. . * . predict e_chd, mu (82 missing values generated) . predict dev, standardized deviance (82 missing values generated) . generate e_rate = 1000*e_chd/pt_yrs (82 missing values generated) . label variable e_rate "Incidence of CHD per Thousand" . * . * Draw scatterplot of the standardized deviance residual versus the . * estimated incidence of CHD. Include lowess regression curve on this plot. . * . lowess dev e_rate, bwidth(0.2) msymbol(Oh) ylabel(-3(1)4) ytick(-3(0.5)4) /// > lineopts(color(red) lwidth(medthick)) yline(-2 0 2, lcolor(blue)) /// > xlabel(0(10)80) xtick(5(10)75) . log close name: log: C:\MyDocs\MPH\LectureNotes\ClassDoLogData\Poisson\9.3.Framingham.log log type: text closed on: 29 Apr 2010, 17:29:38 --------------------------------------------------------------------------------------------------------