Density plot, normal probability plot, and normal quantile plot

A density plot is a graph of the residuals with a normal distribution curve superimposed. It can be used to check whether the normality assumption holds. In Stata, kdensity (k=kernel) can be used to generate the density plot.

More information
help kdensity

The normal probability plot (pnorm) constitutes another a way of testing whether the residuals are normally distributed. Compared to the normal quantile plot, it is more sensitive to anomalies in the middle of the distribution.

More information
help pnorm

Yet another alternative for checking the normality assumption is the normal quantile plot (qnorm). Compared to the normal probability plot, it is more sensitive to anomalies in the tails of the distribution.

More information
help qnorm

Practical example

The first step is re-run the multiple linear regression model. The quietly option is included in the beginning of the command to suppress the output.

quietly reg gpa cognitive bullied ib1.skipped if pop_linear==1

Then we have to save the residuals from the model by creating a new variable, here called res, using the predict command.

predict res, resid

The next step is to produce the density plot (the option “normal” means that we include a normal distribution curve in the graph).

kdensity res, normal

In this example, the residuals seem to be pretty normally distributed (apart from the small dip at the top of the peak).

Now we will generate a normal probability plot. We can re-use the variable res for this.

pnorm res

A straight, diagonal line like this means that the residuals are normally distributed.

The final step is to create the normal quantile plot.

qnorm res

This plot too looks good. Deviation at the tails is almost inevitable – it is more problematic if the points are distributed in a wider s-shaped pattern and deviate from the diagonal over the whole range of values.