Logistic Regression Calculator
Binary logistic regression online with coefficients, odds ratios, Wald tests, McFadden R squared and ROC.
When to use it
Use when the outcome is binary (diseased/healthy, germinated/not, pass/fail) and you have one or more continuous or categorical predictors. The standard regression model in epidemiology, clinical trials, and binary classification problems.
When NOT to use it
Do not use for outcomes with three or more categories (use Multinomial Logistic for unordered, Ordinal Logistic for ordered). Do not use for count outcomes (Poisson or negative binomial). When the outcome rate is extremely low (under 1 percent) and n is small, exact logistic or Firth-penalised logistic give better small-sample inference.
What you get
Coefficient table with log-odds estimates, standard errors, Wald z, two-sided p, and 95 percent CIs; odds ratios with their CIs (the more interpretable scale); McFadden's pseudo R-squared; null and residual deviance with the model likelihood-ratio chi-square; classification accuracy at the 0.5 cut-off; ROC curve with AUC.
Worked example
15-subject demo: binary disease outcome predicted from Age and BMI.
Diseased: 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1 Age: 65, 42, 70, 38, 68, 50, 72, 45, 60, 35, 75, 80, 40, 30, 66 BMI: 28, 22, 31, 24, 30, 25, 32, 23, 27, 21, 33, 35, 22, 20, 29
Expected output: Both predictors increase odds of disease; Age OR per year > 1, BMI OR per unit > 1
Source: StatVeda built-in example, paired with the analyse page sample for toolId 'logistic'.
How to interpret the output
An odds ratio above 1 means the predictor increases the odds of the event; below 1 means it decreases them. A 95 percent CI for the OR that excludes 1 implies p < 0.05. McFadden pseudo R-squared between 0.2 and 0.4 indicates an excellent fit (Hensher and Stopher 1979); much lower values are normal in social and biomedical data. AUC of 0.5 is no better than random; 0.7 is acceptable; 0.8 plus is strong. The model assumes the logit is linear in continuous predictors; check this with a Box-Tidwell or by adding squared terms.
Common pitfalls
- Reporting log-odds coefficients without the odds ratios (less interpretable).
- Treating McFadden pseudo R-squared on the same scale as linear R-squared.
- Using classification accuracy for imbalanced outcomes (use AUC or balanced accuracy).
- Ignoring multicollinearity (run a variance-inflation-factor check on the predictors).
Try it in StatVeda
The Logistic Regression (binary) engine runs entirely in the browser. No signup, no install, no data sent to a server. Paste your data, hit Run, copy the output.
Open Logistic Regression (binary)References
- Hosmer, D. W., Lemeshow, S. and Sturdivant, R. X. (2013). Applied Logistic Regression, 3rd edition. John Wiley and Sons, Hoboken.
- McFadden, D. (1973). Conditional logit analysis of qualitative choice behavior. In Frontiers in Econometrics (Zarembka, P., editor). Academic Press, New York.
- Agresti, A. (2013). Categorical Data Analysis, 3rd edition. John Wiley and Sons, Hoboken.