Module 10 Activity
Scenario
Model a binary outcome and report it in probabilities a reader can use.
What you build
A logistic regression with odds ratios, predicted probabilities and a justified threshold.
Steps
- Confirm the outcome is binary and check what a linear model would predict at the extremes of your predictor.
- Fit with
glm(..., family = binomial)and verify the output reports deviance rather than a residual standard error. - Report odds ratios with intervals, label them as odds ratios, and give the baseline rate.
- Produce a table of predicted probabilities at meaningful predictor values, with intervals computed on the link scale.
- Report the confusion matrix against the majority-class baseline, and say how many positives were caught.
- Check calibration by binning predictions against observed rates, then choose a threshold from the relative cost of misses and false alarms.
Evidence to hand in
- What a linear model predicted, and where it went out of range.
- The fitted model with its deviance.
- The odds-ratio table with the baseline rate.
- The predicted-probability table with intervals.
- The confusion matrix against the majority baseline.
- The calibration check and your threshold justification.
Review checklist
family = binomialis present.- Odds ratios are labelled as such and the baseline rate is given.
- Predicted-probability intervals were built on the link scale.
- Accuracy is compared to the majority-class rate, not to 50%.
- The threshold is justified by costs, not left at 0.5 by default.
