Logistic regression: odds ratios to AUC
For two-outcome data: reading odds ratios, judging model fit and AUC, and writing up a logistic regression.
Pass or fail, buy or not, join or skip — when the outcome is one of two, this question comes up.
"Can I just use ordinary regression?"
Code the outcome as 0 and 1 and run a regression, and you will get numbers, but the interpretation often goes strange. The method for this is logistic regression. Here is when to use it, how to read the results table, and how to write it up.
What logistic regression is
Logistic regression explains the probability that a two-category outcome, such as yes/no, occurs, using several predictors.
The result is always a probability between 0 and 1, and each predictor's influence is read as an odds ratio (OR).
Why not ordinary regression?
- Predictions can come out below 0 or above 1, which makes no sense
- With only 0/1 outcomes, errors are not normally distributed and their variance is not constant
- Probability moves along an S-shaped curve, not a straight line (someone already at 90% has little room to go up)
So logistic regression turns the probability into log odds, models that as a straight-line function of the predictors, and estimates the coefficients by maximum likelihood.
- Odds = probability it happens ÷ probability it does not
- Log odds = B₀ + B₁X₁ + B₂X₂ + …
- Odds ratio (OR) = exp(B)
Three or more outcome categories?
Logistic regression is for outcomes with exactly two categories. With three or more, choose like this.
- Unordered categories (e.g. career path A / B / C) → multinomial logistic regression
- Ordered categories (e.g. dissatisfied < neutral < satisfied) → ordinal logistic regression
An example
- Participants — 240 candidates for a certification written exam (anonymous data)
- Outcome — passed or not (130 passed · 110 failed)
- Predictors — weekly study hours · number of mock exams taken · study-group participation
Check before you run it
- The outcome has exactly two categories
- At least 10 events per predictor (counting the smaller category; 3 predictors need 30 or more)
- The predictors do not overlap too much (multicollinearity, VIF)
- No variable splits the outcome perfectly (complete separation)
- Observations are independent of each other
With complete separation or very rare events, coefficients can blow up or the estimation may fail to converge.
Reading odds ratios
- OR > 1 — the odds of the event rise as the predictor increases
- OR < 1 — the odds fall as the predictor increases
- OR = 1 — no effect
And if the 95% confidence interval contains 1, the effect is not statistically significant.
In the example, weekly study hours have an OR of 1.26: each extra hour of study raises the odds of passing by about 26%.
Study-group participation has an OR of 2.41, so participants' odds of passing are about 2.4 times those of non-participants.
But an odds ratio is not a multiple of the probability. Writing "2.4 times the chance of passing" is wrong. To talk in probabilities, look at the average marginal effect (AME). In the example, joining a study group raises the probability of passing by about 17 percentage points on average.
Evaluating the model
- Likelihood-ratio test (χ²) — is it better than a model with no predictors?
- McFadden R² — on a different scale from ordinary R²; .2–.4 is already very good
- Hosmer-Lemeshow test — do predicted probabilities match observed rates? (p > .05 means good fit)
- Classification table — accuracy, sensitivity, specificity (usually at a 0.5 threshold)
- ROC curve and AUC — how well it ranks those who passed above those who failed
Read AUC as .7–.8 acceptable, .8–.9 good, .9 or above excellent.
The example's results
| Item | Result |
|---|---|
| Model | χ²(3) = 54.25, p < .001, McFadden R² = .16 |
| Study hours | OR = 1.26 [1.15, 1.37] |
| Mock exams | OR = 1.39 [1.14, 1.71] |
| Study group | OR = 2.41 [1.33, 4.36] |
| Discrimination | AUC = .77 · accuracy 72.1% |
| Fit | Hosmer-Lemeshow χ²(8) = 9.85, p = .276 |
None of the three intervals contains 1, so all are significant; discrimination is acceptable and the fit is fine.
How to write it up
A binary logistic regression was conducted with passing the certification written exam as the dependent variable. The model was significant, χ²(3) = 54.25, p < .001, McFadden R² = .16. Each additional weekly study hour multiplied the odds of passing by 1.26 (95% CI [1.15, 1.37]) and each additional mock exam by 1.39 (95% CI [1.14, 1.71]), and candidates who joined a study group had 2.41 times the odds of passing of those who did not (95% CI [1.33, 4.36]). The model's discrimination was acceptable (AUC = .77), and the Hosmer-Lemeshow test indicated good fit, χ²(8) = 9.85, p = .276.
Example sentence · the numbers are made up
In Skari
In Skari Statistics, choose Relationship → Generalized Models → Logistic Regression. It runs in the order Variables → Settings → Validation → Result.
Choose the outcome (binary) and the predictors, and the validation step first checks that the outcome has exactly two categories, the events per predictor and missing values.

Run a logistic regression on your data
Opens Statistics at Relationship → Generalized Models → Logistic Regression
The results come together as a report. Sample size, events, AUC and the key odds ratio sit at the top, and the result paragraph beneath them covers χ², McFadden R², odds ratios, AUC and Hosmer-Lemeshow in one go.

The coefficient table lists B, SE and z alongside odds ratios with 95% confidence intervals and the VIF.

You also get a performance table (accuracy, sensitivity, specificity, MCC and more), a comparison of the 0.5 threshold with the Youden-optimal threshold, the confusion matrix and average marginal effects (AME) for reading changes as probabilities. In the figures, flip through the ROC curve and confusion matrix, a calibration curve and an odds-ratio forest plot.

If the outcome has three or more categories, use multinomial or ordinal logistic regression from the same menu.
Wrapping up
The heart of logistic regression is "the odds ratio and its confidence interval". Remember whether the OR is above or below 1 and whether its interval contains 1, and results tables become much easier to read.
Want the theory behind it?The Academy's binary logistic regression chapter covers log odds, odds ratios and AUC in depth →