1st Edition

A Practical Guide to Logistic Regression Using Stata

By Alan C. Acock Copyright 2026
196 Pages
by Stata Press

Alan Acock's book, A Practical Guide to Logistic Regression Using Stata , is written for students and researchers who are new to logistic regression and who want to focus on applications rather than theory. This guide teaches when and why logistic regression is appropriate, how to easily fit these models by using Stata, and how to interpret and present the results. The book begins with a... Read more

What we can do with logistic regression

Questions we can answer using logistic regression
Ways to report results
Using Stata

Getting ready

Opening the dataset
Exploring the data
Labeling values for categorical variables
Saving the edited dataset

Conventional ordinary least-squares regression versus logistic regression

What OLS regression can tell us
What logistic regression can tell us

Interpreting an odds ratio

What is an odds ratio?
Interpreting ORs as a percentage difference for binary predictors

What is wrong with ordinary least-squares regression for a binary outcome?

Hypothetical data
How does logistic regression fit better than ordinary least-squares linear regression?

Fitting and interpreting logistic regression models

Interpreting coefficients and odds ratios
Fitting logistic regression models with multiple predictors
Interpreting ORs for quantitative predictors
Selecting the right base level for categorical predictors

How well does the model fit the data?

Pseudo-R² measures of fit
Information criteria
Identifying cases that the model fits poorly

Sensitivity and specificity

Criteria for evaluating an analysis
Estimation of sensitivity and specificity

Receiver operating characteristic curves and cutpoints for screening tests

ROC curves
Comparing tests

Predictions using the margins command

What is better than reporting coefficients and odds ratios?
Data preparation
Estimating the ORs
The margins command

Graphic presentation using the marginsplot command

When and why
Graphs of categorical predictors that include three or more categories
Graphs with one quantitative predictor
Graphs with one quantitative and one categorical predictor
Graphs of a pair of categorical predictors
Graphs of a pair of categorical predictors

Curve fitting with quadratic models

A hypothetical example of a quadratic model using OLS regression
Estimating the curve (uncentered predictor)
Centering, collinearity, and nonessential collinearity
Estimating the curve (centered x)
Compare centered and uncentered models
Use of a quadratic with logistic regression

Interaction

Introduction
Interaction of a categorical and a quantitative variable using logistic regression
Estimating and interpreting probabilities (uncentered)
Interaction of categorical variables
Interaction of quantitative variables

Running nestreg and postestimation commands

Nested logistic regression
Selected postestimation commands

Special topics

Collinearity and multicollinearity

Evaluating multicollinearity

Sample size
Small-sample bias
Relative risk

A Appendix

References

Biography

Alan Acock is a University Distinguished Professor Emeritus in the School of Social and Behavioral Health Sciences at Oregon State University. Among other awards, he was an Alumni Distinguished Professor for his teaching. He is the author of A Gentle Introduction to Stata and Discovering Structural Equation Modeling Using Stata. He has authored more than 175 articles in leading journals across many fields, including Structural Equation Modeling, Psychological Bulletin, Multivariate Behavioral Research, American Journal of Public Health, American Sociological Review, Educational and Psychological Measurement, and American Journal of Preventive Medicine.