------------------------------------------------------------------------------------- name: log: C:\MyDocs\MPH\LectureNotes\ClassDoLogData\logistic regression\5.9.Esopha > gealCa.ClassVersion.log log type: text opened on: 13 Jan 2010, 21:30:21 . * 5.9.EsophagealCa.ClassVersion.log . * . * Calculate age-adjusted odds ratio from the Ille-et-Vilaine study . * of esophageal cancer and alcohol using logistic regression. . * . use 5.5.EsophagealCa.dta, clear . * . * First, define indicator variables for age strata 2 through 6 . * . generate age2 = 0 . replace age2 = 1 if age == 2 (32 real changes made) . generate age3 = 0 . replace age3 = 1 if age == 3 (32 real changes made) . generate age4 = 0 . replace age4 = 1 if age == 4 (32 real changes made) . generate age5 = 0 . replace age5 = 1 if age == 5 (32 real changes made) . generate age6 = 0 . replace age6 = 1 if age == 6 (32 real changes made) . logit cancer age2 age3 age4 age5 age6 heavy [freq=patients] Iteration 0: log likelihood = -494.74421 Iteration 1: log likelihood = -408.77622 Iteration 2: log likelihood = -395.49484 Iteration 3: log likelihood = -394.4999 Iteration 4: log likelihood = -394.46102 Iteration 5: log likelihood = -394.46094 Iteration 6: log likelihood = -394.46094 Logistic regression Number of obs = 975 LR chi2(6) = 200.57 Prob > chi2 = 0.0000 Log likelihood = -394.46094 Pseudo R2 = 0.2027 ------------------------------------------------------------------------------ cancer | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age2 | 1.542294 1.06591 1.45 0.148 -.546852 3.63144 age3 | 3.198762 1.023156 3.13 0.002 1.193413 5.20411 age4 | 3.71349 1.018547 3.65 0.000 1.717175 5.709805 age5 | 3.966882 1.023088 3.88 0.000 1.961666 5.972097 age6 | 3.96219 1.06504 3.72 0.000 1.87475 6.049629 heavy | 1.66989 .1896018 8.81 0.000 1.298277 2.041503 _cons | -5.054348 1.009438 -5.01 0.000 -7.03281 -3.075886 ------------------------------------------------------------------------------ . logistic cancer age2 age3 age4 age5 age6 heavy [freq=patients] Logistic regression Number of obs = 975 LR chi2(6) = 200.57 Prob > chi2 = 0.0000 Log likelihood = -394.46094 Pseudo R2 = 0.2027 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age2 | 4.675303 4.983453 1.45 0.148 .5787689 37.76715 age3 | 24.50217 25.06953 3.13 0.002 3.29832 182.0188 age4 | 40.99664 41.757 3.65 0.000 5.568776 301.8123 age5 | 52.81958 54.03907 3.88 0.000 7.111166 392.3277 age6 | 52.57232 55.99162 3.72 0.000 6.51919 423.9559 heavy | 5.311584 1.007086 8.81 0.000 3.662981 7.702175 ------------------------------------------------------------------------------ . logistic cancer i.age heavy [freq=patients] Logistic regression Number of obs = 975 LR chi2(6) = 200.57 Prob > chi2 = 0.0000 Log likelihood = -394.46094 Pseudo R2 = 0.2027 ------------------------------------------------------------------------------ cancer | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | 2 | 4.675303 4.983453 1.45 0.148 .5787689 37.76715 3 | 24.50217 25.06953 3.13 0.002 3.29832 182.0188 4 | 40.99664 41.757 3.65 0.000 5.568776 301.8123 5 | 52.81958 54.03907 3.88 0.000 7.111166 392.3277 6 | 52.57232 55.99162 3.72 0.000 6.51919 423.9559 | heavy | 5.311584 1.007086 8.81 0.000 3.662981 7.702175 ------------------------------------------------------------------------------ . log close name: log: C:\MyDocs\MPH\LectureNotes\ClassDoLogData\logistic regression\5.9.Esopha > gealCa.ClassVersion.log log type: text closed on: 13 Jan 2010, 21:30:25 -------------------------------------------------------------------------------------