Why Put Residuals Against Normal Quantiles?
A residual-versus-fitted plot and a residual-versus-predictor plot arrange residuals according to fitted values or predictor values. A normal quantile plot arranges them by rank instead. It pairs the smallest residual with the smallest theoretical normal quantile, the next-smallest with the next quantile, and so on. This gives a visual comparison between the ordered residuals and the pattern expected from a normal distribution.
The construction is useful only when its reference is clear. A straight reference line is not the fitted regression line: it is a guide to the location and scale that the ordered residuals would have if their distribution were approximately normal. This tutorial focuses on making that plot and calculating that guide.
The normal quantile plot is one diagnostic, not a way to check every model condition. For example, the plot's construction does not establish independence, constant error variance, or an adequate mean form. Those conditions require other information and diagnostics. Also, fitted residuals are constrained by the fitting process and need not behave like independent draws from a normal distribution. The line is therefore a useful reference, not a claim that residuals have an exact normal distribution.
Definition and Plotting Positions
The index \(i\) runs from 1 to \(n\). Sorting the residuals is essential: \(e_{(1)}\) is the smallest residual and \(e_{(n)}\) is the largest. The plotting position \(p_i\) locates each rank within the probability scale from 0 to 1, and the corresponding \(q_i\) is the standard normal value with cumulative probability \(p_i\). The chosen formula keeps positions strictly between 0 and 1, so each quantile is finite. Software may use slightly different plotting-position formulas; the method should be stated when numerical results are reported.
The residuals and quantiles have different units. A theoretical standard normal quantile is dimensionless; a raw residual has the units of the response. Accordingly, any reference-line slope for raw residuals has response units per standard-normal-quantile unit.
What the Reference Line Represents
If values came from a normal distribution with location \(\mu\) and standard deviation \(\sigma\), its population quantile at probability \(p\) would be \(\mu+\sigma\Phi^{-1}(p)\). This follows by standardizing a value \(y\): the corresponding standard normal value is \(z=(y-\mu)/\sigma\), so rearranging gives \(y=\mu+\sigma z\). Thus, plotting normal quantiles horizontally and data quantiles vertically should produce an approximately straight relationship, with intercept \(\mu\) and slope \(\sigma\).
For regression residuals under a correctly specified normal-error model, the intended location is 0 and the error standard deviation is \(\sigma\). In an idealized population comparison, the reference line is therefore \(e=\sigma q\). In an actual sample, the residuals' ordered values will not lie exactly on such a line. A practical reference line estimates its position and slope from the plotted points. Two common choices are a least-squares line through all the plotted points and a line determined by the first and third quartiles. They can differ slightly, especially in small samples.
Worked Example: Assigning Quantiles and Fitting a Line
Suppose a hypothetical model for time to complete a task produces five residuals, in days: \(-1.2,-0.5,-0.2,0.4,1.5\). The values are already ordered. Use \(p_i=(i-0.5)/n\), and calculate the least-squares reference line.
Here \(n=5\), so the plotting positions are \(0.1,0.3,0.5,0.7,0.9\). The corresponding standard normal quantiles, rounded to three decimals, are \(-1.282,-0.524,0,0.524,1.282\). The five plot points are therefore \((-1.282,-1.2),(-0.524,-0.5),(0,-0.2),(0.524,0.4),(1.282,1.5)\), with the first coordinate in standard-normal-quantile units and the second in days.
For a least-squares line predicting ordered residual \(e_{(i)}\) from quantile \(q_i\), the slope is \(b=\sum(q_i-\bar{q})(e_{(i)}-\bar{e})/\sum(q_i-\bar{q})^2\), and the intercept is \(a=\bar{e}-b\bar{q}\). The displayed quantiles are symmetric, so \(\bar{q}=0\). The residuals sum to zero, so \(\bar{e}=0\). Substituting the displayed values gives:
Thus \(a=0-1.025(0)=0\), and the reference line is approximately \(e=1.025q\), with \(e\) in days. Its slope has units of days per standard-normal-quantile unit. This calculation uses the rounded quantiles shown in the table; using more precise quantiles gives the same slope to three decimal places.
Two Ways to Draw a Reference Line
A least-squares reference line uses every plotted point and minimizes the sum of squared vertical distances from the points to the line. Its formulas are those used in the example: \(b=\sum(q_i-\bar{q})(e_{(i)}-\bar{e})/\sum(q_i-\bar{q})^2\) and \(a=\bar{e}-b\bar{q}\). This method gives a reproducible calculation, but extreme points can influence the fitted line because their distances are squared.
A quartile-based line instead matches the first and third quartiles of the residuals to the 25th and 75th percentiles of a standard normal distribution. Let \(Q_1\) and \(Q_3\) be the residual quartiles. Since the standard normal quartiles are approximately \(-0.6745\) and \(0.6745\), respectively, the line has slope \((Q_3-Q_1)/(0.6745-(-0.6745))\) and intercept \(Q_1-b(-0.6745)\). The quartile convention used to obtain \(Q_1\) and \(Q_3\) should be stated, because software and textbooks may calculate sample quartiles differently.
Worked Example: Calculating a Quartile-Based Line
A second hypothetical model has seven ordered residuals, in millimetres: \(-2.0,-1.1,-0.6,-0.1,0.3,1.0,2.5\). Use the median-of-halves convention: with an odd sample size, exclude the overall median when finding the lower- and upper-half medians.
The overall median is the fourth value, \(-0.1\). The lower half is \(-2.0,-1.1,-0.6\), so \(Q_1=-1.1\) mm. The upper half is \(0.3,1.0,2.5\), so \(Q_3=1.0\) mm. Using standard normal quartiles \(-0.6745\) and \(0.6745\), the slope is:
The intercept is \(a=Q_1-b(-0.6745)\), so \(a=-1.1-(1.557)(-0.6745)\approx -0.050\) mm. The quartile-based line is therefore approximately \(e=-0.050+1.557q\), with residuals measured in millimetres. It passes through the plotted first and third quartiles by construction; it need not pass through every residual point.
Constructing the Plot Step by Step
For each observation, calculate \(e_i=y_i-\hat{y}_i\). Retain the response's units, such as days, millimetres, or dollars.
Write them as \(e_{(1)}\leq e_{(2)}\leq\cdots\leq e_{(n)}\). If values are tied, each occurrence appears at its own rank.
For each rank \(i\), calculate \(p_i=(i-0.5)/n\), then find \(q_i=\Phi^{-1}(p_i)\).
Plot \((q_i,e_{(i)})\), label both axes with units or scale, and calculate the stated line method if a reference line is wanted.
Worked Example: Building the Plot From Observed and Fitted Values
For six hypothetical measurements in millimetres, suppose observed values are \(12,10,14,11,15,13\), and the corresponding fitted values are \(11,11,13,12,14,14\). Assume the observations are independent by the data-collection design; other diagnostics are used to assess mean form and spread. Calculate the residuals, order them, and assign the normal quantiles.
Subtract fitted from observed in the original order: \(12-11=1\), \(10-11=-1\), \(14-13=1\), \(11-12=-1\), \(15-14=1\), and \(13-14=-1\) mm. The ordered residuals are \(-1,-1,-1,1,1,1\) mm. The equal values remain separate because they belong to separate observations.
With \(n=6\), the plotting positions are \(0.5/6,1.5/6,2.5/6,3.5/6,4.5/6,5.5/6\), or approximately \(0.0833,0.2500,0.4167,0.5833,0.7500,0.9167\). Their standard normal quantiles, rounded to three decimals, are approximately \(-1.383,-0.674,-0.210,0.210,0.674,1.383\). The plot contains the following ordered pairs:
The horizontal coordinates are dimensionless standard normal quantiles; the vertical coordinates are residuals in millimetres. For example, the fourth point means that the residual at rank four, \(1\) mm, is paired with theoretical quantile \(0.210\). The table of pairs is sufficient to construct the plot, whether it is drawn by hand or by software.
Common Mistakes and Why the Details Matter
- Plotting residuals in observation order. A normal quantile plot pairs ranks with normal quantiles, so residuals must first be sorted. Keeping their original order would not make the required pairing.
- Switching the axes without explanation. The convention here places theoretical normal quantiles on the horizontal axis and ordered residuals on the vertical axis. Reversing the axes changes the reported slope and its units.
- Confusing the reference line with the regression fit. The regression model predicts the response from predictors. The normal-plot reference line relates residual values to theoretical normal quantiles.
- Assuming all reference lines are identical. A least-squares line and a quartile-based line use different calculations and can differ. State which method is used rather than treating one exact line as universal.
- Calling the plotted residuals normal errors. Residuals are calculated from observed responses and fitted values, while errors are unobserved. The plot compares residuals with a normal reference; it does not reveal the errors directly.
Construction choices matter because a plot is only interpretable when the rankings, probability positions, axis orientation, and reference line are clear. Keep the plotting-position and quartile conventions consistent when reproducing a plot or comparing plots. The resulting visual display then provides a well-defined comparison to a normal location-and-scale pattern, without implying that every model condition has been checked.
Check Your Understanding
Answer each question using the conventions defined in this tutorial.
- For \(n=8\), what plotting position is assigned to the fifth-smallest residual using \(p_i=(i-0.5)/n\)?
- Why are residuals sorted before they are paired with theoretical normal quantiles?
- In a plot of theoretical quantiles on the horizontal axis and raw residuals on the vertical axis, what units does the reference-line slope have?
- State the difference between a least-squares reference line and a quartile-based reference line.
- Why should a normal quantile plot of residuals not be described as a direct plot of the model errors?