Logistic Regression Calculator
One predictor, a binary outcome: the log-odds line solved by Newton–Raphson (IRLS), coefficients with Wald SEs, the odds ratio with its interval — and separated data refused by name, because there the answer does not exist.
Logistic Regression Calculator
Results recalculate instantly on every keystroke. Nothing you type is transmitted.
What this result does not account for
- One predictor + intercept — no multiple-predictor IRLS
- Complete separation has no finite MLE (refused, not faked); Firth/exact out of scope
In short: For x = 0, 0, 0, 0, 1, 1, 1, 1 with y = 0, 0, 1, 1, 1, 1, 1, 0 the model logit(p) = b₀ + b₁·x solves to b₀ = 0.000000 and b₁ = 1.098612 — which is ln 3 exactly: the odds of y = 1 triple per unit of x (odds ratio e^b₁ = 3.000000, 95% Wald CI 0.150276 to 59.889833 — wide, because eight rows buy little certainty; log-loss 0.627741). The certificate is on the card: the mean fitted probability is 0.625 = ȳ, the intercept score equation at work. Data that SEPARATE the classes are refused outright — there the likelihood climbs forever and no finite best coefficient exists.
Formula
P(y = 1 | x) = 1 / (1 + e^−(b₀ + b₁x)) · Newton–Raphson on the log-likelihood (IRLS)
Standard errors come from the inverse information matrix X′WX at the solution — no shortcuts; p-values are Wald, two-sided, on the normal curve.
Worked Example
- Enter the predictor list and the 0/1 outcome list — same count, 4 to 500 rows.
- Read the fitted log-odds line, then each coefficient with its SE, z and p.
- The odds-ratio card converts b₁ to “odds multiplied by e^b₁ per unit of x”, with a Wald interval.
- Check the convergence proof: mean fitted probability must equal ȳ.
Defaults: b₀ = 0.000000, b₁ = 1.098612 (= ln 3), OR = 3.000000 with CI (0.150276, 59.889833), log-loss 0.627741, accuracy 62.5% (5 of 8), mean fitted 0.625 = ȳ. Separated y (all 0s below all 1s) is refused: no finite maximum likelihood exists.
Strengths & Limits Of This Model
Where this engine is strong
- Newton–Raphson to machine tolerance with the convergence identity printed
- Odds ratio with Wald interval, and the separation refusal named with its literature
Where it stops
- No Firth correction, no exact logistic, no regularization
- Threshold fixed at 0.5 for the accuracy card
Practical Use Cases
Conversion
does more touchpoints raise P(purchase)?
Clinical
dose vs P(response), with OR per mg
Teaching
IRLS and separation, watched live
Methodology & Editorial Standards
Computation runs in IEEE-754 double precision at full internal precision; rounding to two decimal places occurs strictly at the display layer, so no cumulative drift enters the result. All monetary outputs use accounting presentation — grouped thousands, two decimals, negatives in parentheses — so figures can be transcribed directly into a model or working paper. Division-by-zero and out-of-domain inputs return an em-dash rather than a misleading number.
This engine was reconciled against an independent reference implementation and hand-verified for the worked example above before release. Our full five-stage review process is published on the About Us page.
Disclaimer. This calculator is provided for informational and modelling purposes only and does not constitute financial, tax, legal, medical, or engineering advice. Verify all figures with a qualified professional before acting on them.
Logistic Regression Calculator — 8 Expert FAQs
8 analyst-written answers to the questions practitioners actually ask — optimised for voice and answer-engine retrieval.
What does b₁ = 1.098612 actually mean?
It is a LOG-ODDS slope: each one-unit rise in x multiplies the odds of y = 1 by e^1.098612 = 3 — the odds-ratio card prices it. The coefficient lives in logit space because the model is linear there; it is never “3 more probability”.
Why do separated data have no answer?
If every y = 1 sits on one side of every y = 0, the likelihood climbs forever as the slope grows: a finite best coefficient does not exist (the Albert–Anderson separation result). Huge coefficients with huge SEs from software are a symptom, not a result. The Firth penalized likelihood is the standard rescue — out of scope here, stated as a boundary.
Why does the mean fitted probability equal ȳ?
The intercept’s score equation forces Σ(yᵢ−pᵢ) = 0 at any converged fit with an intercept, so the fitted probabilities average to the observed proportion. It is a free certificate: if those two numbers disagree, the solve did not finish.
Can I add more predictors?
Not on this page — it solves the ONE-predictor plus intercept problem cleanly (Newton–Raphson on a 2×2 information matrix). Two predictors make that matrix 3×3; the multiple-regression page shows the elimination machinery for the linear case and the same discipline extends.
Is 62.5% accuracy good?
Unanswerable without the base rate: predicting y = 1 for EVERY row also scores 62.5% on the defaults. Compare against the majority rate, and against log-loss, which punishes confidently wrong probabilities that plain accuracy forgives.
Why probabilities and not classes?
Logistic regression models P(y = 1 | x); the 0/1 prediction is a decision laid on top at a threshold (0.5 here). The honest pair is the probability the model believes plus the threshold you chose — this page prints both and hides neither.
Why is the odds-ratio interval so wide?
Eight rows. The Wald CI is e^(b₁ ± 1.959964·SE) and SE shrinks like 1/√n, so a small sample buys a wide span — 0.150276 to 59.889833 on the defaults says direction suggested, magnitude unknown. More data, not more decimals, is the fix.
My y values are 0/1 counts of an event — fine?
Yes — any binary outcome works: converted or not, survived or not, passed or not. What breaks the model is a value outside {0, 1}: the page refuses a 2 with the position named, because a probability of a non-event is not a question.