Residual-Fit Spread Plot

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram CDF Player or other Wolfram Language products.

Requires a Wolfram Notebook System

Edit on desktop, mobile and cloud with any Wolfram Language product.

The residual-fit spread (RFS) plot is illustrated using simple linear regression. In general, the purpose of the RFS plot is to provide a visualization of how well a statistical model fits the data. It provides a graphical alternative to the coefficient of determination.


In this Demonstration, a random sample of size is generated from a bivariate normal distribution with mean zero, unit variances, and correlation parameter . In the first graph, "data with LS line", the data and least-squares regression line are shown, as well as the estimated , the coefficient of determination. is the fraction of variability accounted for by the fitted model. Next, the RFS plot is shown. This plot is a trellis-style graphic with a quantile plot of the fitted values minus the mean in the left panel and a quantile plot of the residuals on the right. Grid lines that divide the plotting area into equally sized rectangles are shown to enhance the visual comparison of the panels.

The impact of randomness can be explored by changing the random seed.


Contributed by: Ian McLeod (March 2011)
Open content licensed under CC BY-NC-SA



The RFS plot and trellis-style graphics were introduced in [1] and [2]. The plot is a two-panel display of the quantile plot of the fitted values minus their mean, and of the residuals. The quantile plot for data is the plot of versus , where are other ordered values, . Many examples of the use of the quantile plot are discussed in [2] where its advantages over the histogram for data visualization are discussed.

[1] R. A. Becker, W. S. Cleveland, and M. Shyu, "The Visual Design and Control of Trellis Display," Journal of Computational and Graphical Statistics, 5(2), 1996 pp. 123–155.

[2] W. S. Cleveland, Visualizing Data, Summit, NJ: Hobart Press, 1993.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.