Paste a table with a header row (comma, tab or semicolon separated), or upload a CSV file. Text columns such as yes/no or male/female are coded automatically; the first level alphabetically is the reference.

Predictors

When to use logistic regression

Use logistic regression when the outcome has two values, such as passed or failed, or ill or healthy, and you want to know how one or more predictors change the odds of it. Linear regression is the wrong tool here: it can predict probabilities below 0 or above 1. See logistic regression explained.

Worked example

The default data are 30 students: hours studied, whether they work part-time, and whether they passed (16 did).

In probabilities: a student who studied 5 hours and does not work has a predicted chance of passing of 85%. With a part-time job, it is 49%.

Reading odds ratios

An odds ratio of 2.41 does not mean “2.41 times as likely”. It multiplies the odds, and odds and probabilities only agree when the outcome is rare. See relative risk vs odds ratio.

Things to check

Accuracy

Coefficients, standard errors, p-values, odds-ratio intervals, log-likelihoods, McFadden R² and AIC match Python’s statsmodels Logit on 40 random datasets. The data stay in your browser.

Frequently asked questions

What is the difference between B and the odds ratio?

B is the change in the log-odds for a one-unit increase in the predictor. The odds ratio is e to the power B: the factor by which the odds are multiplied.

Which R squared should I report?

Logistic regression has no true R squared. Nagelkerke's is the one most often reported (SPSS shows it); McFadden's is common in economics. State which you used.

How do I include a categorical predictor?

Put it in the data as text, for example yes/no or a group name. The calculator creates dummy variables and uses the first level alphabetically as the reference.

What does complete separation mean?

A predictor perfectly divides the outcomes, for example everyone who studied more than 6 hours passed. The odds ratio is then infinite. Remove the predictor, add data, or use Firth's penalized regression.