Logistic Regression Explained: Odds Ratios, Probabilities, Example
Reviewed by Prof. Dr. Alexander Holtermann · Updated 16 October 2026 · 6 min read
Logistic regression predicts a binary outcome (yes/no) from one or more predictors. Coefficients are log-odds; exp(b) gives the odds ratio.
Key takeaways
- Use logistic regression when the outcome has two categories, such as passed/failed or dropped out/stayed; linear regression would predict impossible probabilities below 0 or above 1.
- The model is linear on the log-odds scale:
ln(p / (1 − p)) = b₀ + b₁x₁ + …. Probabilities follow fromp = 1 / (1 + e^−(b₀ + b₁x₁ + …)). - exp(b) is the odds ratio: the factor by which the odds of the outcome change for a one-unit increase in the predictor. OR > 1 means higher odds, OR < 1 lower odds.
- Odds are not probabilities: an odds ratio of 3 does not mean “three times as likely”, especially when the outcome is common.
- Report OR with 95% CI and p for each predictor, a model test (likelihood ratio χ²) and optionally a pseudo-R² such as Nagelkerke’s.
When do you need logistic regression?
Logistic regression (binary logistic regression) models the probability of an event with two possible outcomes, coded 1 (event) and 0 (no event). Typical research questions: Which factors predict passing an exam? Does attending tutorials reduce the risk of dropping out? Does a reminder email increase the chance that students complete a survey?
Why not linear regression? With a 0/1 outcome, a straight line predicts values below 0 and above 1 for extreme predictor values, the residuals cannot be normal, and their variance depends on the predicted value. Logistic regression solves these problems by modeling the log-odds (logit), which can take any value, and translating it back into probabilities between 0 and 1 with an S-shaped curve.
| Outcome | Model |
|---|---|
| Metric (exam points) | Linear regression |
| Binary (passed yes/no) | Binary logistic regression |
| Several unordered categories (choice of major) | Multinomial logistic regression |
| Ordered categories (grade A to F) | Ordinal logistic regression |
Probability, odds and log-odds
Understanding three scales is the key to reading logistic regression output.
- Probability: chance of the event, between 0 and 1.
- Odds: ratio of event to non-event. p = .75 means odds of 3 (“3 to 1”).
- Log-odds (logit): natural logarithm of the odds; 0 corresponds to p = .50. The regression equation is linear on this scale.
- Odds ratio (OR): ratio of two odds; the effect size of logistic regression.
| Probability p | Odds p / (1 − p) | Log-odds ln(odds) |
|---|---|---|
| .10 | 0.11 | −2.20 |
| .25 | 0.33 | −1.10 |
| .50 | 1.00 | 0.00 |
| .75 | 3.00 | 1.10 |
| .90 | 9.00 | 2.20 |
Worked example: review session and passing
Of 120 students, 60 attended an optional review session before the statistics exam. Outcome: passed (1) or failed (0).
| Passed | Failed | Probability of passing | Odds of passing | |
|---|---|---|---|---|
| Attended (x = 1) | 45 | 15 | .75 | 45 / 15 = 3.00 |
| Did not attend (x = 0) | 30 | 30 | .50 | 30 / 30 = 1.00 |
Odds ratio is not “times as likely”
In the example the odds ratio is 3.00, but the probability of passing rises only from .50 to .75, a risk ratio of 1.5. Odds ratios exaggerate the risk ratio when the outcome is common. Only for rare events (below about 10%) are odds ratio and risk ratio similar.
Therefore, translate your results into probabilities for readers: “75% of attendees passed compared with 50% of non-attendees (OR = 3.00).” This is clearer than the odds ratio alone and avoids the frequent mistake of writing “three times as likely to pass”.
Continuous predictors and predicted probabilities
With a metric predictor, the odds ratio refers to a one-unit increase. Suppose a model predicts passing from weekly study hours with b₀ = −4.0 and b₁ = 0.5. Then exp(0.5) = 1.65: each additional study hour multiplies the odds of passing by 1.65; four more hours multiply them by exp(2.0) = 7.39.
Predicted probabilities come from p = 1 / (1 + e^−(b₀ + b₁x)). Because the curve is S-shaped, the same increase in hours changes the probability a lot in the middle and little at the extremes.
| Study hours | Log-odds −4 + 0.5 · x | Predicted probability of passing |
|---|---|---|
| 0 | −4.0 | .02 |
| 4 | −2.0 | .12 |
| 6 | −1.0 | .27 |
| 8 | 0.0 | .50 |
| 10 | 1.0 | .73 |
| 12 | 2.0 | .88 |
Assumptions, sample size and model evaluation
Logistic regression makes fewer distributional assumptions than linear regression but has its own requirements.
- Binary outcome coded 0/1, with independent observations.
- Linearity in the logit for metric predictors: the log-odds change linearly with the predictor. Check by adding a squared term or by grouping the predictor.
- No strong multicollinearity between predictors (VIF below about 5 to 10).
- Enough events: a classic rule asks for at least 10 events (the rarer outcome) per predictor. With 30 failures, use at most about 3 predictors.
- Model fit: likelihood ratio test against the null model; pseudo-R² (Nagelkerke, McFadden) are not comparable to R² from linear regression and are usually much smaller.
- Classification: a classification table or ROC curve (area under the curve) shows how well the model separates the two groups.
How to report a logistic regression in APA style
Report the model test, a pseudo-R², and for each predictor b, SE, the odds ratio with 95% CI and p. With several predictors, use a table with columns b, SE, OR, 95% CI for OR and p. Add predicted probabilities or percentages so that readers understand the size of the effect.
Doing this in SPSS, R, Stata or JASP
All programs estimate the same coefficients (log odds). Report odds ratios (Exp(B) in SPSS) with confidence intervals and declare categorical predictors correctly.
| Program | How to run it |
|---|---|
| SPSS | Analyze → Regression → Binary Logistic; Categorical for factors; Options: CI for exp(B), Hosmer-Lemeshow |
| R | fit <- glm(y ~ x1 + x2, family = binomial, data = df); odds ratios: exp(coef(fit)), exp(confint(fit)) |
| Stata | logit y x1 x2, or or logistic y x1 x2 |
| JASP / jamovi | Regression → Logistic Regression; tick odds ratios and confidence intervals |
Frequently asked questions
When should I use logistic regression instead of linear regression?
Whenever the outcome is binary (yes/no, passed/failed). Linear regression can predict impossible probabilities and violates its assumptions with such outcomes.
How do I interpret an odds ratio?
OR = 1 means no effect; OR > 1 means higher odds of the outcome per unit of the predictor; OR < 1 lower odds. OR = 3 means the odds are three times higher, which is not the same as three times the probability.
What is the difference between odds and probability?
Probability is events divided by all cases; odds are events divided by non-events. A probability of .75 equals odds of 3 to 1.
What is a good Nagelkerke R²?
There is no fixed threshold. Pseudo-R² values in logistic regression are typically lower than R² in linear regression. Values around .10 to .30 are common in social science data; focus on odds ratios and predicted probabilities.
How many participants do I need for logistic regression?
A common rule is at least 10 events of the rarer outcome per predictor. With 3 predictors and an expected failure rate of 25%, that means at least 30 failures, so about 120 participants.
Sources and further reading
- Agresti, A., & Finlay, B. (2018). Statistical Methods for the Social Sciences (5th ed.). Pearson.
- Howell, D. C. (2013). Statistical Methods for Psychology (8th ed.). Wadsworth Cengage Learning.
Your university’s examination regulations and style guide always take precedence.
Related articles
- Linear regressionLinear regression predicts a metric outcome from one or more predictors with a straight line: ŷ = a + b · x. R² shows how much variance it explains.
- Chi-square testThe chi-square test checks whether two categorical variables are related (independence) or whether frequencies match an expected distribution.
- Choosing a statistical testYour research question, the level of measurement of your outcome, the number of groups and whether samples are paired decide which statistical test fits.
- Effect sizeAn effect size tells you how large a difference or relationship is, independent of sample size. Cohen’s d of 0.2, 0.5 and 0.8 is small, medium, large.
- Confidence intervalA 95% confidence interval gives a range of plausible values for a population parameter. It shows both the size of an estimate and its precision.
- Statistics software comparedSPSS and Stata are menu- or command-based commercial packages, R and Python are free code, JASP and jamovi are free point-and-click. Choose by field and task.