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
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.
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.
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.
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.
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.
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.
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.
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 added | Df | Deviance | Resid. Df | Resid. Dev | Pr(>Chi) |
|---|---|---|---|---|---|
| NULL | 1315 | 1561.634 | |||
| age | 1 | 23.321 | 1314 | 1538.314 | 1.4 × 10⁻⁶ *** |
| factor(ms) | 5 | 31.207 | 1309 | 1507.107 | 8.5 × 10⁻⁶ *** |
| smok | 1 | 19.669 | 1308 | 1487.438 | 9.2 × 10⁻⁶ *** |
| falc | 1 | 10.275 | 1307 | 1477.163 | 0.0013 ** |
| educ | 1 | 18.262 | 1306 | 1458.901 | 1.9 × 10⁻⁵ *** |
| factor(reg) | 3 | 31.016 | 1303 | 1427.885 | 8.4 × 10⁻⁷ *** |
| factor(ms):falc | 5 | 12.791 | 1298 | 1415.094 | 0.0254 * |
Final odds ratios
From the final model (model7, model6 with its terms reordered). Intervals use the model's covariance matrix.
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)
| Status | No family alcohol concern | Family alcohol concern |
|---|---|---|
| De facto | 2.218 (1.30, 3.80) | 0.374 (0.14, 1.01) |
| Divorced | 1.552 (0.73, 3.28) | 2.137 (0.75, 6.10) |
| Separated | 3.713 (1.82, 7.56) | 4.762 (1.09, 20.75) |
| Widowed | 1.629 (0.61, 4.37) | 2.954 (0.39, 22.21) |
| Never married | 1.154 (0.75, 1.79) | 1.298 (0.64, 2.64) |