Binary logistic regression
Predicts a two-category outcome (yes/no, pass/fail) from numeric and categorical predictors, reporting odds ratios.
Menu: Analyze → Regression → Binary Logistic…
When should I use it?
- Which factors predict whether a customer buys again?
- Does a test score predict passing, controlling for attendance?
What are the assumptions?
- Independent observations; a binary outcome.
- Linearity between each numeric predictor and the log-odds.
- Enough events: about 10 or more cases in the smaller outcome group per predictor.
- No perfect separation (a warning appears if coefficients become huge).
How do I run it in StatLab?
- Move the outcome to Dependent and the predictors to Covariates.
- List categorical predictors under Categorical covariates (indicator coding, last or first category as reference).
- Keep Hosmer-Lemeshow and CI for exp(B); change the classification cutoff only with a reason.
- Choose Method = Forward or Backward (LR or Wald) for automatic selection: variables enter by the score test (entry probability .05) and leave by the likelihood-ratio or Wald test (removal probability .10). Categorical covariates enter and leave as one block.
How do I read the output?
| Output | Meaning |
|---|---|
| Dependent Variable Encoding | Which value is the event (coded 1). |
| Block 0 | The constant-only model and score tests for the predictors. |
| Omnibus Tests | Chi-square test of the whole model. |
| Model Summary | -2 log likelihood, Cox & Snell and Nagelkerke R². |
| Hosmer and Lemeshow Test | Sig. > .05 means no evidence of poor fit. |
| Classification Table | Percentage correctly classified at the cutoff. |
| Variables in the Equation | B, S.E., Wald, Sig., Exp(B) (odds ratio) with its confidence interval. |
| Model if Term Removed / Variables not in the Equation (stepwise) | At each step: how much -2LL would rise if a variable left, and the score test for each variable still outside. |
Worked example
On the practice survey dataset (File → Sample dataset), this command — which the dialog's Paste button also produces — runs the procedure:
PROC glmLogistic /dep=smoker /covs=(age score educ) /cats=(educ) /method=enter /pin=0.05 /pout=0.1 /ref=last /hl=YES /ci=YES /cut=0.5 /casewise=NO /save=NO.
Output tables: Case Processing Summary · Dependent Variable Encoding · Categorical Variables Codings · Classification Table · Variables in the Equation · Variables not in the Equation · Omnibus Tests of Model Coefficients · Model Summary · Hosmer and Lemeshow Test · Contingency Table for Hosmer and Lemeshow Test · Classification Table · Variables in the Equation.
How would I report it in APA style?
A binary logistic regression predicted Smoker (N = 150). The model was not statistically significant, χ²(5) = 3.97, p = .554, Nagelkerke R² = .037, and classified 69.3% of cases correctly; the Hosmer-Lemeshow test was χ²(8) = 10.28, p = .246. age: OR = 0.99, 95% CI [0.96, 1.01], p = .345; score: OR = 1.02, 95% CI [0.97, 1.07], p = .463; educ(1): OR = 1.04, 95% CI [0.39, 2.74], p = .943; educ(2): OR = 0.67, 95% CI [0.23, 2.01], p = .479; educ(3): OR = 0.55, 95% CI [0.20, 1.49], p = .238.
Computed by StatLab's validated procedure code when this page was built. The example only illustrates the steps; choose variables that fit your own research question.
What are common mistakes?
- Reading Exp(B) as a change in probability — it is a multiplicative change in odds.
- Judging the model only by the classification table when one outcome is rare.
- Reporting a stepwise model as if its variables were chosen in advance — the selection inflates significance.