Regression for yes-or-no outcomes
Pass or fail, bought or not, defaulted or repaid: half the outcomes people model are binary, and a straight line handles them badly. It predicts probabilities below 0 and above 1, and it insists the effect of X is the same at the edges as in the middle. Logistic regression bends the line into an S-curve that stays inside [0, 1]: steep where the outcome is genuinely in doubt, flat where X has already decided matters.
Ten students, hours studied against pass (1) or fail (0). The fit: logit(p) = −5.82 + 2.59 × hours. The odds ratio is e2.59 = 13.3: each extra hour multiplies the odds of passing by about thirteen, a huge-sounding number on a tiny sample. Predicted pass probabilities: 0.35 at 2 hours, 0.88 at 3 hours, 0.99 at 4 hours; the 50-50 point sits at 2.25 hours. Honesty check: with n = 10 the slope's p-value is 0.125, short of significance. The curve is the best story for these ten students, and only for them.
Odds, log-odds, probabilities: keep them apart
The coefficients live on the log-odds scale, which nobody thinks in. Convert before interpreting. Exponentiate a coefficient to get an odds ratio: multiplicative change in the odds per unit of X. Convert odds to probability with p = odds ÷ (1 + odds) when a plain-language number is needed. An odds ratio of 13 is not "13 times the probability"; at high base rates the same odds ratio means a modest probability change.
Perfect separation: when some threshold of X splits the outcomes cleanly (everyone above 3 hours passed, everyone below failed), the maximum-likelihood slope runs off toward infinity and software reports absurd coefficients with enormous standard errors. The calculator flags a fit that fails to settle. The cure is more data or a penalized fit, not a bigger iteration limit.
How the coefficients are found
There is no least-squares formula here. The coefficients maximize the likelihood of the observed pattern of 0s and 1s, found iteratively (the calculator uses iteratively reweighted least squares). Fit quality is gauged on the log-likelihood scale: McFadden's pseudo-R² compares the fitted model with an intercept-only model. Here it is 0.628. Read it as a rough gauge only; it is not a share of variance.
Frequently asked questions
Why not just use linear regression on the 0s and 1s?
People do (the linear probability model), and for rough work near the middle it behaves. But its predictions escape [0, 1], its errors are forced into two sizes, and its constant-effect assumption fails exactly where decisions get interesting. Logistic costs little more and behaves everywhere.
What is an odds ratio, in plain words?
The factor by which the odds of the outcome multiply per unit of X. Odds of 3:1 becoming 6:1 is an odds ratio of 2. Convert to probabilities before presenting to a general audience.
What does it mean when the fit does not converge?
Usually perfect or near-perfect separation: X predicts the outcome almost without exception. The data are telling you the effect is strong but cannot price it precisely. More data, or a penalized method like Firth's, is the standard response.
Can logistic regression take several predictors?
Yes, the model extends directly, and production tools fit it routinely. This page covers the single-predictor case, where the curve can be drawn and read.