Written by Dackohn; last reviewed December 2026.
Logistic regression predicts the probability of a yes/no outcome. Each coefficient is a change in the log-odds; raised to the power e, it becomes an odds ratio. In our example, each extra hour of study multiplied the odds of passing by 2.41 (95% CI 1.27 to 4.56).
Why not ordinary regression?
If the outcome is pass (1) or fail (0), a straight line will eventually predict probabilities below 0 or above 1, and its errors cannot be normal. Logistic regression instead models the log-odds of the outcome as a straight line, which keeps every predicted probability between 0 and 1 and gives the familiar S-shaped curve.
Probability, odds and log-odds
- Probability p: a chance from 0 to 1.
- Odds = p / (1 − p). A probability of .50 is odds of 1 (“even odds”); .80 is odds of 4.
- Log-odds = ln(odds). This is the scale on which the model is linear.
The model is: ln(odds) = B₀ + B₁x₁ + B₂x₂ + …
Worked example
Thirty students: hours studied, whether they work part-time, and whether they passed. The fitted model, from the logistic regression calculator, is:
ln(odds of passing) = −2.65 + 0.88 × hours − 1.80 × part-time
| Term | B | Odds ratio | 95% CI | p |
|---|---|---|---|---|
| Hours studied | 0.88 | 2.41 | 1.27 to 4.56 | .007 |
| Works part-time | −1.80 | 0.16 | 0.01 to 2.42 | .188 |
Reading the coefficients
Hours studied: each extra hour adds 0.88 to the log-odds, which multiplies the odds by e0.88 = 2.41, holding part-time work constant. For a student without a job, the odds of passing go from 0.99 at 3 hours to 2.38 at 4 hours: 2.41 times as high.
Part-time work: the odds ratio of 0.16 suggests much lower odds, but the interval (0.01 to 2.42) includes 1, so this small study cannot tell whether a job matters.
The same odds ratio, very different probability changes
An odds ratio is constant, but its effect on the probability is not. For a student without a job:
- From 3 to 4 hours, the probability of passing rises from .50 to .70, 20 percentage points.
- From 8 to 9 hours, it rises from .988 to .995, less than one point.
So report predicted probabilities for typical cases, not only odds ratios. Here, a student who studies 5 hours has an 85% predicted chance of passing without a job and 49% with one.
Odds ratios are not risk ratios
“OR = 2.41” does not mean “2.41 times as likely”. That reading is only roughly right when the outcome is rare. With common outcomes, the odds ratio is further from 1 than the risk ratio. See relative risk vs odds ratio.
Is the model any good?
- Model chi-square: compares the model with one that has no predictors. Here χ²(2) = 18.40, p < .001.
- Pseudo R²: logistic regression has no true R². Nagelkerke’s (.61 here) is the most often reported; McFadden’s (.44) runs lower. Say which you use.
- Classification: with a cut-off of 0.5, the model classified 83.3% of students correctly. Accuracy depends on the cut-off and on how common the outcome is, so do not over-interpret it.
Common problems
- Too few events. A common guideline is at least 10 events in the smaller outcome group per predictor term. Our example has 14 fails and 2 terms (7 per term), so the estimates are rough.
- Separation. If a predictor perfectly divides the outcomes (everyone above 6 hours passed), the odds ratio is infinite and the software either fails or reports absurd numbers.
- Treating a number code as numeric. A variable coded 1 = urban, 2 = suburban, 3 = rural must be entered as categories, not as a number.
Try it yourself
Logistic Regression Calculator →Upload a CSV and get odds ratios, model fit and an APA write-up. Odds Ratio Calculator →The odds ratio for a single 2×2 table.Frequently asked questions
What is the difference between linear and logistic regression?
Linear regression predicts a numeric outcome. Logistic regression predicts the probability of a yes/no outcome by modelling the log-odds as a straight line.
How do I interpret a logistic regression coefficient?
B is the change in the log-odds for a one-unit increase in the predictor. e to the power B is the odds ratio: the factor by which the odds are multiplied.
Which pseudo R squared should I report?
Nagelkerke's is the most common in psychology and medicine, and is what SPSS shows; McFadden's is common in economics. State which one you report.
How many observations do I need for logistic regression?
A common guideline is at least 10 events in the smaller outcome group for each predictor term. Fewer than that gives unstable estimates.
Related reading: Relative risk vs odds ratio · Correlation vs causation · Types of variables
Sources & further reading: NIST/SEMATECH e-Handbook of Statistical Methods · OpenStax Introductory Statistics. How we compute & validate: methodology. Written & reviewed by Dackohn; last reviewed August 2026.