Residual Plot, Remedies and Transformation
From residual pattern to defensible remedy
A residual is an observed response minus its fitted value. Plot residuals against fitted values, predictors, relevant groups, and observation order. The governing idea is to identify whether the remaining pattern concerns the average response or its spread, choose a targeted candidate remedy, and inspect a refitted model.
Read the pattern
A bend in average residuals across a predictor suggests curvature left in the conditional mean. A nonlinear mean term, such as a quadratic, may represent that relationship while retaining the original predictor.
When residual centers differ between groups at comparable predictor values, a group shift suggests adding a group predictor. Neither pattern proves its physical or causal source.
A widening cloud indicates nonconstant variance, even when the residual average stays near zero. For a strictly positive response whose spread grows roughly with its level, a log response may make variation more stable, provided that scale is scientifically meaningful.
Zeros and negative responses rule out an ordinary log of the recorded values. A fan alone does not establish that a log transform will work.
Worked example
Suppose two sensors measure the same quantity with reliable, independent error variances of 9 and 25 squared units, and the mean model is otherwise suitable.
In weighted least squares, an inverse-variance weight gives each observation weight proportional to the reciprocal of its error variance.
The weights 1/9 and 1/25 have ratio 25:9, so the more precise sensor receives greater weight. Multiplying every weight by the same constant leaves the fitted coefficients unchanged.
Check the remedy
After changing the mean rule or variance treatment, refit and replot residuals against the predictor, fitted values, group, and order as relevant. Look for remaining curvature, group offsets, or changes in spread rather than declaring success from the first plot.
If prediction is the goal, compare held-out error on a consistent response scale. A transformed model also needs careful interpretation on its transformed scale or a justified back-transformation.
Residuals from a suitable mean model have no curvature, but their spread increases with x. Independent measurement records give error variance 4 units² for low-x observations and 16 units² for high-x observations. Which weighted least-squares ratio of low-x to high-x weight follows inverse-variance weighting?
A model for recovery time uses age. Its residuals are centered near +6 days for one treatment group and −6 days for another at comparable ages, with similar spread. Which first change directly represents the observed group difference?