Developed by StatCalc.net Team Statistically reviewed by — Senior Statistician & Editor Last updated
Regression & Correlation

Logistic Regression Calculator

Use this calculator to perform a logistic regression with a binary outcome and one or more predictors. Enter, paste, or upload your data and click Calculate to get model fit statistics, coefficients, odds ratios, p-values, confidence intervals, classification results, ROC curve, AUC, and predictions.

Upload a CSV, Excel, or TXT file. Place the binary outcome in the first column, followed by the predictor variables.
Data
Enter values by row or paste several columns directly from Excel or Google Sheets.
Row
Event
Numeric
Numeric
Categorical
Base
Enter predictor values and click Predict.

Logistic Regression Output

How to Use the Logistic Regression Calculator

This logistic regression calculator allows you to analyze the relationship between one or more predictor variables and a binary or categorical outcome (such as yes/no, 0/1, or success/failure).

To use the calculator:

  1. Enter the binary response variable in the Outcome column and select the outcome you want to treat as the Event.
  2. Enter the predictors in the X1, X2, X3, … columns. You can rename the variables if need be. If you have more predictors, click the + Add Predictor button to add them. For categorical predictors, make sure to select the base category.
  3. Adjust the classification threshold
  4. Select the number of decimal places you want to display.
  5. Click Calculate.

The calculator first displays the fitted logistic regression equation together with the main results, including Nagelkerke R², the omnibus χ² statistic and p-value, AUC, classification accuracy, and the number of observations analyzed. It then provides detailed output tables for the Model Summary, Omnibus Test of Model Coefficients, Variables in the Equation, Classification Table, and Categorical Variable Coding, together with the ROC curve. You can use the Copy button to copy the results and tables into Word while retaining a format similar to output from statistical software such as SPSS.

Tip. For categorical predictors, enter text labels such as A/B, Male/Female, or Treatment/Control so the calculator can recognize the variable as categorical. Rows containing missing values are automatically excluded from the analysis. Also, the data input field allows you to enter the data manually, paste multiple columns directly from Excel or Google Sheets, or upload a CSV, Excel, or TXT file.

What Is Logistic Regression?

Logistic regression is a statistical model used to predict the probability of a categorical binary dependent outcome using one or more independent variables (predictors). Rather than directly predicting a numerical value of Y, logistic regression estimates the probability that the selected event will occur. Therefore, the binary dependent variable can take outcomes such as:

  • Yes or No
  • Pass or Fail
  • Purchased or Did Not Purchase
  • Disease Present or Disease Absent
  • Default or No Default

For example, a researcher may want to determine whether study hours and attendance predict whether a student passes an examination. In this case, Pass/Fail is the response variable, while Study Hours and Attendance are the predictors. In a logistic regression, the predictors can be numerical, categorical, or a combination of both.

If your response variable is numerical, use the linear regression calculator when you have one predictor or the multiple linear regression calculator when you have two or more predictors.

Logistic Regression Equation

Logistic regression models the log odds of an event. The general form of the equation is:

logit⁡(p)=ln⁡(p1−p)=b0+b1x1+b2x2+⋯+bkxk\operatorname{logit}(p)=\ln\left(\frac{p}{1-p}\right)=b_0+b_1x_1+b_2x_2+\cdots+b_kx_k

Where:

  • p is the probability of the event.
  • b₀ is the intercept.
  • b₁, b₂, …, bₖ are the regression coefficients.
  • x₁, x₂, …, xₖ are the predictors.

The fitted log odds can then be converted into a probability using the formula: p=11+e−logit⁡(p)p=\frac{1}{1+e^{-\operatorname{logit}(p)}}.

Therefore, the predicted probability always falls between 0 and 1.

Although the B coefficients are needed to form the equation, they are expressed in log-odds units. For practical interpretation, Exp(B), or the odds ratio, is usually easier to understand.

Understanding the Logistic Regression Outputs

