Editverse Free Calculator

Logistic Regression Calculator

Model a yes/no outcome from one or more predictors — with adjusted odds ratios, a forest plot, and the reproducible R command. Read a full interpretation guide below. Validated against R 4.3.3.

In Simple Words

Logistic regression predicts a binary outcome — disease or no disease, survived or not — from one or more explanatory variables. Instead of fitting a straight line, it models the log-odds of the outcome, which keeps every predicted probability sensibly between 0 and 1.

Each predictor produces a coefficient that, once exponentiated, becomes an adjusted odds ratio: the change in the odds of the outcome for a one-unit change in that predictor, holding the others fixed. An odds ratio above 1 means the factor raises the odds; below 1 means it lowers them. The forest plot shows each odds ratio with its confidence interval at a glance.

When to Use Logistic Regression

Use it when the outcome is binary and you want to estimate the effect of several predictors at once, adjusting each for the others. It is the standard tool for risk-factor analysis in cohort and case-control studies, and the fitted probabilities can feed an ROC analysis to judge how well the model discriminates.

Report each adjusted odds ratio with its 95% confidence interval rather than the raw coefficient, and state which variables were in the model. For a continuous outcome, use multiple linear regression instead. Watch the events-per-variable rule of thumb: roughly ten outcome events per predictor keeps estimates stable. Not sure which model fits your outcome? Our interactive Test Selector can help.

Logistic Regression Binary outcome prediction & ORs · validated vs R 4.3.3
User guide

When to use. Model a binary outcome and obtain adjusted odds ratios for each predictor.

Assumptions. Outcome is binary; log-odds are linear in the predictors; observations independent.

Common mistakes. Rule of thumb: at least ~10 events per predictor to avoid unstable estimates.

Worked example

Click Load example data above, then Run Analysis to see a fully worked result with figure, formula and interpretation for this test.

References
  1. Hosmer DW, Lemeshow S, Sturdivant RX. Applied Logistic Regression. 3rd ed. 2013.

Worked Examples

Example 1 — A single binary predictor

Modelling 30-day mortality on a smoking indicator yields a coefficient that exponentiates to an odds ratio of, say, 1.8 — smokers have 1.8 times the odds of the outcome. The 95% confidence interval shows whether that estimate is precise enough to be convincing.

Example 2 — Adjusting for confounders

Adding age and comorbidity to the model gives the odds ratio for smoking adjusted for those factors. If the adjusted odds ratio shrinks toward 1, some of the crude association was explained by the confounders. The forest plot displays all adjusted odds ratios together.

Assumptions to Check

Independent observations and a binary outcome. Each record is one independent subject with a yes/no outcome. Clustered or repeated data need a mixed or GEE model.

Linearity in the logit for continuous predictors. Continuous variables should relate linearly to the log-odds; check with splines or categorisation if in doubt.

Enough events per predictor. A common guideline is at least about ten outcome events per predictor; fewer risks unstable, overfit estimates.

Common Mistakes

Interpreting odds ratios as risk ratios

When the outcome is common, the odds ratio overstates the relative risk. Be explicit that the model reports odds ratios, not relative risks.

Overfitting with too many predictors

Cramming many variables into a model with few events produces wide intervals and unreliable estimates. Respect the events-per-variable guideline.

Ignoring model fit and discrimination

A model can produce odds ratios yet fit poorly. Report calibration and discrimination (for example, the area under the ROC curve).

Reporting coefficients instead of odds ratios

Raw log-odds coefficients are hard to interpret. Exponentiate them to odds ratios and present the 95% confidence interval.

Frequently Asked Questions

What does an adjusted odds ratio mean?

It is the odds ratio for one predictor while holding the other variables in the model constant, isolating that predictor’s independent association.

How many predictors can I include?

As a rule of thumb, keep roughly one predictor per ten outcome events to avoid overfitting. With more predictors than data support, estimates become unstable.

When should I use linear regression instead?

Use linear regression for a continuous outcome. Logistic regression is for binary outcomes.

Does the result match SPSS, R, and Stata?

Yes. The calculator fits the model by maximum likelihood like glm() in R and shows the exact R command so you can reproduce it.

References

  1. Stoltzfus JC. Logistic regression: a brief primer. Acad Emerg Med. 2011;18(10):1099–1104. PMID 21996075.
  2. Brand R, Keirse MJ. Using logistic regression in perinatal epidemiology: an introduction for clinical researchers. Part 1: basic concepts. Paediatr Perinat Epidemiol. 1990;4(1):22–38. PMID 2320497.
  3. Hosmer DW, Lemeshow S, Sturdivant RX. Applied Logistic Regression. 3rd ed. Hoboken, NJ: Wiley; 2013.

Need This Analysis Done for Your Manuscript?

Our PhD biostatisticians build your logistic regression models, report adjusted odds ratios with confidence intervals, and deliver publication-ready forest plots with reproducible R output.

Get Expert Statistical Help