------------------------------------------------------------------------------- log: C:\WDDtext\log\5.20.EsophagealCa.log log type: text opened on: 10 Jan 2002, 17:52:21 . set more on . * 5.20.EsophagealCa.log . * . * Regress esophageal cancers against age and dose of alcohol . * and tobacco using a multiplicative model. . * . use C:\WDDtext\5.5.EsophagealCa.dta, clear . * . * Combine tobacco levels 2 and 3 in a new variable called smoke . * . generate smoke = tobacco . recode smoke 3=2 4=3 (96 changes made) . label variable smoke "Smoking (gm/day)" . label define smoke 1 "0-9" 2 "10-29" 3 ">= 30" . label values smoke smoke . table smoke tobacco [freq=patients], row col --------------------------------------------- Smoking | Tobacco (gm/day) (gm/day) | 0-9 10-19 20-29 >= 30 Total ----------+---------------------------------- 0-9 | 525 525 10-29 | 236 132 368 >= 30 | 82 82 | Total | 525 236 132 82 975 --------------------------------------------- . * . * Regress cancer against age, alcohol and smoke . * using a multiplicative model . * . xi: logistic cancer i.age i.alcohol i.smoke [freq=patients] i.age _Iage_1-6 (naturally coded; _Iage_1 omitted) i.alcohol _Ialcohol_1-4 (naturally coded; _Ialcohol_1 omitted) i.smoke _Ismoke_1-3 (naturally coded; _Ismoke_1 omitted) Logit estimates Number of obs = 975 LR chi2(10) = 285.55 Prob > chi2 = 0.0000 Log likelihood = -351.96823 Pseudo R2 = 0.2886 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _Iage_2 | 7.262526 8.017364 1.80 0.072 .8344795 63.2062 _Iage_3 | 43.65627 46.6239 3.54 0.000 5.382485 354.0873 _Iage_4 | 76.3655 81.32909 4.07 0.000 9.470422 615.7792 _Iage_5 | 133.7632 143.9718 4.55 0.000 16.22455 1102.81 _Iage_6 | 124.4262 139.5027 4.30 0.000 13.82203 1120.088 _Ialcohol_2 | 4.213304 1.05191 5.76 0.000 2.582905 6.872853 _Ialcohol_3 | 7.222005 2.053956 6.95 0.000 4.135937 12.61077 _Ialcohol_4 | 36.7912 14.1701 9.36 0.000 17.29435 78.26787 _Ismoke_2 | 1.592701 .3200883 2.32 0.021 1.074154 2.361576 _Ismoke_3 | 5.159309 1.775205 4.77 0.000 2.628523 10.12678 ------------------------------------------------------------------------------ . lincom _Ialcohol_2 + _Ismoke_2, or ( 1) _Ialcohol_2 + _Ismoke_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 6.710535 2.110331 6.05 0.000 3.623022 12.4292 ------------------------------------------------------------------------------ . lincom _Ialcohol_3 + _Ismoke_2, or ( 1) _Ialcohol_3 + _Ismoke_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 11.5025 3.877641 7.25 0.000 5.940747 22.27118 ------------------------------------------------------------------------------ . lincom _Ialcohol_4 + _Ismoke_2, or ( 1) _Ialcohol_4 + _Ismoke_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 58.59739 25.19568 9.47 0.000 25.22777 136.1061 ------------------------------------------------------------------------------ . lincom _Ialcohol_2 + _Ismoke_3, or ( 1) _Ialcohol_2 + _Ismoke_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 21.73774 9.508636 7.04 0.000 9.223106 51.23319 ------------------------------------------------------------------------------ . lincom _Ialcohol_3 + _Ismoke_3, or ( 1) _Ialcohol_3 + _Ismoke_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 37.26056 17.06685 7.90 0.000 15.18324 91.43957 ------------------------------------------------------------------------------ . lincom _Ialcohol_4 + _Ismoke_3, or ( 1) _Ialcohol_4 + _Ismoke_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 189.8171 100.9788 9.86 0.000 66.91353 538.4643 ------------------------------------------------------------------------------ . * . * Regress cancer against age, alcohol and smoke. . * Include alcohol-smoke interaction terms. . * . xi: logistic cancer i.age i.alcohol*i.smoke [freq=patients] i.age _Iage_1-6 (naturally coded; _Iage_1 omitted) i.alcohol _Ialcohol_1-4 (naturally coded; _Ialcohol_1 omitted) i.smoke _Ismoke_1-3 (naturally coded; _Ismoke_1 omitted) i.alc~l*i.smoke _IalcXsmo_#_# (coded as above) Logit estimates Number of obs = 975 LR chi2(16) = 290.90 Prob > chi2 = 0.0000 Log likelihood = -349.29335 Pseudo R2 = 0.2940 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _Iage_2 | 6.697614 7.410168 1.72 0.086 .7658787 58.57068 _Iage_3 | 40.1626 42.67237 3.48 0.001 5.00528 322.2665 _Iage_4 | 69.55115 73.73317 4.00 0.000 8.708053 555.5044 _Iage_5 | 123.0645 131.6687 4.50 0.000 15.11535 1001.953 _Iage_6 | 118.8368 133.2476 4.26 0.000 13.19858 1069.977 _Ialcohol_2 | 7.554406 3.043768 5.02 0.000 3.429574 16.64027 _Ialcohol_3 | 12.71358 5.825001 5.55 0.000 5.179307 31.20787 _Ialcohol_4 | 65.07188 39.54144 6.87 0.000 19.77671 214.1079 _Ismoke_2 | 3.800862 1.703912 2.98 0.003 1.578671 9.151083 _Ismoke_3 | 8.651205 5.569299 3.35 0.001 2.449668 30.55245 _IalcXsm~2_2 | .3251915 .1746668 -2.09 0.036 .1134859 .9318291 _IalcXsm~2_3 | .5033299 .4154535 -0.83 0.406 .0998303 2.537716 _IalcXsm~3_2 | .3341452 .2008274 -1.82 0.068 .1028839 1.085233 _IalcXsm~3_3 | .657279 .6598906 -0.42 0.676 .0918684 4.70255 _IalcXsm~4_2 | .3731549 .3018038 -1.22 0.223 .0764621 1.821093 _IalcXsm~4_3 | .3489097 .4210271 -0.87 0.383 .0327773 3.714089 ------------------------------------------------------------------------------ . lincom _Ialcohol_2 + _Ismoke_2 + _IalcXsmo_2_2, or ( 1) _Ialcohol_2 + _Ismoke_2 + _IalcXsmo_2_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 9.337306 3.826162 5.45 0.000 4.182379 20.84586 ------------------------------------------------------------------------------ . lincom _Ialcohol_2 + _Ismoke_3 + _IalcXsmo_2_3, or ( 1) _Ialcohol_2 + _Ismoke_3 + _IalcXsmo_2_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 32.89498 19.73769 5.82 0.000 10.14824 106.6274 ------------------------------------------------------------------------------ . lincom _Ialcohol_3 + _Ismoke_2 + _IalcXsmo_3_2, or ( 1) _Ialcohol_3 + _Ismoke_2 + _IalcXsmo_3_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 16.14675 7.152595 6.28 0.000 6.776802 38.47207 ------------------------------------------------------------------------------ . lincom _Ialcohol_3 + _Ismoke_3 + _IalcXsmo_3_3, or ( 1) _Ialcohol_3 + _Ismoke_3 + _IalcXsmo_3_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 72.29267 57.80896 5.35 0.000 15.08098 346.5446 ------------------------------------------------------------------------------ . lincom _Ialcohol_4 + _Ismoke_2 + _IalcXsmo_4_2, or ( 1) _Ialcohol_4 + _Ismoke_2 + _IalcXsmo_4_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 92.29212 53.97508 7.74 0.000 29.33307 290.3833 ------------------------------------------------------------------------------ . lincom _Ialcohol_4 + _Ismoke_3 + _IalcXsmo_4_3, or ( 1) _Ialcohol_4 + _Ismoke_3 + _IalcXsmo_4_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 196.4188 189.1684 5.48 0.000 29.74417 1297.072 ------------------------------------------------------------------------------ . * . * Perform Pearson chi-squared and Hosmer-Lemeshow tests of . * goodness of fit. . * . lfit Logistic model for cancer, goodness-of-fit test number of observations = 975 number of covariate patterns = 68 Pearson chi2(51) = 55.85 Prob > chi2 = 0.2977 . lfit, group(10) table Logistic model for cancer, goodness-of-fit test (Table collapsed on quantiles of estimated probabilities) _Group _Prob _Obs_1 _Exp_1 _Obs_0 _Exp_0 _Total 1 0.0046 0 0.3 116 115.7 116 2 0.0273 2 2.0 118 118.0 120 3 0.0418 4 3.1 76 76.9 80 4 0.0765 4 5.1 87 85.9 91 5 0.1332 5 7.8 81 78.2 86 6 0.2073 21 20.2 91 91.8 112 7 0.2682 22 22.5 65 64.5 87 8 0.3833 32 28.5 56 59.5 88 9 0.5131 46 41.6 52 56.4 98 10 0.9440 64 68.9 33 28.1 97 number of observations = 975 number of groups = 10 Hosmer-Lemeshow chi2(8) = 4.73 Prob > chi2 = 0.7862 . * . * Perform residual analysis . * . predict p, p . predict dx2, dx2 (57 missing values generated) . predict rstandard, rstandard (57 missing values generated) . generate dx2_pos = dx2 if rstandard >= 0 (137 missing values generated) . generate dx2_neg = dx2 if rstandard < 0 (112 missing values generated) . predict dbeta, dbeta (57 missing values generated) . generate bubble= 1.5*dbeta (57 missing values generated) . graph dx2_pos dx2_neg p [weight=bubble], symbol(OO) xlabel(0 .1 to 1.0) xtick(0.05 0.1 to 0.95) ylabe > l(0 1 to 8) ytick(.5 1 to 7.5) yline(3.84) . more . save temporary, replace file temporary.dta saved . drop if patients == 0 (57 observations deleted) . generate ca_no = cancer*patients . collapse (sum) n = patients ca = ca_no, by(age alcohol smoke dbeta dx2 p) . * . * Identify covariate patterns associated with large squared residuals . * . list n ca age alcohol smoke dbeta dx2 p if dx2 > 3.84, nodisplay n ca age alcohol smoke dbeta dx > 2 p 11. 2 1 25-34 >= 120 10-29 1.335425 7.94231 > 2 .060482 17. 37 4 35-44 40-79 10-29 1.890465 5.46678 > 9 .041798 22. 3 2 35-44 >= 120 0-9 .9170162 3.89630 > 9 .2331274 25. 28 0 45-54 0-39 10-29 1.564479 4.11490 > 6 .0962316 38. 6 4 55-64 0-39 >= 30 4.159096 6.50371 > 3 .2956251 45. 10 5 55-64 >= 120 0-9 6.159449 6.94936 > 1 .7594333 . * . * Rerun analysis without the covariate pattern A . * . use temporary, clear . drop if age == 4 & alcohol ==4 & smoke == 1 (2 observations deleted) . xi: logistic cancer i.age i.alcohol*i.smoke [freq=patients] i.age _Iage_1-6 (naturally coded; _Iage_1 omitted) i.alcohol _Ialcohol_1-4 (naturally coded; _Ialcohol_1 omitted) i.smoke _Ismoke_1-3 (naturally coded; _Ismoke_1 omitted) i.alc~l*i.smoke _IalcXsmo_#_# (coded as above) Logit estimates Number of obs = 965 LR chi2(16) = 293.36 Prob > chi2 = 0.0000 Log likelihood = -338.96967 Pseudo R2 = 0.3020 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _Iage_2 | 6.634059 7.385568 1.70 0.089 .7484337 58.8038 _Iage_3 | 44.03354 47.13765 3.54 0.000 5.40228 358.9137 _Iage_4 | 84.68781 90.5976 4.15 0.000 10.40447 689.3218 _Iage_5 | 138.0188 148.8515 4.57 0.000 16.66971 1142.742 _Iage_6 | 130.5084 147.6489 4.31 0.000 14.21162 1198.488 _Ialcohol_2 | 7.525681 3.032792 5.01 0.000 3.416001 16.57958 _Ialcohol_3 | 12.62548 5.790079 5.53 0.000 5.139068 31.01781 _Ialcohol_4 | 273.8578 248.0885 6.20 0.000 46.38949 1616.705 _Ismoke_2 | 3.76567 1.6883 2.96 0.003 1.563921 9.067132 _Ismoke_3 | 8.65512 5.583627 3.35 0.001 2.444232 30.64811 _IalcXsm~2_2 | .3281026 .1763785 -2.07 0.038 .1144006 .9410034 _IalcXsm~2_3 | .5171836 .4296494 -0.79 0.427 .1015104 2.63499 _IalcXsm~3_2 | .3367698 .2026913 -1.81 0.071 .1035193 1.095582 _IalcXsm~3_3 | .6681017 .6755018 -0.40 0.690 .0920901 4.846991 _IalcXsm~4_2 | .0925466 .0959828 -2.29 0.022 .0121214 .7065891 _IalcXsm~4_3 | .0834134 .1153724 -1.80 0.073 .005545 1.254777 ------------------------------------------------------------------------------ . lincom _Ialcohol_2 + _Ismoke_2 + _IalcXsmo_2_2, or ( 1) _Ialcohol_2 + _Ismoke_2 + _IalcXsmo_2_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 9.298176 3.811849 5.44 0.000 4.163342 20.76603 ------------------------------------------------------------------------------ . lincom _Ialcohol_2 + _Ismoke_3 + _IalcXsmo_2_3, or ( 1) _Ialcohol_2 + _Ismoke_3 + _IalcXsmo_2_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 33.6871 20.40138 5.81 0.000 10.27932 110.3985 ------------------------------------------------------------------------------ . lincom _Ialcohol_3 + _Ismoke_2 + _IalcXsmo_3_2, or ( 1) _Ialcohol_3 + _Ismoke_2 + _IalcXsmo_3_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 16.01118 7.097924 6.26 0.000 6.715472 38.1742 ------------------------------------------------------------------------------ . lincom _Ialcohol_3 + _Ismoke_3 + _IalcXsmo_3_3, or ( 1) _Ialcohol_3 + _Ismoke_3 + _IalcXsmo_3_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 73.00683 58.92606 5.32 0.000 15.00833 355.1358 ------------------------------------------------------------------------------ . lincom _Ialcohol_4 + _Ismoke_2 + _IalcXsmo_4_2, or ( 1) _Ialcohol_4 + _Ismoke_2 + _IalcXsmo_4_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 95.43948 56.55247 7.69 0.000 29.87792 304.8638 ------------------------------------------------------------------------------ . lincom _Ialcohol_4 + _Ismoke_3 + _IalcXsmo_4_3, or ( 1) _Ialcohol_4 + _Ismoke_3 + _IalcXsmo_4_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 197.7124 192.6564 5.43 0.000 29.28192 1334.96 ------------------------------------------------------------------------------ . * . * Rerun analysis without the covariate pattern B . * . use temporary, clear . drop if age == 4 & alcohol ==1 & smoke == 3 (2 observations deleted) . xi: logistic cancer i.age i.alcohol*i.smoke [freq=patients] i.age _Iage_1-6 (naturally coded; _Iage_1 omitted) i.alcohol _Ialcohol_1-4 (naturally coded; _Ialcohol_1 omitted) i.smoke _Ismoke_1-3 (naturally coded; _Ismoke_1 omitted) i.alc~l*i.smoke _IalcXsmo_#_# (coded as above) Logit estimates Number of obs = 969 LR chi2(16) = 291.50 Prob > chi2 = 0.0000 Log likelihood = -342.17265 Pseudo R2 = 0.2987 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _Iage_2 | 6.757334 7.494156 1.72 0.085 .768703 59.40079 _Iage_3 | 40.05664 42.66455 3.46 0.001 4.966552 323.0681 _Iage_4 | 64.05842 68.08996 3.91 0.000 7.976345 514.4563 _Iage_5 | 122.9679 131.8986 4.49 0.000 15.02346 1006.499 _Iage_6 | 132.9431 149.7775 4.34 0.000 14.61093 1209.634 _Ialcohol_2 | 7.695185 3.109016 5.05 0.000 3.485907 16.98722 _Ialcohol_3 | 13.04068 5.992019 5.59 0.000 5.298882 32.09342 _Ialcohol_4 | 66.83578 40.63582 6.91 0.000 20.29938 220.057 _Ismoke_2 | 3.864114 1.735157 3.01 0.003 1.602592 9.317017 _Ismoke_3 | 1.875407 2.107209 0.56 0.576 .2073406 16.96315 _IalcXsm~2_2 | .3203897 .172348 -2.12 0.034 .1116323 .919533 _IalcXsm~2_3 | 2.32032 2.872578 0.68 0.497 .2049994 26.26293 _IalcXsm~3_2 | .329099 .1979799 -1.85 0.065 .1012184 1.070025 _IalcXsm~3_3 | 3.035175 4.134581 0.82 0.415 .2102124 43.82369 _IalcXsm~4_2 | .3639918 .2937922 -1.25 0.211 .0748261 1.770639 _IalcXsm~4_3 | 1.616647 2.451728 0.32 0.751 .0827417 31.58683 ------------------------------------------------------------------------------ . lincom _Ialcohol_2 + _Ismoke_2 + _IalcXsmo_2_2, or ( 1) _Ialcohol_2 + _Ismoke_2 + _IalcXsmo_2_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 9.526812 3.914527 5.49 0.000 4.25787 21.31586 ------------------------------------------------------------------------------ . lincom _Ialcohol_2 + _Ismoke_3 + _IalcXsmo_2_3, or ( 1) _Ialcohol_2 + _Ismoke_3 + _IalcXsmo_2_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 33.48594 20.08865 5.85 0.000 10.33274 108.5199 ------------------------------------------------------------------------------ . lincom _Ialcohol_3 + _Ismoke_2 + _IalcXsmo_3_2, or ( 1) _Ialcohol_3 + _Ismoke_2 + _IalcXsmo_3_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 16.58352 7.369457 6.32 0.000 6.940903 39.62209 ------------------------------------------------------------------------------ . lincom _Ialcohol_3 + _Ismoke_3 + _IalcXsmo_3_3, or ( 1) _Ialcohol_3 + _Ismoke_3 + _IalcXsmo_3_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 74.22997 59.24187 5.40 0.000 15.53272 354.7406 ------------------------------------------------------------------------------ . lincom _Ialcohol_4 + _Ismoke_2 + _IalcXsmo_4_2, or ( 1) _Ialcohol_4 + _Ismoke_2 + _IalcXsmo_4_2 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 94.0049 54.92414 7.78 0.000 29.91024 295.448 ------------------------------------------------------------------------------ . lincom _Ialcohol_4 + _Ismoke_3 + _IalcXsmo_4_3, or ( 1) _Ialcohol_4 + _Ismoke_3 + _IalcXsmo_4_3 = 0.0 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 202.6374 194.6184 5.53 0.000 30.84628 1331.179 ------------------------------------------------------------------------------ . log close log: C:\WDDtext\log\5.20.EsophagealCa.log log type: text closed on: 10 Jan 2002, 17:58:08 -------------------------------------------------------------------------------