After you click Calculate, the calculator first displays the fitted logistic regression equation and a summary of the main results. The detailed output then includes the Model Summary, Omnibus Test of Model Coefficients, Variables in the Equation, Classification Table, ROC Curve, and Categorical Variable Coding where applicable.

The interpretations below use the example data already loaded in the calculator. In this example, Yes is selected as the event, while A is selected as the base category for X3.

The fitted equation is: logit[P(Yes)] = −8.7687 + 0.4891(X1) + 0.0534(X2) + 1.1684(X3 [B]). Since A is the base category for X3, X3 [B] is coded as 1 when X3 = B and 0 when X3 = A.

The model also outputs the following tables.

1. Model Summary

The Model Summary gives an overview of how well the fitted model performs.

−2 Log LikelihoodCox & Snell R²Nagelkerke R²N
26.37530.37300.504330

The main statistics are:

  • −2 Log Likelihood: A likelihood-based measure of model fit. When comparing models fitted to the same data, a smaller value generally indicates better fit.
  • Cox & Snell R²: A pseudo-R² measure based on how much the fitted model improves over the intercept-only model.
  • Nagelkerke R²: An adjusted version of Cox & Snell R² that ranges from 0 to 1.
  • N: The number of complete observations included in the analysis.

For this model, Nagelkerke R² = 0.5043, indicating that the model provides a substantial improvement over a model with only the intercept term. However, this does not mean that X1, X2, and X3 explain exactly 50.43% of the variance in the outcome. Nagelkerke R² is a pseudo-R² and should not be interpreted in exactly the same way as R² from linear regression.

2. Omnibus Test of Model Coefficients

The Omnibus Test determines whether adding the predictors significantly improves the model compared with a model containing only the intercept.

Modelχ²dfp
Model14.00543.003

The hypotheses are:

  • H₀: All predictor coefficients are equal to zero.
  • H₁: At least one predictor coefficient is not equal to zero.

Since χ²(3) = 14.0054, p = .003, we reject the null hypothesis at the 5% significance level. Therefore, X1, X2, and X3, taken together, significantly improve the prediction of whether the outcome is Yes or No.

However, a significant overall model does not mean that every predictor is significant. To determine which predictors make a significant contribution, we move to the Variables in the Equation table.

3. Variables in the Equation

The Variables in the Equation table shows how each predictor relates to the odds of the event after controlling for the other predictors.

TermBSEWalddfpExp(B)95% CI for Exp(B)
Intercept−8.76874.77303.37511.0660.0002[0.0000, 1.7971]
X10.48910.18317.13651.0081.6309[1.1391, 2.3349]
X20.05340.04731.27821.2581.0549[0.9616, 1.1573]
X3 [B]1.16840.99061.39131.2383.2170[0.4616, 22.4206]

The predictor results can be interpreted as follows:

  • X1: B = 0.4891, p = .008, and Exp(B) = 1.6309. Holding X2 and X3 constant, a one-unit increase in X1 is associated with approximately 1.63 times the odds of Yes, or about 63.1% higher odds. The 95% confidence interval [1.1391, 2.3349] does not include 1. Therefore, X1 is a statistically significant predictor.
  • X2: B = 0.0534, p = .258, and Exp(B) = 1.0549. Holding X1 and X3 constant, a one-unit increase in X2 is associated with approximately 5.5% higher odds of Yes. However, the result is not statistically significant, and the 95% confidence interval [0.9616, 1.1573] includes 1.
  • X3 [B]: B = 1.1684, p = .238, and Exp(B) = 3.2170. Since A is the base category, observations in category B have approximately 3.22 times the odds of Yes compared with category A, after controlling for X1 and X2. However, the relationship is not statistically significant, and the 95% confidence interval [0.4616, 22.4206] includes 1.

Therefore, X1 is the only statistically significant predictor at the 5% significance level in this model.

The intercept represents the estimated log odds of Yes when X1 = 0, X2 = 0, and X3 is in the base category A. However, it may not have a useful practical interpretation if zero is outside the observed range of X1 or X2.

