Logistic Regression: A Self-learning Text, Third Edition (Statistics in the Health Sciences)

(vip2019) #1

The model is restated as follows:


logit PðCHD¼ 1 jXÞ¼b 0 þb 1 CATþb 2 AGEþb 3 CHLþb 4 ECGþb 5 SMK
þb 6 HPTþb 7 CHþb 8 CC

The first step is to activate the Evans dataset by clicking on File!Open and selecting
the Stata dataset,evans.dta. The code to run the logistic regression is as follows:


logit chd cat age chl ecg smk hpt ch cc

Following the commandlogitcomes the dependent variable followed by a list of the
independent variables. Clicking on the variable names in the Variable Window pastes
the variable names into the Command Window. Forlogitto run properly in Stata, the
dependent variable must be coded zero for the nonevents (in this case, absence of
coronary heart disease) and nonzero for the event. The output produced in the results
window is as follows:


Iteration 0: log likelihood¼219.27915
Iteration 1: log likelihood¼184.11809
Iteration 2: log likelihood¼174.5489
Iteration 3: log likelihood¼173.64485
Iteration 4: log likelihood¼173.61484
Iteration 5: log likelihood¼173.61476

Logit estimates Number of obs ¼ 609
LR chi2(8) ¼ 91.33
Prob>chi2 ¼ 0.0000
Log likelihood¼173.61476 Pseudo R2 ¼ 0.2082




chd Coef. Std. Err. z P>jzj [95% Conf. Interval]


cat 12.68953 3.10465 4.09 0.000 18.77453 6.604528
age .0349634 .0161385 2.17 0.030 .0033327 .0665942
cht .005455 .0041837 1.30 0.192 .013655 .002745
ecg .3671308 .3278033 1.12 0.263 .275352 1.009614
smk .7732135 .3272669 2.36 0.018 .1317822 1.414645
hpt 1.046649 .331635 3.16 0.002 .3966564 1.696642
ch 2.331785 .7426678 3.14 0.002 3.787387 .8761829
cc .0691698 .0143599 4.82 0.000 .0410249 .0973146
_cons 4.049738 1.255015 3.23 0.001 6.509521 1.589955


The output indicates that it took five iterations for the log likelihood to converge at
173.61476. The iteration history appears at the top of the Stata output for all of the
models illustrated in this appendix. However, we shall omit that portion of the output
in subsequent examples. The table shows the regression coefficient estimates and
standard error, the test statistic (z)andp-value for the Wald test, and 95% confidence
intervals. The intercept, labeled “cons” (for constant), is given in the last row of the






650 Appendix: Computer Programs for Logistic Regression

Free download pdf