AI summary by TwinMind
Deviance Residuals
StatQuest with Josh Starmer
6m 18s
Introduction and Prerequisites
- Josh Starmer presenting StatQuest educational video on deviance residuals
- Follows up on previous videos: saturated models and deviance statistics
- Must watch prerequisite videos first for proper understanding
Residual Deviance Definition
- Residual deviance = 2 × (log likelihood of saturated model - log likelihood of proposed model)
- Calculated using likelihood multiplication across all data points
- Log likelihood = log of the likelihood function
- Example uses 3 data points but extends to any number of data points
Mathematical Breakdown
- Likelihood of saturated model = likelihood of data point 1 × data point 2 × data point 3
- Likelihood of proposed model = same multiplication structure
- Log likelihoods plugged into deviance equation
- Difference calculated for each individual data point contribution
Deviance Residuals Calculation
- Deviance residuals = square roots of individual terms in residual deviance equation
- Each residual represents square root of contribution each data point makes to overall residual deviance
- First deviance residual = √(difference in log likelihoods for first data point)
- Second deviance residual = √(difference in log likelihoods for second data point)
- Third deviance residual = √(difference in log likelihoods for third data point)
Relationship to Overall Deviance
- Squaring individual deviance residuals and summing = residual deviance
- Analogous to ordinary least squares residuals
- When squared, ordinary residuals give sums of squares for model fit assessment
- When squared, deviance residuals give residual deviance for model fit assessment
Logistic Regression Application
- Deviance residuals rewritten based on distances between data and best fitting line
- Blue residuals (above squiggly line) = positive values
- Red residuals (below squiggly line) = negative values
- Sign convention helps identify outliers when plotted on XY graph
- Should be centered and relatively close to zero
Outlier Detection Examples
- First deviance residual: close to zero (squiggly line very close to data point)
- Second deviance residual: far from zero (poor fit)
- Third through sixth deviance residuals: varying distances from zero
- Second and fifth residuals relatively far from zero = potential outliers
- Recommendation: verify original data labeling for suspected outliers