How to Interpret Exp(B)

Exp(B) is the odds ratio and is often the easiest logistic regression statistic to interpret.

  • Exp(B) > 1: The odds of the event increase.
  • Exp(B) < 1: The odds of the event decrease.
  • Exp(B) = 1: There is no change in the odds.

For example, Exp(B) = 1.50 means that a one-unit increase in the predictor is associated with 1.5 times the odds of the event, or approximately 50% higher odds, holding the other predictors constant.

If Exp(B) = 0.70, the odds are approximately 30% lower.

For categorical predictors, Exp(B) compares the displayed category with the selected base category.

Tip. Odds and probability are related but are not the same. An odds ratio of 1.50 does not mean that the probability increases by 50 percentage points.

4. Classification Table

The Classification Table compares the actual outcomes with the outcomes predicted by the model.

Using the default classification threshold of 0.50:

ActualPredicted NoPredicted YesTotal
No7512
Yes31518

The calculator also reports:

StatisticResult
Classification Threshold0.5000
Accuracy73.3%
Sensitivity83.3%
Specificity58.3%

The model correctly classifies 22 of the 30 observations, giving an overall accuracy of 73.3%.

The remaining statistics tell us more about where those correct classifications occurred:

  • Sensitivity = 83.3%: The model correctly identifies 15 of the 18 observations where the actual outcome is Yes.
  • Specificity = 58.3%: The model correctly identifies 7 of the 12 observations where the actual outcome is No.

The classification threshold determines when a predicted probability is converted into a category. With the default threshold of 0.50, probabilities of 0.50 or higher are classified as Yes, while probabilities below 0.50 are classified as No.

Changing the threshold can increase sensitivity while reducing specificity, or vice versa. Therefore, accuracy should not be interpreted without considering the classification threshold and the purpose of the model.

5. ROC Curve and AUC

The ROC curve evaluates how well the model separates the event from the non-event across different classification thresholds.

For the default data, the Area Under the Curve (AUC) = 0.8519. This indicates that the fitted model distinguishes reasonably well between Yes and No observations in this sample.

In general:

  • An AUC around 0.50 indicates little ability to distinguish between the two outcomes.
  • An AUC closer to 1.00 indicates better discrimination.

Unlike classification accuracy, AUC is not based on a single threshold such as 0.50.

The calculator also plots the ROC curve, allowing you to examine the relationship between sensitivity and 1 − specificity across different thresholds.

Note. The ROC curve and AUC use the same observations that were used to fit the logistic regression model. They therefore describe the performance of the model in the current sample and should not be treated as independent validation on new data.

6. Categorical Variable Coding

When you include a categorical predictor, the calculator creates dummy variables so that the categories can be included in the regression model.

For the default data, Category A is the reference group. Therefore, the coefficient and odds ratio for X3 [B] compare category B with category A.

In this model, Exp(B) for X3 [B] is 3.2170. This means that category B has an estimated 3.217 times the odds of Yes compared with category A, after controlling for X1 and X2. However, because p = .238, this difference is not statistically significant.

If a categorical predictor contains more than two categories, the calculator creates additional dummy terms while leaving one category as the base group.

Predicting the Probability of an Event

After fitting the model, this logistic regression calculator allows you to do a prediction. Simply open the Predict Probability button and enter the new combination of predictor values to get the prediction.

The calculator will instantly return:

  • the predicted probability of the event; and
  • the predicted category based on the classification threshold.

For example, suppose a set of predictor values produces: Predicted probability of Yes = 0.7800. The model therefore estimates a 78% probability of Yes for that combination of predictor values. If the classification threshold is 0.50, the predicted category is also Yes because 0.7800 is greater than 0.50.

Keep in mind that predictions are generally more reliable when the new predictor values fall within the range of the data used to fit the model.

How to Report Logistic Regression Results in APA Style

