Stata
Products Purchase Support Company
Search
   >> Home >> Products >> Capabilities >> Binary variables >> Logistic regression

Logistic regression

Stata supports all aspects of logistic regression through the following commands:

asmprobit Alternative-specific multinomial probit regression   ologit Ordered logistic regression
binreg GLM models for the binomial family oprobit Ordered probit regression
biprobit Bivariate probit regression probit Probit regression
blogit Logit regression for grouped data rologit Rank-ordered logistic regression
bprobit Probit regression for grouped data scobit Skewed-logistic regression
clogit Conditional (fixed-effects) logistic regression slogit Stereotype logistic regression
cloglog Complementary log-log regression svy: heckprob Survey version of heckprob
glm Generalized linear models svy: logistic Survey version of logistic
glogit Weighted least-squares logistic regression for grouped data svy: logit Survey version of logit
gprobit Weighted least-squares probit regression for grouped data svy: mlogit Survey version of mlogit
heckprob Probit model with selection svy: ologit Survey version of ologit
hetprob Heteroskedastic probit model svy: oprobit Survey version of oprobit
ivprobit Probit model with endogenous regressors svy: probit Survey version of probit
logit Logistic regression, reporting coefficients xtcloglog Random-effects and population-averaged cloglog models
mlogit Multinomial (polytomous) logistic regression xtgee GEE population-averaged generalized linear models
mprobit Multinomial probit regression xtlogit Fixed-effects, random-effects, and population-averaged logit models
nlogit Nested logit regression xtprobit Random-effects and population-averaged probit models


Stata’s logistic command fits maximum-likelihood dichotomous logistic models:

    . webuse lbw2
    (Hosmer & Lemeshow data)

    . logistic low age lwt race2 race3 smoke ptl ht ui

    Logistic regression                               Number of obs   =        189
	                                              LR chi2(8)      =      33.22
	                                              Prob > chi2     =     0.0001
    Log likelihood =   -100.724                       Pseudo R2       =     0.1416

    ------------------------------------------------------------------------------
	     low | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
	     age |   .9732636   .0354759    -0.74   0.457     .9061578    1.045339
	     lwt |   .9849634   .0068217    -2.19   0.029     .9716834    .9984249
	   race2 |   3.534767   1.860737     2.40   0.016     1.259736    9.918406
	   race3 |   2.368079   1.039949     1.96   0.050     1.001356    5.600207
	   smoke |   2.517698    1.00916     2.30   0.021     1.147676    5.523162
	     ptl |   1.719161   .5952579     1.56   0.118     .8721455    3.388787
	      ht |   6.249602   4.322408     2.65   0.008     1.611152    24.24199
	      ui |     2.1351   .9808153     1.65   0.099     .8677528      5.2534
    ------------------------------------------------------------------------------

The syntax of all estimation commands is the same: the name of the dependent variable is followed by the names of the independent variables. In this case, the dependent variable low (containing 1 if a newborn had a birthweight of less than 2500 grams and 0 otherwise) was modeled as a function of a number of explanatory variables. By default, logistic reports odds ratios; the logit command alternative will report coefficients if you prefer.

Once a model has been fitted, you can use Stata's predict command to obtain the predicted probabilities of a positive outcome, the value of the logit index, or the standard error of the logit index. You can also obtain Pearson residuals, standardized Pearson residuals, leverage (the diagonal elements of the hat matrix), Delta chi-square, Delta D, and Pregibon's Delta beta influence measures by typing a single command. All statistics are adjusted for the number of covariate patterns in the data—m-asymptotic rather than n-asymptotic in Hosmer and Lemeshow (1989) jargon. Every diagnostic graph suggested by Hosmer and Lemeshow can be drawn by typing one or two commands:

Figure 1 Figure 2

Also available are the goodness-of-fit test, using either cells defined by the covariate patterns or grouping, as suggested by Hosmer and Lemeshow; classification statistics and the classification table; and a graph and area under the ROC curve.

Stata’s mlogit command performs maximum likelihood estimation of models with discrete dependent variables. It is intended for use when the dependent variable takes on more than two outcomes and the outcomes have no natural ordering. Uniquely, linear constraints on the coefficients can be specified both within and across equations using algebraic syntax. Much thought has gone into making mlogit truly usable. For instance, there are no artificial constraints placed on the nature of the dependent variable. The dependent variable is not required to take on integral, contiguous values such as 1, 2, and 3, although such a coding would be acceptable. Equally acceptable would be 1, 3, and 4, or even 1.2, 3.7, and 4.8. Models may be fitted with up to 19 outcome categories with Small Stata and up to 50 outcome categories with Stata/IC or Stata/SE.

Stata’s clogit command performs maximum likelihood estimation with a dichotomous dependent variable; conditional logistic analysis differs from regular logistic regression in that the data are stratified and the likelihoods are computed relative to each stratum. The form of the likelihood function is similar but not identical to that of multinomial logistic regression. Conditional logistic analysis is known in epidemiology circles as the matched case–control model and in econometrics as McFadden's choice model. The form of the data, as well as the nature of the sampling, differs across the two settings, but clogit handles both. clogit allows both 1:1 and 1:k matching, and there may even be more than one positive outcome per strata (which is handled using the exact solution).

Stata’s ologit command performs maximum likelihood estimation to fit models with an ordinal dependent variable, meaning a variable that is categorical and in which the categories can be ordered from low to high, such as “poor”, “good”, and “excellent”. Unlike mlogit, ologit can exploit the ordering in the estimation process. (Stata also provides an oprobit command for fitting ordered probit models.) As with mlogit the categorical dependent variable may take on any values whatsoever, and models may be fitted with up to 50 outcome categories.

See Greene (2003, chapter 21) for a straightforward description of the models fitted by clogit, mlogit, ologit, and oprobit.

See New in Stata 10 for more about what was added in Stata Release 10.


References

Breslow, N. E. 1974.
Covariance analysis of censored survival data. Biometrics 30: 89–99.
Greene, W. H. 2003.
Econometric Analysis. 5th ed. Upper Saddle River, NJ: Prentice Hall.
Hosmer, D. W. Jr. and S. Lemeshow. 2000.
Applied Logistic Regression. 2d ed. New York: Wiley.
McFadden, D. 1974.
Conditional logit analysis of qualitative choice behavior. In Frontiers in Econometrics, ed. P. Zarembka, 105–142. New York: Academic Press.
Stata 10
Overview: Why use Stata?
Stata/MP
64-bit Stata
Capabilities
Overview
Statistics
Basic statistics
Linear models
Multilevel mixed-effects models
Limited dependent variables
Logistic regression
Poisson regression
Panel data
GLM
Nonparametric
Exact statistics
ANOVA / MANOVA
Multivariate methods
Cluster analysis
Bootstrapping
Model testing
Survey methods
Survival analysis
Epidemiology tools
Time series
Maximum likelihood
Normality tests
Other methods
Data management
Graphics
Matrix programming—Mata
Programming
Internet capabilities
Y2K
Accessibility
Sample session
New in Stata 10
Supported platforms
Which Stata package?
Technical support
User comments
Products
Stata 10
Order Stata
Upgrade
NetCourses
Bookstore
Stata Journal
Stata Press
Stata News
STB
Stat/Transfer
Gift Shop

Site overview
Products
Resources & support
Company
Site index

© Copyright 1996–2008 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index