Reading Past the Coefficients: Making Stata's margins Do the Interpretation Work
Logit coefficients don't answer real questions. Stata's margins command turns them into adjusted predictions and average marginal effects — here's how to use it, and where it can mislead.
23 Jan 2026, 10:25 UTC

The problem: a logit coefficient is not an answer
You fit a logistic regression of union membership on age, education, and race. The output gives you a coefficient of 0.09 on education. What does that mean for an actual person? A log-odds ratio of 1.09 is technically correct and practically useless in a report. What your reader wants is: how much does the probability of union membership change with one more year of education, and what is the predicted probability for a typical worker?
Stata's margins command exists precisely for this gap. It is a post-estimation tool — you run it after a model — that turns coefficients into adjusted predictions, marginal effects, and elasticities, with correct standard errors computed by the delta method. The thesis of this piece: if you are interpreting a nonlinear model from raw coefficients alone, you are doing avoidable and error-prone math that margins already does better.
Two quantities people routinely confuse
margins can produce several things, but two cover most needs:
- Adjusted prediction: the predicted outcome at specified covariate values.
margins, atmeansevaluates the prediction at the sample means of the covariates — the "average person" prediction. - Average marginal effect (AME):
margins, dydx(education)computes the slope of the prediction with respect to education for every observation, then averages those slopes. This is usually what you want, because in nonlinear models the effect differs across individuals.
The distinction matters. The marginal effect at the means (margins, dydx(education) atmeans) is a different number from the average of individual effects. For policy-style questions — "on average across this population, what does one more year of schooling do?" — the AME is the defensible choice.
A worked example with nlsw88
Using Stata 17's built-in National Longitudinal Survey of Women dataset, run these in the Command window or a do-file (no special permissions needed; the dataset ships with Stata):
sysuse nlsw88, clear
logistic union age grade i.race
margins, atmeans
margins, dydx(grade)
The first margins call reports the predicted probability of union membership evaluated at mean age, mean education, and the observed race distribution. The second reports the average marginal effect of one additional year of schooling on that probability — a number in probability units (e.g., "about 1 percentage point"), which you can put directly in a sentence.
Two things to check in the output: the confidence interval should come from the delta-method standard errors shown in the table, and the predicted probability from atmeans should sit between 0 and 1 (it will, for a logit — but checking catches accidental use after the wrong model). Note the example uses grade for years of schooling, the variable name in nlsw88, not education.
For factor variables, margins race gives adjusted predictions for each racial group, and margins, dydx(race) gives contrasts between groups. For pairwise comparisons with p-values, follow with pwcompare or use the contrast option.
Where margins can mislead you
margins is a calculator, not a referee. Three limitations deserve respect:
- Garbage in, garbage out. Marginal effects inherit model misspecification. If the logit link is wrong or a key interaction is omitted, the AME is a precisely estimated wrong number.
- Dependence structure. Plain
marginsassumes the standard errors from your model are valid. With survey data, fit the model withsvy:first; with clustered data, usevce(cluster clustvar)on the estimation command somarginspicks up the robust variance matrix. - Cost. On large datasets with many covariates, computing observation-level derivatives and averaging them can be slow. That is a reason to plan for it, not to skip it.
A quick way to verify the result
You can sanity-check margins, atmeans by hand: predict the linear index, plug in the covariate means, apply the inverse logit, and compare. For the AME, a stronger check is a bootstrap:
bootstrap, reps(500): logistic union age grade i.race
estat bootstrap
margins, dydx(grade)
Run the bootstrap on the estimation, then compare the bootstrapped standard errors with the delta-method ones from the original margins run. If they diverge wildly, investigate the model before trusting either. (Bootstrap standard errors attach to the estimation; comparing them against the margins SEs is an approximate but useful smell test.)
Closing: make it a habit, then report it
The actionable habit is simple: never report a nonlinear model without a margins call attached. Run margins, atmeans for the baseline prediction, margins, dydx() for the effects you care about, and export with esttab or putexcel so the numbers in your paper are the numbers Stata computed. Your coefficients describe the model; your margins describe the world.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.