Logistic Regression Calculator
Paste or import a table with a yes/no outcome, tick the predictors and get the fitted model, odds ratios with confidence intervals, model fit tests, an ROC curve and predictions.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Load your data
Paste the table or import a CSV file, or start from one of the samples.
- 2Pick the outcome
Choose the outcome column and the value that counts as the event.
- 3Choose predictors
Tick the columns to include and set the reference level for text columns.
- 4Read the coefficients
Check the odds ratios, intervals, p-values and the plain-language lines.
- 5Check the fit
Look at the likelihood-ratio test, pseudo R², Hosmer-Lemeshow and the ROC curve.
- 6Export
Download the coefficients and predictions as CSV, print the report or predict a new case.
About this tool
Logistic regression is the standard way to model an outcome that has only two values: passed or failed, churned or stayed, disease or no disease. Instead of predicting the outcome directly, it models the log of the odds of the event as a straight-line combination of the predictors, so every coefficient turns into an odds ratio when you raise e to its power. This calculator reads a CSV or tab-separated table with a header row, lets you choose which column is the outcome and which value counts as the event, and fits the model by maximum likelihood with Newton-Raphson iterations, the same method used by R's glm, SPSS and Stata. Numeric columns enter as they are; text columns such as a contract type or a region become dummy variables against a reference level you can pick. Rows with a missing value are left out and counted. The results show each coefficient with its standard error, Wald z and p-value, the odds ratio with a 90, 95 or 99 percent interval, the likelihood-ratio test against the intercept-only model, AIC and BIC, three pseudo R² measures and the Hosmer-Lemeshow goodness-of-fit table. A classification tab gives the confusion matrix at any cut-off, sensitivity, specificity and F1, beside the ROC curve with its area and the cut-off with the best Youden index. You can also draw the fitted S-curve, predict a new case and download the coefficients or every row with its fitted probability.
Reading the output
A positive coefficient raises the odds of the event and a negative one lowers them. The odds ratio is the factor by which the odds change for one unit more of a numeric predictor, or for a dummy level compared with the reference. An interval that contains 1 means the data are compatible with no effect at that confidence level. The likelihood-ratio chi-square tests all predictors together and is more reliable than the individual Wald tests in small samples. The area under the ROC curve (AUC) is the chance that a randomly chosen event row gets a higher fitted probability than a randomly chosen non-event row: 0.5 is no better than a coin, 0.7 to 0.8 acceptable and above 0.8 good.
Worked example
The sample has 20 students with the hours they studied and whether they passed. The fit converges in a few iterations to logit(p) = −4.0777 + 1.5046 × hours. The hours coefficient has a standard error of 0.6287, so z = 2.393 and p = 0.0167. The odds ratio is e^1.5046 = 4.503, with a 95% interval from 1.313 to 15.44: each extra hour multiplies the odds of passing by about four and a half. The likelihood-ratio chi-square is 11.67 on 1 df (p = 0.0006), Nagelkerke R² is 0.589 and the AUC is 0.895. A student who studies 2 hours has a predicted pass probability of 25.6%, one who studies 4 hours 87.4%, and the 50% point is at 2.71 hours. At a cut-off of 0.5 the model classifies 16 of the 20 students correctly.
Limits
The model assumes that the log-odds change linearly with each numeric predictor and that rows are independent. It does not handle repeated measures, matched designs, more than two outcome categories or penalised fits. When a predictor separates the outcome perfectly the estimates run off to infinity; the tool warns about this, but it does not apply Firth's correction. Odds ratios describe associations in your data and do not prove cause.
Worked example
Hours studied against passing for 20 students: odds ratio 4.50 per hour (95% CI 1.31 to 15.44), p = 0.017, AUC 0.895.
Quick facts
- Category: Math & Science
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in English.
- Content last reviewed:
- Official source: Hosmer, Lemeshow and Sturdivant, Applied Logistic Regression, 3rd edition (Wiley 2013)
Frequently asked questions
What data format does the logistic regression calculator need?
A table with a header row and one row per case, separated by commas, semicolons or tabs. One column holds the outcome with exactly two values, such as yes and no or 1 and 0, and the other columns hold the predictors.
How do I interpret an odds ratio below 1?
It means the odds of the event fall as the predictor rises. An odds ratio of 0.80 means each extra unit cuts the odds by 20 percent; for a dummy level it means lower odds than the reference level.
What is the difference between the Wald test and the likelihood-ratio test?
The Wald test divides each coefficient by its standard error. The likelihood-ratio test compares the log-likelihood of the full model with the intercept-only model. In small samples or with large effects the likelihood-ratio test is more trustworthy.
Which pseudo R² should I report?
None of them is a share of variance explained like R² in linear regression. McFadden's value is common in economics and Nagelkerke's in medicine; report which one you used.
How should I choose the classification cut-off?
0.5 is the default, but the right value depends on the cost of each kind of error. The ROC tab marks the cut-off with the highest Youden index, which balances sensitivity and specificity, and you can try any other value with the slider.
How many rows do I need for a stable model?
A common rule of thumb asks for at least 10 events (the rarer outcome) for each coefficient. With fewer, standard errors are large and the model may overfit.
