Site icon Codanics

Logistic Regression Calculator: Odds Ratios & ROC

Logistic Regression Calculator: free online tool by Codanics that runs in your browser
Regression & multivariate

Logistic Regression Calculator: Odds Ratios, ROC/AUC and Classification Table

Paste your dataset, choose a yes/no outcome and the predictors, and get a complete binary logistic regression: adjusted odds ratios with profile-likelihood (or Wald) 95% confidence intervals, the likelihood-ratio test, Nagelkerke, Cox–Snell and McFadden pseudo-R², the Hosmer–Lemeshow goodness-of-fit test, a classification table with sensitivity and specificity, the ROC curve with AUC and its DeLong confidence interval, a probability calculator and an APA-style table for Word.

✅ No login needed100% freeRuns in your browserYour data stays on your device
Logistic Regression Calculator✅ Free · no login📚 Cite this tool
Your data never leaves your PC. Your data is analysed on your own computer or phone, even when you upload a CSV or Excel file. Nothing is uploaded, stored or seen by Codanics, and no login is needed.

Predictors

Tick the predictors to include. Text columns are categorical; switch numeric codes to Categorical when the numbers are labels (for example 1 = White, 2 = Black). Each category is compared with its reference level. 0/1 variables can stay numeric.

  • PriceFree, no login or sign-up needed
  • Your dataProcessed in your browser, never uploaded
  • Works onPhone, tablet or computer, any modern browser
  • Made byDr. Muhammad Aammar Tufail, Codanics
  • Published17 November 2026
  • Last updated16 November 2026

📚 How to cite this tool

This tool is free. If it helped your thesis, paper, report or assignment, please cite it. It keeps the tools free and helps other students find them.

Citation · APA 7th edition

Tufail, M. A. (2026). Logistic regression calculator: odds ratios, ROC/AUC and classification table [Online tool]. Codanics. Retrieved 16 November 2026, from https://codanics.com/tools/logistic-regression-calculator/

In-text citation: (Tufail, 2026) · Narrative: Tufail (2026)

The access date is today’s date, filled in automatically. Author: Muhammad Aammar Tufail. Published 17 November 2026.

🚀 Follow Codanics channel on WhatsApp for more updatesNew free tools, scholarships, PhD positions and research tips, straight to your phone. Free lessons on YouTube too.

How to use the Logistic Regression Calculator

  1. Paste your dataset, use Paste from Excel or Upload CSV / Excel: one row per participant, the first row with column names. The classic low-birth-weight study (Hosmer & Lemeshow, n = 189) is loaded as an example.
  2. Choose the outcome (a column with two values) and which value is the event (for example 1, Yes or Dead).
  3. Tick the predictors. Switch numeric codes such as race 1/2/3 to Categorical and pick the reference level.
  4. Click Run logistic regression. Check the likelihood-ratio test, the odds ratios and their 95% CIs, then the model fit (pseudo-R², Hosmer–Lemeshow), the classification table and the ROC curve.
  5. Copy the APA table into Word or download the .docx, copy the results sentence and use the probability box to predict the risk for a new participant.

What logistic regression does

Binary logistic regression models the probability of a yes/no outcome (disease vs no disease, germinated vs not, pass vs fail) from one or more predictors. It works on the log-odds scale: log(p/(1 − p)) = b₀ + b₁X₁ + b₂X₂ + …. Exponentiating a coefficient gives an odds ratio (OR): the factor by which the odds of the event change for a one-unit increase in that predictor, holding the others constant. With several predictors these are adjusted odds ratios.

How to interpret the odds ratio

  • OR = 1: no association. OR > 1: higher odds of the event. OR < 1: lower odds.
  • A 95% CI that excludes 1 means the predictor is significant at the 5% level.
  • For a numeric predictor, the OR is per one unit. An OR of 0.985 per pound of mother’s weight is an OR of 0.985¹⁰ = 0.86 per 10 pounds.
  • For a categorical predictor, the OR compares each level with the reference level.
  • Odds ratios are not risk ratios. When the event is common (more than about 10%), the OR exaggerates the relative risk.

Model fit and discrimination

StatisticWhat it tells you
Likelihood-ratio χ²Whether the predictors together improve on a model with no predictors (the “omnibus test” in SPSS)
Nagelkerke / Cox–Snell / McFadden R²Pseudo-R² values. They are not the variance explained, and they are usually much lower than linear-regression R²; McFadden values of 0.2–0.4 indicate a good fit
Hosmer–Lemeshow testCalibration: whether predicted and observed event rates agree across ten risk groups. A non-significant p is good
Classification tableHow many cases are correctly classified at the chosen cut-off; depends heavily on the cut-off and the event rate
ROC curve and AUCDiscrimination over all cut-offs; the AUC does not depend on a cut-off

Formulas

