QQ plots

QQ plots can be used to check the assumptions of normality. Let's try it out on the same old data:
> g <- lm(sav ~ p15 + p75 + inc + gro)
> motif()
> qqnorm(g$res)
> qqline(g$res)
Looks fine - qqline() adds a line joining the first and third quartiles - it's useful as a guide. We can plot the studentized residuals (assuming you still have the variable stud available).

> qqnorm(stud)
> abline(0,1)
Because these residuals have been normalized, they should lie along a 45 degree line.

We can get an idea of the variation to be expected in QQ-plots in the following experiment. I generate data from different distributions:

  1. Normal
  2. Lognormal - skewed
  3. Cauchy - long-tailed (platykurtic)
  4. Uniform - short-tailed (leptokurtic)
> par(mfrow=c(3,3))
> for(i in 1:9) qqnorm(rnorm(50))
> for(i in 1:9) qqnorm(exp(rnorm(50))) 
> for(i in 1:9) qqnorm(rcauchy(50))
> for(i in 1:9) qqnorm(runif(50))
> par(mfrow=c(1,1))