Residuals


This scatter plot shows the relationship between the weight of a car and its gas mileage.

Click on an individual point to see calculations of its residual.

The residual of a point is the difference between its Y variable and the predicted value of that Y based on the regression.


Developed by Michael Whitlock at the University of British Columbia. Look here for more apps. This web-page and its code is released on a Creative Commons Zero agreement, meaning that it is freely available for use, re-use, and modification. We request that you give credit, when possible. This work is in the public domain.




The new plot on the bottom is called a residual plot.The residual plot has the explanatory variable on the horizontal axis and the residuals on the vertical axis. It is useful for seeing patterns in the residuals that violate the assumptions of regression.

Click on a point in the top graph. It will highlight the residual for that point in both the scatterplot and in the residual plot. Each individual data point is present once in each plot.

This residual plot shows that these data should be fine for a linear regression. The residuals are approximately normally distributed around 0 with equal variance for all values of the explanatory variable.





These data show the relationship between log body mass and brain mass of some mammal species.

These data do not fit the assumptions of linear regression well. The relationship does not seem to follow a line, and there is much more variance in brain mass for large values of log body mass.

This residual plot shows these deviations from the assumptions of linear regression well.

Click on the 4th tab to see what these data look like when the brain mass variable is log transformed.





With the log transformation of brain mass, the data fit the assumptions of linear regression much better than the untransformed data.

The residuals look to be normally distributed with approximately the same variance for all values of the explanatory variable.