Skip to content
GLM Playground home

Assignment 1 · Logistic regression · Model selection

Stepwise logistic model selection

The first assignment asked for the “best” logistic regression for a binary survey outcome and an interpretation of its odds ratios. This page retraces the selection path — from all main effects, through a 66-parameter interaction model, back to 18 parameters — and shows the final odds ratios.

About the data

Variables (as coded in the survey)

  • age, educ: ordered bands (scores 0–3 and 0–2)
  • ms: marital status (married, de facto, divorced, separated, widowed, never married)
  • smok, alc: smoker; 8+ drinks a week
  • falc: a family member's drinking was a concern when growing up
  • mmo: married or de facto more than once; reg: region (4)

The selection path

  1. model0

    18 params · deviance 1417.67 on 1298 df · AIC 1453.7

    dv ~ factor(age) + factor(ms) + mmo + smok + alc + falc + factor(educ) + factor(reg)

    Sequential tests: drinking (alc) adds little (p = 0.1158), so it is dropped.

  2. model1

    17 params · deviance 1420.13 on 1299 df · AIC 1454.1

    dv ~ factor(age) + factor(ms) + mmo + smok + falc + factor(educ) + factor(reg)

    All remaining main effects are kept.

  3. model2

    14 params · deviance 1427.24 on 1302 df · AIC 1455.2

    dv ~ age + factor(ms) + mmo + smok + falc + educ + factor(reg)

    Age and education as numeric scores instead of factors: likelihood-ratio test against model1 gives p = 0.0686, so the simpler coding is kept.

  4. model3

    66 params · deviance 1365.71 on 1250 df · AIC 1497.7

    dv ~ (age + factor(ms) + smok + falc + educ + factor(reg))^2

    Every two-way interaction of the model2 terms (66 parameters): the starting point for an AIC search.

  5. model4

    22 params · deviance 1406.53 on 1294 df · AIC 1450.5

    dv ~ age + factor(ms) + smok + falc + educ + factor(reg) + factor(ms):falc + smok:falc + educ:factor(reg)

    step() by AIC keeps three interactions: marital status × family alcohol, smoking × family alcohol and education × region.

  6. model5

    21 params · deviance 1408.59 on 1295 df · AIC 1450.6

    dv ~ age + factor(ms) + smok + falc + educ + factor(reg) + factor(ms) * falc + educ:factor(reg)

    Smoking × family alcohol is not significant (p = 0.2147) and is removed.

  7. model6

    18 params · deviance 1415.09 on 1298 df · AIC 1451.1

    dv ~ age + factor(ms) + smok + falc + educ + factor(reg) + factor(ms):falc

    Education × region is borderline (LR test p = 0.0893) and is removed; every remaining term is significant. This is the final model.

AIC along the selection path
1440146014801500model0: AIC 1453.7, deviance 1417.7 on 1298 df, 18 parameters1453.7model0model1: AIC 1454.1, deviance 1420.1 on 1299 df, 17 parameters1454.1model1model2: AIC 1455.2, deviance 1427.2 on 1302 df, 14 parameters1455.2model2model3: AIC 1497.7, deviance 1365.7 on 1250 df, 66 parameters1497.7model3model4: AIC 1450.5, deviance 1406.5 on 1294 df, 22 parameters1450.5model4model5: AIC 1450.6, deviance 1408.6 on 1295 df, 21 parameters1450.6model5model6: AIC 1451.1, deviance 1415.1 on 1298 df, 18 parameters1451.1model6

The full interaction model (model3) has the lowest deviance but the worst AIC. The larger dot marks the lowest AIC (model4, the step() result); the final model (terracotta) gives up a little AIC to drop two terms that were not significant.

Final model, terms added in order

Residual deviance 1415.09 on 1298 df, AIC 1451.1.

Term addedDfDevianceResid. DfResid. DevPr(>Chi)
NULL13151561.634
age123.32113141538.3141.4 × 10⁻⁶ ***
factor(ms)531.20713091507.1078.5 × 10⁻⁶ ***
smok119.66913081487.4389.2 × 10⁻⁶ ***
falc110.27513071477.1630.0013 **
educ118.26213061458.9011.9 × 10⁻⁵ ***
factor(reg)331.01613031427.8858.4 × 10⁻⁷ ***
factor(ms):falc512.79112981415.0940.0254 *

Final odds ratios

From the final model (model7, model6 with its terms reordered). Intervals use the model's covariance matrix.

Odds of reporting violence or abuse

Squares: odds ratios. Lines: 95% confidence intervals. Log scale; left of the darker line at 1 means lower odds of reporting.

Personal

  • Smoker vs non-smoker1.70 (1.28, 2.27)
  • Age band +10.71 (0.59, 0.85)
  • Education level +10.61 (0.48, 0.78)

Region (vs North)

  • East0.40 (0.27, 0.61)
  • South1.03 (0.73, 1.45)
  • West0.65 (0.45, 0.94)

Family alcohol concern (by marital status)

  • Married1.69 (1.16, 2.46)
  • De facto0.29 (0.10, 0.82)
  • Divorced2.33 (0.68, 7.97)
  • Separated2.17 (0.44, 10.63)
  • Widowed3.07 (0.34, 27.54)
  • Never married1.90 (0.95, 3.80)

Odds ratio (log scale)

Marital status vs married (Q2)
StatusNo family alcohol concernFamily alcohol concern
De facto2.218 (1.30, 3.80)0.374 (0.14, 1.01)
Divorced1.552 (0.73, 3.28)2.137 (0.75, 6.10)
Separated3.713 (1.82, 7.56)4.762 (1.09, 20.75)
Widowed1.629 (0.61, 4.37)2.954 (0.39, 22.21)
Never married1.154 (0.75, 1.79)1.298 (0.64, 2.64)