Written and maintained by CASRAI Editorial Board
Last updated
Stata has two commands that fit the exact same binary logistic regression model — identical log-likelihood, identical standard errors, identical z-statistics — and print two different-looking result tables. logit reports coefficients on the log-odds scale; logistic exponentiates the same coefficients and reports odds ratios. Neither is more “correct”; they are two display formats for one estimation. This guide covers what each command prints, how to switch between the two displays without refitting, and the postestimation work — margins, estat gof, lroc — that a coefficient or an odds ratio alone doesn’t give you: the actual predicted probability, and whether the model fits.
One model, two commands, two defaults
Fit the same specification both ways:
logit outcome predictor1 predictor2 i.category_var logistic outcome predictor1 predictor2 i.category_var
Compare the two outputs and the log-likelihood, degrees of freedom, LR chi-square, and Pseudo R² at the top are identical — because it is the same maximum-likelihood estimation underneath. The only difference is the coefficient table: logit‘s Coef. column is on the log-odds scale (the natural log of the odds ratio); logistic‘s Odds Ratio column is exp(coefficient). Take the log of any number in the logistic table and you get back the matching row in the logit table exactly.
Reading logit: coefficients on the log-odds scale
logit reports a Coef. column, its standard error, a z-statistic, a p-value, and a 95% confidence interval — all on the log-odds scale. A positive coefficient means the predictor raises the log-odds of the outcome (and therefore the odds and the probability); a coefficient of exactly zero means no association. The scale is awkward to communicate directly (few readers have intuition for “log-odds units”), which is why most write-ups either exponentiate the coefficient by hand to report an odds ratio, or run logistic instead for a table that’s already in that form. What logit‘s scale is genuinely useful for: it’s the linear index (xb) that predict and margins work from, and it’s the natural scale for testing linear combinations of coefficients with lincom or test, since odds ratios don’t add or subtract meaningfully but log-odds do.
Reading logistic: odds ratios
logistic reports the same estimation as an Odds Ratio column instead of a coefficient column — the standard error, z, and p-value shown are still computed on the underlying log-odds scale (a delta-method-adjusted SE for the exponentiated value), so the significance test is identical to logit‘s even though the displayed SE column looks different. An odds ratio above 1 means the predictor is associated with higher odds of the outcome; below 1 means lower odds; exactly 1 means no association. The size of the departure from 1 is the effect: an OR of 1.8 is “80% higher odds,” an OR of 0.6 is “40% lower odds,” for a one-unit change in a continuous predictor or relative to the reference level for a factor-variable predictor.
The one caution worth stating plainly, because it’s a common misreading in published write-ups: an odds ratio is not a risk ratio or a probability ratio. When the outcome is common (roughly above 10–15% prevalence), an odds ratio noticeably overstates the corresponding risk ratio. If the write-up needs a risk ratio specifically, that’s a different model (a binomial or Poisson regression with a log link and robust variance), not a relabeling of the logistic output.
Switching the display without refitting
Both commands accept the other’s display as an option on the same estimation results — no need to run the model twice:
logit outcome predictor1 predictor2, or logistic outcome predictor1 predictor2, coef
And after either command has already run, redisplaying with a different option doesn’t refit anything:
logit outcome predictor1 predictor2 logit, or
The second line reprints the stored estimates from the first with odds ratios instead of coefficients. This matters when a reviewer or a co-author asks for “the other version” of a table already produced — there’s no need to re-run the estimation, only to redisplay it.
margins: from odds ratios to predicted probabilities
Neither a coefficient nor an odds ratio is a probability, and readers often want one — “what’s the predicted probability of the outcome for a typical case,” or “how much does the predicted probability change when this predictor increases by one unit.” That’s what margins is for, run after either logit or logistic since they share the same stored estimation results:
margins margins, atmeans margins, dydx(*) margins predictor1, at(predictor2=(10 20 30))
margins alone reports the average predicted probability across the estimation sample (the average marginal prediction). margins, atmeans reports the predicted probability at the sample means of every other predictor. margins, dydx(*) reports the average marginal effect (AME) of every predictor on the probability scale — the actual change in predicted probability, which is what an odds ratio does not directly give. For a variable entered with the i. factor-variable prefix, margins automatically computes the correct discrete change (the probability difference between levels) rather than a continuous derivative — a distinction the model doesn’t get right if the categorical variable is entered as a plain 0/1 numeric predictor instead of with i.. marginsplot, run immediately after any margins command, graphs the results with confidence bands.
Postestimation diagnostics: estat gof, lroc, estat classification
All of these run after logit or logistic interchangeably — the choice of which command estimated the model doesn’t affect postestimation, since both save the same class of results.
estat gof, group(10) table— the Hosmer-Lemeshow-style goodness-of-fit test: predictions are sorted into (by default 10) groups by predicted probability, and a chi-square statistic compares observed versus expected outcome counts within each group. A non-significant result is the desired outcome here — it means the model’s predictions aren’t detectably wrong. Runestat gofwithoutgroup()only when covariate patterns are few and mostly repeated (all-categorical predictors); with continuous predictors, almost every observation is its own unique covariate pattern, which makes the ungrouped Pearson test unreliable — usegroup()in that case.lroc— plots the ROC curve and reports the area under it (AUC), a measure of how well the model discriminates outcome-1 cases from outcome-0 cases across all possible classification cutoffs, not just 0.5.estat classification— a classification table (sensitivity, specificity, correctly classified) at one specific cutoff, 0.5 by default, adjustable withestat classification, cutoff(#). Report this alongsidelroc‘s AUC, not instead of it — a single cutoff’s classification table hides how the model performs at other thresholds.
Robust and clustered standard errors
Add vce(robust) for heteroskedasticity-robust standard errors, or vce(cluster clustervar) when observations are grouped (repeated measures on the same subject, students within schools) and the independence assumption behind the default standard errors doesn’t hold:
logistic outcome predictor1 predictor2, vce(cluster school_id)
This changes only the standard errors, z-statistics, and confidence intervals — the point estimates (coefficients or odds ratios) are unchanged, since vce() affects variance estimation, not the maximum-likelihood point estimate itself.
What to report
A complete write-up needs, at minimum: the odds ratio (or coefficient, if the field’s convention is log-odds) with its 95% confidence interval and p-value for each predictor of interest; the goodness-of-fit result (estat gof); a discrimination measure (lroc‘s AUC); and, where the audience needs an intuitive effect size rather than an odds ratio, the average marginal effect from margins, dydx(*) stated as a probability-scale change. Reporting only the odds ratio table, with no fit or discrimination statistic, is the single most common gap reviewers flag in a logistic regression write-up.
Frequently asked questions
Do logit and logistic ever give different results?
No — run on the same data with the same specification, they produce identical coefficients, standard errors, and p-values under the hood. The only difference is which scale the main results table displays them on by default.
Which command should I run first?
Either. Some researchers default to logistic because odds ratios are the more commonly reported effect size in applied write-ups; others default to logit because the log-odds scale is what margins, lincom, and linear hypothesis tests actually operate on internally. Since either command’s stored results support both displays and all the same postestimation commands, the choice doesn’t foreclose anything.
Why does my odds ratio for a continuous predictor look tiny, like 1.02?
Check the predictor’s scale. An OR of 1.02 for a variable measured in single units (age in years, a 0–100 score) can still be a meaningful effect once compounded across a realistic range — a 20-point difference in that predictor corresponds to roughly 1.0220, not 1.02. Consider rescaling the predictor (e.g., per 10 units) before fitting if the raw per-unit odds ratio is hard to communicate.
Can I use margins with logit if I already ran logistic?
Yes. margins and every other postestimation command work off the stored estimation results, not the command name that produced them — there is no need to refit with logit specifically before running margins.
Related CASRAI resources
- Logistic Regression (the Logit Model): Interpretation, Diagnostics, and Reporting — the software-agnostic conceptual guide to the model itself, for the underlying statistics independent of any one package.
- Binary Logistic Regression in SPSS: Procedure and Output — the equivalent menu-driven workflow and output tables in SPSS.
- Logistic Regression in R: glm(), Odds Ratios, and Diagnostics — the same model fit with
glm(), including R-specific diagnostics. - Regression in Stata: regress, Postestimation, and Reporting — the continuous-outcome counterpart, for when the dependent variable isn’t binary.
- Cohort Study vs. Case-Control Study: Design, Odds Ratios, and Common Pitfalls — how odds ratios are used and interpreted in observational study design.
- Confidence Interval and P-Value — the two statistics reported alongside every coefficient or odds ratio in this guide’s output tables.
- SPSS vs. Stata for Statistical Analysis and R vs. Stata for Statistical Analysis — choosing between packages before committing to a workflow.








