SPSS command: SPSS LOGISTIC REGRESSION

Binary logistic regression in your browser

Binary logistic regression models the probability of a two-category outcome, such as converted or not, from scale and categorical predictors, and reports each effect as an odds ratio.

Free · No account · Files stay on your device · Updated 18 October 2026

What it tells you

Crosstabs runs SPSS LOGISTIC REGRESSION on your device with Enter, Forward: LR and Backward: LR, the beginning block, model fit statistics and a classification table at a cutoff you choose.

  • Whether the predictors together improve on a constant-only model (omnibus chi-square for step, block and model).
  • How well the model fits: −2 log likelihood, Cox & Snell and Nagelkerke R², and the Hosmer–Lemeshow test of calibration across risk groups.
  • How each predictor shifts the odds of the event: B, Wald test and Exp(B) with its 95% confidence interval.
  • How many cases the model classifies correctly at the cutoff, separately for events and non-events.

When to use it

Use it when

  • Predicting a yes/no outcome such as churn, purchase, response or pass/fail from several predictors.
  • Estimating adjusted odds ratios for an exposure while controlling for other variables.
  • Screening which of many candidate predictors matter, with Forward: LR or Backward: LR selection.

Use something else when

  • Three or more unordered outcome categories: use multinomial logistic regression.
  • Ordered outcome categories (low/medium/high): ordinal regression keeps the ordering.
  • Time until the event matters, with censored cases: use Cox regression.
  • A predictor perfectly separates the outcome: estimates diverge; the output flags separation, but the model needs fewer or merged categories.

How to run it in Crosstabs

  1. 01

    Choose Binary logistic regression

    In Statistics mode open Regression → Binary logistic regression (LOGISTIC REGRESSION) and pick a Dependent (two categories) variable.

  2. 02

    Set the event and method

    Under Event (coded 1) choose which outcome value is modelled; the higher value is the default, as in SPSS. Choose Method: Enter, Forward: LR or Backward: LR.

  3. 03

    Add covariates

    Use Add covariate for each predictor. Tick Categorical (indicator) for categorical ones (string variables are always categorical) and set the Reference to Last or First.

  4. 04

    Set options

    Under Options change the Classification cutoff (default .5) and tick Iteration history if you want the −2LL and coefficients at each iteration.

  5. 05

    Declare the weight and run

    If the workspace has a weight, choose Frequency weight, Sampling weight or Run unweighted, then click Run logistic regression.

Worked example

Computed by the Crosstabs engine from the synthetic data below when this page was built — not typed in.

Try with example data

Data

150 synthetic free-trial users. The outcome is whether they converted to a paid plan (yes/no); predictors are the number of sessions in the trial and whether they signed up as a team or solo. Conversion is generated from a known logistic model with a fixed seed.

Omnibus Tests of Model Coefficients
ItemChi-squaredfSig.
Step18.4642<.001
Block18.4642<.001
Model18.4642<.001
Model Summary and Hosmer and Lemeshow Test
-2 Log likelihoodCox & Snell R SquareNagelkerke R SquareH-L Chi-squaredfH-L Sig.
161.2780.1160.1663.4007.846

Estimation terminated at iteration 4.

Classification Table
ObservedPredicted noPredicted yesPercentage Correct
no103496.3
yes331023.3
Overall Percentage75.3

The cut value is .500.

Variables in the Equation
ItemBS.E.WalddfSig.Exp(B)95% C.I. for EXP(B)
sessions0.2350.06712.1471<.0011.2651.108 to 1.444
plan——5.4501.020—
plan(1)0.9230.3955.4501.0202.5161.160 to 5.458
Constant−2.8070.54726.3771<.0010.060

plan is indicator-coded with solo as the reference category; plan(1) compares team with it.

How to read it

The two predictors improve on the constant-only model, χ²(2) = 18.46, p < .001, Nagelkerke R² = 0.166. Each extra trial session multiplies the odds of converting by 1.27 (95% CI 1.11 to 1.44). Hosmer–Lemeshow p = .846 shows no evidence of lack of fit, and the model classifies 75.3% of users correctly at the .5 cut, though only 23.3% of actual converters are predicted as converters; lower the classification cutoff if catching converters matters more.