When reporting binary logistic regression, start with the overall model test and then report the predictors that are relevant to your research question.

Using the default calculator results, the overall model could be reported as:

A binary logistic regression was conducted to determine whether X1, X2, and X3 predicted the likelihood of the Yes outcome. The overall model was statistically significant, χ²(3) = 14.01, p = .003, Nagelkerke R² = .504.

You could then report the significant predictor as:

X1 was a statistically significant predictor of the Yes outcome, B = 0.49, SE = 0.18, Wald χ²(1) = 7.14, p = .008, OR = 1.63, 95% CI [1.14, 2.33]. Holding X2 and X3 constant, a one-unit increase in X1 was associated with approximately 1.63 times the odds of the Yes outcome.

You do not need to report every statistic generated by the calculator. Focus on the overall model, the predictors that address your research question, and any model-performance statistics required for your analysis.

Logistic Regression vs Linear Regression

The type of response variable is the main factor that determines whether you should use logistic or linear regression. The table below provides a quick overview of the differences to help you choose the most appropriate model.

Logistic RegressionLinear Regression
Binary response variableNumerical response variable
Predicts the probability of an eventPredicts a numerical value of Y
Reports odds ratiosReports regression coefficients
Uses likelihood-based model testsUses ANOVA and F-tests
Common outputs include classification and ROC/AUCCommon outputs include R² and standard error

Assumptions of Logistic Regression

Before interpreting the regression coefficients, p-values, and odds ratios, make sure the main assumptions are reasonably satisfied:

  • Binary response variable: The outcome should contain exactly two categories.
  • Independent observations: Each observation should be independent of the others.
  • Linearity in the logit: Each numerical predictor should have an approximately linear relationship with the log odds of the event.
  • No severe multicollinearity: The predictors should not contain excessive overlapping information.
  • Adequate data: There should be enough events and non-events to estimate the coefficients reliably.
  • No complete separation: A predictor or combination of predictors should not perfectly separate the two outcome groups.

Tip. Logistic regression does not require the predictors themselves to follow a normal distribution.

Frequently Asked Questions

What is a logistic regression calculator?

A logistic regression calculator fits a binary logistic regression model when the response variable has two possible outcomes. This calculator returns the fitted equation, model fit statistics, coefficients, p-values, odds ratios, confidence intervals, classification results, ROC curve, AUC, and predicted probabilities.

Does the outcome have to be coded as 0 and 1?

No. You can enter outcomes such as Yes/No, Pass/Fail, or Positive/Negative. Simply select which category you want to treat as the event. The calculator internally treats the selected event as 1 and the other category as 0.

Can I use more than one predictor?

Yes. You can include one or more predictors, provided your data contain enough complete observations to estimate the model. The predictors can be numerical, categorical, or a combination of both.

Can I use categorical predictors?

Yes. Enter categorical predictors using labels such as A/B or Treatment/Control. The calculator detects text categories and allows you to select the base category used for comparison.

What does Exp(B) mean in logistic regression?

Exp(B) is the odds ratio. For a numerical predictor, it shows how the odds of the event change for a one-unit increase in that predictor while holding the other predictors constant. However, for a categorical predictor, Exp(B) compares the displayed category with the selected base category.

What does Nagelkerke R² mean?

Nagelkerke R² is a pseudo-R² measure used to summarize logistic regression model fit. Higher values generally indicate greater improvement over the intercept-only model, but Nagelkerke R² should not be interpreted exactly like R² in linear regression.

Cite

Choose APA, MLA, Chicago, or Harvard. Citations credit StatCalc.net as the corporate author.

StatCalc.net. (2026, October 14). Logistic Regression Calculator. Retrieved October 19, 2026, from https://statcalc.net/logistic-regression-calculator/

About This Calculator

This calculator was developed by the StatCalc.net Team and statistically reviewed by , Senior Statistician & Editor.

Formulas, calculation logic, worked examples, and explanatory content are reviewed for statistical accuracy and clarity.