Normal quantile plots

A histogram can be used to assess normality, but not all symmetric and bell-shaped histograms are normal. An easier tool to use is the normal quantile plot, or just normal plot for short. Here is how it works.

Suppose the vector is called x. Then type

qqnorm(x)

To obtain the normal quantile plot and type

qqline(x)

to add a line to the plot.

Normally distributed data should lead to a fairly straight plot, so the added line helps judge the straightness of the qqplot. The advantage this plot has over a histogram for judging normality is that it is easier to judge linearity or lack of it than to judge adherence to the normal pdf.

Here is a function you can cut-and-paste into R to perform both qqnorm() and qqline() in one step:

qqboth <- function(x, ...)
{
qqnorm(x,...)
qqline(x)
}

A little illustration

Generate a random vector from a normal distribution and apply qqboth() to the vector. Do this several times to get a feeling for the variability in the pictures. The following code does 9 samples of size 100 from a standard normal distribution, each time running the data through qqboth .

par(mfrow=c(3,3))
replicate(9, qqboth(rnorm(100)))

You might re-do it with different sample sizes to get a feel for the effects of sample size on variability in the normal plot.


par(mfrow=c(3,3))
replicate(9, qqboth(rnorm(20)))

Now apply qqboth to some non-normal data, such as exponential:


par(mfrow=c(3,3))
replicate(9, qqboth(rexp(100)))

... or a t distribution with 5 degrees of freedom:

par(mfrow=c(3,3))
replicate(9, qqboth(rt(100,5)))

... or a uniform distribution:

par(mfrow=c(3,3))
replicate(9, qqboth(runif(100)))