Statistics Quest

Residual diagnostics

Residual plots and standardised residuals check the linearity, independence, normality and equal-variance conditions behind regression inference.

ri=eiσ^1−hir_i = \frac{e_i}{\hat\sigma\sqrt{1-h_i}}
Internally studentised (standardised) residual
eie_i
raw residual yi−y^iy_i - \hat y_i
hih_i
leverage of observation i
σ^\hat\sigma
residual standard error
ti=rin−p−1n−p−ri2t_i = r_i\sqrt{\frac{n-p-1}{n-p-r_i^2}}
Externally studentised residual (observation i left out of σ̂)
tit_i
follows a t distribution with n − p − 1 df if the model holds
d=∑i=2n(ei−ei−1)2∑i=1nei2d = \frac{\sum_{i=2}^{n}(e_i - e_{i-1})^2}{\sum_{i=1}^{n} e_i^2}
Durbin–Watson statistic (rows in time order)
dd
near 2: no lag-1 autocorrelation; near 0: positive autocorrelation

When to use

After every regression fit, before interpreting p-values or intervals.

Assumptions checked (LINE)

  • Linearity: residuals vs fitted show no curve.
  • Independence: no pattern against time or collection order (Durbin–Watson for time-ordered rows).
  • Normality: Q–Q plot of residuals roughly straight (matters most for small n and for prediction intervals).
  • Equal variance: no funnel shape in residuals vs fitted (Breusch–Pagan gives a formal test).

How to interpret

  • A random horizontal band around 0 is what you want.
  • A curve suggests a missing term or a transformation; a funnel suggests transforming y or using methods for unequal variance.
  • Studentised residuals beyond about ±3 flag unusual observations; check them, do not delete them automatically.

Common mistakes

  • Checking normality of y instead of the residuals.
  • Relying on a normality test alone in large samples, where trivial departures are "significant".
  • Treating diagnostics as pass/fail rather than as evidence about how much to trust the results.

Example

y = 10, 12, 15, 18, 22, 27 at x = 0…5 fitted with a straight line gives R2=0.978R^2 = 0.978, but residuals 1.10, −0.28, −0.65, −1.02, −0.39, 1.24: positive at both ends, negative in the middle. The U shape reveals curvature that the high R2R^2 hides; a log transformation of y fixes it.