Output tables explained

Case Processing Summary
Unweighted cases included and missing, followed by the Dependent Variable Encoding and, for categorical covariates, Categorical Variables Codings.
Block 0: Beginning Block
The constant-only model: its classification table, the constant in Variables in the Equation and score tests in Variables not in the Equation.
Omnibus Tests of Model Coefficients
Likelihood-ratio chi-square, df and significance for the step, block and model. With stepwise methods a negative step chi-square means a term was removed.
Model Summary
−2 log likelihood, Cox & Snell R² and Nagelkerke R², with a note on the iteration at which estimation stopped.
Hosmer and Lemeshow Test
Chi-square, df (groups − 2) and significance, with the Contingency Table for Hosmer and Lemeshow Test. Groups follow SPSS: about 10, never splitting cases with the same covariate pattern.
Classification Table
Observed against predicted outcome at the cutoff, with the percentage correct for each outcome and overall.
Variables in the Equation
B, S.E., Wald, df, Sig., Exp(B) and its 95% confidence interval for every covariate and indicator, with an overall Wald row for each categorical term; stepwise methods add Model if Term Removed and Variables not in the Equation.

Assumptions and notes

  • Observations are independent, and the log-odds of the event are linear in each scale covariate.
  • Enough events per predictor: as a rule of thumb at least 10 cases of the rarer outcome per estimated parameter.
  • No complete or quasi-complete separation; the output warns when estimation hits a perfect fit or does not converge within 20 iterations.
  • Missing values are removed listwise. Frequency weights must be whole numbers; a sampling weight gives B and Exp(B) only, with tests and Hosmer–Lemeshow withheld.

How the results are validated

The LOGISTIC REGRESSION engine is tested against independent reference values (Python 3.13.13, NumPy 2.5.4, SciPy 1.18.1, statsmodels 0.15.0, pandas 2.3.3). With Enter, B, S.E., Wald, Sig., Exp(B) and its 95% CI, −2LL, the omnibus chi-square, Cox & Snell and Nagelkerke R², the classification table at cut .5 and Hosmer–Lemeshow with SPSS grouping match statsmodels Logit within 1e-8 (relative to the larger of 1 and the reference value), and block 0 score tests within 1e-7. Against R 4.6.1 glm and ResourceSelection 0.3.6 hoslem.test on untied fitted values, B agrees within 1e-6, S.E. within 1e-5, −2LL within 1e-8 and Hosmer–Lemeshow within 1e-6. Forward: LR and Backward: LR are checked against a hand-run score/likelihood-ratio sequence (1e-7), and further tests cover frequency weights, sampling weights and separation detection. Validation evidence

Questions

How do I read Exp(B)?

Exp(B) is the odds ratio: the factor by which the odds of the event are multiplied for a one-unit increase in a covariate, or for an indicator category compared with the reference. Values above 1 raise the odds, below 1 lower them.

Which outcome value is the event?

By default the higher of the two values, as in SPSS; change it with Event (coded 1). The Dependent Variable Encoding table confirms which value is coded 1.

Why is Nagelkerke R² so much lower than R² in linear regression?

Pseudo R² values measure likelihood improvement, not explained variance, and are typically lower. Judge the model with the omnibus test, the classification table and Hosmer–Lemeshow together.

My model classifies most cases correctly but misses most events. Why?

With a rare event, the .5 cutoff favours predicting the common outcome. Lower the Classification cutoff toward the observed event rate to trade overall accuracy for sensitivity, or use the ROC curve procedure to choose a cutoff.

Which reference category should I choose for a categorical covariate?

Pick the category you want every other one compared with, usually a baseline or the largest group. Last is the SPSS default; First is available in the Reference menu.

Run Binary Logistic Regression on your own data

Open a .sav, CSV or Excel file. Everything runs in your browser; the file never leaves your device.

Open the workspace

SPSS is a trademark of IBM Corp. Crosstabs is not affiliated with or endorsed by IBM.