Logistic Regression Calculator
Use this online logistic regression calculator to analyze a categorical dependent variable with one or more continuous or categorical predictors. The calculator supports binary logistic regression, ordinal logistic regression, multinomial logistic regression, and one-versus-rest logistic regression. It reports model-fit statistics, coefficients, significance tests, effect measures, confidence intervals, and in-sample classification results.
Example datasets
Load an example dataset and then select its dependent and independent variables in the calculator above.
Binary medical Multinomial marketing Multinomial travel-mode Ordinal satisfactionHow to calculate logistic regression
- Copy your data into the table above or load one of the example datasets.
- Select one categorical variable as the dependent variable.
- Select one or more continuous or categorical independent variables.
- For categorical predictors, choose the predictor reference category used for dummy coding.
- If an ordinal dependent variable has three or more valid categories, the calculator selects Ordinal logistic regression. You can alternatively select Multinomial or One model per category.
Rows containing a missing value in the dependent variable or any selected predictor are excluded as incomplete cases. If fewer than two outcome categories remain, a logistic regression model cannot be estimated.
Which logistic regression method should you use?
| Method | When to use it | Model fitted by the calculator |
|---|---|---|
| Binary logistic regression | The dependent variable has exactly two valid categories. | One binary model for the selected event category versus the other category. |
| Ordinal logistic regression | The dependent variable has three or more naturally ordered categories. | One cumulative-logit proportional-odds model using the category order defined for the variable. |
| Multinomial logistic regression | The dependent variable has three or more mutually exclusive, unordered categories. | One joint model with one equation for every non-reference outcome category. |
| One-versus-rest logistic regression | You want a separate binary comparison of every outcome category against all remaining categories. | One independently estimated binary model per outcome category. |
Binary logistic regression
Binary logistic regression is used when the dependent variable has two categories, such as diseased and not diseased. Select the event category that should be coded as 1. Each coefficient describes the change in the log-odds of that event for a one-unit change in the predictor, while the other predictors remain constant. Exponentiating a coefficient gives the corresponding odds ratio.
The classification table and ROC curve use the fitted event probabilities. Changing the classification threshold changes predicted classes, sensitivity, and specificity, but it does not re-estimate the regression coefficients.
Ordinal logistic regression
Ordinal logistic regression is used for ordered outcomes such as dissatisfied, neutral, and satisfied. The calculator fits a cumulative-logit proportional-odds model using the numeric category order defined for the variable. Exp(B) is the proportional odds ratio for being in a higher rather than a lower category.
The test of parallel lines checks whether one common coefficient can be used across all cumulative category boundaries. If this test is significant, the proportional-odds assumption is not met and multinomial logistic regression may be more appropriate.
Multinomial logistic regression
Multinomial logistic regression is the default when the dependent variable has three or more unordered categories. The model estimates all category probabilities jointly, so the fitted probabilities for an observation sum to 1. Select one outcome as the reference category. For K outcome categories, the model contains K - 1 coefficient equations, each comparing a non-reference outcome with the reference outcome.
In the multinomial coefficient tables, Exp(B) is reported as a relative risk ratio for the displayed outcome versus the reference outcome. Changing the outcome reference category changes the coefficient comparisons, but it does not change the joint fitted probabilities or the model's overall fit.
One-versus-rest logistic regression
One-versus-rest regression fits one binary model for each category. For example, an outcome with categories A, B, and C produces A versus not A, B versus not B, and C versus not C. Select a category to inspect its complete binary model. The combined classification assigns each observation to the category with the largest fitted binary score.
Because the one-versus-rest models are estimated independently, their raw scores are not joint multinomial probabilities and do not need to sum to 1. Use multinomial logistic regression when you need a single joint statistical model of all unordered outcome categories.
Multinomial and one-versus-rest regression treat outcome categories as unordered. If your dependent variable is metric instead, use linear regression.
Results and interpretation
The likelihood-ratio chi-square test evaluates whether the fitted predictors improve model fit compared with an intercept-only model. A small p-value indicates an overall improvement, but it does not show which individual predictor is associated with the outcome. Use the coefficient table, confidence intervals, and p-values to evaluate individual terms.
- Coefficient B: the estimated change in a log-odds comparison for a one-unit predictor increase or a change from the predictor reference category.
- Standard error, z, and p: measures used to test whether an individual coefficient differs from zero.
- Exp(B): an odds ratio in a binary model and a relative risk ratio for an outcome-versus-reference comparison in a multinomial model.
- 95% confidence interval: the plausible range for Exp(B); an interval excluding 1 is consistent with a two-sided p-value below 0.05.
- Pseudo R-squared: an approximate model-fit index, not a literal percentage of variance explained.
- Classification table: an in-sample summary of observed and predicted categories, not a hypothesis test or an out-of-sample validation result.
Assumptions and limitations
Before interpreting the results, consider whether observations are independent, the selected sample is sufficiently large for the number of estimated parameters, and every outcome category contains enough valid cases. Continuous predictors should have an approximately linear relationship with the relevant logit. Severe multicollinearity, influential observations, and complete or quasi-complete separation can make coefficients unstable or prevent convergence.
Standard multinomial logistic regression additionally relies on the independence of irrelevant alternatives assumption. Classification accuracy, ROC statistics, and other results calculated from the same observations used to estimate the model can be optimistic. Use validation data when predictive performance is important. Regression results alone do not establish a causal relationship.
Learn more about logistic regression
Read the logistic regression tutorial for the model equation and a step-by-step explanation, or see the odds ratio and logistic regression guide for more help interpreting binary logistic regression. For an overview of all the available methods, see the regression analysis overview.
The following video demonstrates how to calculate and interpret a binary logistic regression.