logit(p) = ln(p/(1 − p)) = Xb p = 1/(1 + e^(−Xb)) OR = e^b b estimated by maximum likelihood (iteratively reweighted least squares) SE from (XᵀWX)⁻¹, W = diag(p(1 − p)) Wald z = b/SE LR χ² = D(null) − D(model), df = k − 1 D = −2 log-likelihood Profile-likelihood CI: all b with D(b) − D(b̂) ≤ χ²₁,₀.₉₅ = 3.841 Wald CI: b ± 1.96·SE Cox–Snell R² = 1 − exp(−LR/n) Nagelkerke R² = Cox–Snell / (1 − exp(−D(null)/n)) McFadden R² = 1 − ln L(model)/ln L(null) Hosmer–Lemeshow: Σ (O − E)²/E over events and non-events in 10 groups of predicted risk, df = groups − 2

The fitting algorithm follows R’s glm(), so coefficients and standard errors match summary(glm(..., family = binomial)) to at least 10 significant digits. Profile-likelihood intervals agree with R’s confint() to about 4–5 significant digits (R interpolates the profile with a spline; this tool solves for the exact root). The AUC, its DeLong confidence interval and the Youden cut-off match the R package pROC, and the Hosmer–Lemeshow test uses the same grouping as ResourceSelection::hoslem.test().

Good practice

  • Events per variable. Aim for at least 10 events (of the rarer outcome) per coefficient.
  • Linearity of the logit. A numeric predictor is assumed to have a straight-line effect on the log-odds. Check by adding a squared term or grouping the predictor into categories.
  • Separation. If a predictor perfectly separates the outcomes, ORs become infinite; the tool warns you. Use Firth’s penalised regression in that case.
  • Report adjusted ORs with 95% CIs, the LR test, a pseudo-R², the Hosmer–Lemeshow test and the AUC.

How to report it

“A binary logistic regression examined the effects of maternal age, weight, race, smoking, previous premature labours, hypertension and uterine irritability on low birth weight. The model was significant, χ²(8) = 33.25, p < .001, Nagelkerke R² = .23. Smoking (OR = 2.52, 95% CI [1.16, 5.64]) and hypertension (OR = 6.26, 95% CI [1.67, 26.52]) increased the odds of low birth weight.”

Learn to fit and check logistic models in R in the R with Aammar course.

Learn the statistics behind these numbers. Codanics has free statistics, R and Python lessons on YouTube and full courses for researchers.

Frequently asked questions

When should I use logistic instead of linear regression?

Use logistic regression when the outcome has two categories (yes/no, 0/1, case/control). Linear regression on a 0/1 outcome can predict probabilities below 0 or above 1 and violates its assumptions. For counts use Poisson regression; for a numeric outcome use multiple regression.

What is the difference between profile-likelihood and Wald confidence intervals?

Wald CIs are b ± 1.96·SE, which assumes the likelihood is symmetric. Profile-likelihood CIs follow the actual shape of the likelihood and are more accurate in small samples or for large odds ratios. R’s confint() uses profile likelihood; SPSS reports Wald intervals. You can switch between them.

How do I interpret the odds ratio of a continuous predictor?

It is the multiplicative change in the odds for a one-unit increase. To express it per 10 units, raise it to the 10th power (or multiply B by 10 before exponentiating). Choose units that make sense, for example per 10 years of age.

What does a significant Hosmer–Lemeshow test mean?

That the predicted probabilities do not match the observed event rates well (poor calibration). Consider non-linear terms or interactions. With very large samples the test becomes significant for trivial misfit, so also look at the observed vs expected table.

Which cut-off should I use for the classification table?

0.5 is the default, but when the event is rare almost everyone is predicted as non-event. The Youden cut-off from the ROC curve balances sensitivity and specificity; in clinical work the cut-off should reflect the costs of false positives and false negatives.

What is complete separation?

It happens when a predictor (or combination) perfectly predicts the outcome, for example every smoker had the event. The maximum-likelihood estimate is then infinite. The tool warns you; merge categories, drop the predictor or use Firth’s logistic regression (R package logistf).

Does this match SPSS and R?

Yes. Coefficients, standard errors, Wald tests, −2 log-likelihood, the omnibus χ², Cox–Snell and Nagelkerke R² and the classification table match SPSS Binary Logistic, and the results match R’s glm(). SPSS shows the Wald statistic as z² with 1 df; the p-values are identical.

Is my data uploaded?

No. The model is fitted in your browser and your data never leaves your computer. Remove names and identifiers before working with patient data anyway.

Do I need to log in or create an account to use the Logistic Regression Calculator?

No. There is no login, no sign-up and no email required. Open the page and start using it straight away, for free, on any device.

How do I cite this tool in my thesis or paper?

Use the citation box on this page. In APA 7th edition: Tufail, M. A. (2026). Logistic regression calculator: odds ratios, ROC/AUC and classification table [Online tool]. Codanics. Retrieved [date you used it], from https://codanics.com/tools/logistic-regression-calculator/. BibTeX, RIS (EndNote, Mendeley, Zotero), MLA, Harvard, Chicago and Vancouver formats are also available.

Free guides and courses from Codanics

More free tools

See all free Codanics tools → · Codanics on YouTube · WhatsApp channel

Made by Dr. Muhammad Aammar Tufail, Codanics. First published 17 November 2026, last updated 16 November 2026. Found a bug or have an idea for a new tool? Tell us on the WhatsApp channel or in the comments on YouTube. Results are for learning and planning; check important analyses with a statistician or your supervisor.
Exit mobile version