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

(vip2019) #1

to perform the statistical analyses in this appendix are listed below. These commands
are case sensitive and lower case letters should be used. In the text, commands are
given in bold font for readability.



  1. logit– This command is used to run logistic regression.

  2. binreg– This command can also be used to run logistic regression. The
    binregcommand can also accommodate summarized binomial data in which
    each observation contains a count of the number of events and trials for a
    particular pattern of covariates.

  3. clogit– This command is used to run conditional logistic regression.

  4. mlogit– This command is used to run polytomous logistic regression.

  5. ologit– This command is used to run ordinal logistic regression.

  6. xtset– This command is used to define the cluster variable(s) for subsequent
    analyses of correlated data using Stata commands beginning withxt.

  7. xtgee– This command is used to run GEE models.

  8. xtiogit– This command can be used to run GEE logistic regression models.

  9. xtmelogit– This command is used to run logistic mixed models.

  10. lrtest– This command is used to perform likelihood ratio tests.

  11. lincom– This command is used to calculate a linear combination of
    parameter estimates following a regression command.


Four windows will appear when Stata is opened. These windows are labeled Stata
Command, Stata Results, Review, and Variables. As with SPSS, the user can click
on File! Open to select a working dataset for analysis. Once a dataset is
selected, the names of its variables appear in the Variables window. Commands
are entered in the Stata Command window. The output generated by commands
appears in the Results window after the enter key is pressed. The Review window
preserves a history of all the commands executed during the Stata session. The
commands in the Review window can be saved, copied, or edited as the user
desires. Commands can also be run from the Review window by double-clicking
on the command.


Alternatively, commands can be typed, or pasted into the Do-file Editor. The Do-file
Editor window is activated by clicking on Window!Do-file Editor or by simply
clicking on the Do-file Editor button on the Stata tool bar. Commands are executed
from the Do-file Editor by clicking on Tools!Do. The advantage of running com-
mands from the Do-file Editor is that commands need not be entered and executed
one at a time as they do from the Stata Command window. The Do-file Editor serves a
similar function as the Program Editor in SAS.


Unconditional Logistic Regression


Unconditional logistic regression is illustrated using the Evans County data. As
discussed in the previous sections, the dichotomous outcome variable is CHD and
the covariates are CAT, AGE, CHL, ECG, SMK, and HPT. Two interaction terms
CH and CC, are also included. CH is the product CATHPT, while CC is the product
CATCHL. The variables representing the interaction terms have already been
included in the Stata datasetevans.dta.


STATA 649

Free download pdf