help for qfrplot7

Quantile plots of fitted and residuals

qfrplot7 [ , super reverse a(#) {normal|gaussian} graph_options ]


qfrplot7 plots quantile plots of fitted values, minus their mean, and residuals from the previous estimation command. Fitted values are whatever predict produces by default and residuals are whatever predict, res produces. Comparing the distributions gives an overview of their variability and some idea of their fine structure. By default plots are side-by-side.

The plot is restricted to the estimation sample.

This is the original of qfrplot for Stata 7, renamed qfrplot7. Users of Stata 8 upwards should upgrade to qfrplot.


A quantile plot shows ordered values versus the so-called plotting positions, or if the normal or gaussian option is specified, the corresponding quantiles of a standard normal (Gaussian) distribution. For n values ordered minimum first, the plotting positions are (i - a) / (n - 2a + 1) for i = 1, ..., n, where a is by default 0.5.

W.S. Cleveland in Visualizing data (Hobart Press, Summit, NJ, 1993) gives many side-by-side quantile plots of fit and residuals, which he calls "residual-fit spread plots". See example on p.41. However, he also uses this term for side-by-side time series plots of fit and residuals. See example on p.157. The command name and description here emphasise the use of a quantile plot.


super specifies that plots are to be superimposed, not side-by-side.

reverse reverses the sort order, so that ordered values are plotted against 1 - plotting position.

a(#) specifies a in the formula for plotting position. The default is a = 0.5, giving (i - 0.5) / n. Other choices include a = 0, giving i / (n + 1), and a = 1/3, giving (i - 1/3) / (n + 1/3). Rarely will choice of a make any discernible difference.

normal specifies that standard normal quantiles should be shown instead of plotting positions. gaussian is an exact synonym except that by default the text Gaussian will appear within the axis title, rather than normal.

graph_options are options of graph, twoway except for by(). Defaults include border gap(5). If symbol() is specified, the first symbol is used to plot fitted values and the second symbol to plot residuals. Otherwise, graph options refer to either or both graphs produced, except that saving() and title() refer to the combined graph image.


. use auto

. regress mpg weight

. qfrplot7

. glm mpg weight, link(log)

. qfrplot7

. qfrplot7, norm


Nicholas J. Cox, University of Durham, U.K. n.j.cox@durham.ac.uk

Also see

On-line: help for graph, quantile, qnorm, regdiag, regplot (if installed), anovaplot (if installed), ovfplot (if installed), indexplot (if installed)