'Importance' of the curvature
Scatterplots of residuals against X and Z are useful ways to detect whether a nonlinear function of X or Z should be used in the regression model. But what transformation of X or Z should be used in the model?
The residual plots do not suggest the nature of the curvature or show its importance, relative to the linear relationship.
To help show the nature of the curvature for each variable, partial residual plots (also called a component plus residual plots) are often used. The partial residual plot for X simply adds the linear function of X back onto the residual before plotting against X.
plot (b1xi + ei) against xi
A partial residual plot for Z is similar:
plot (b2zi + ei) against zi
Note that ordinary residual plots should be used to detect whether there is any curvature. Only use partial residual plots after you have discovered that there is some curvature.
(Using a similar definition for simple linear regression with only a single explanatory variable, X, the partial residual plot would be simply a plot of Y against X.)
Artificial illustration
The diagram below again shows the artificial data set from the previous page in which the residual plots indicated nonlinearity in the relationship of Y with Z.
Select Component plus residual from the pop-up menu on the top to display the partial residual plot for X. This simply adds back the linear trend in X.
Repeat for the variable Z.
The partial residual plot suggests that the relationship of Y with Z is flatter at low z-values.
Display a partial residual plot for Z on the right, then click the y-z rotation button to rotate the 3-dimensional scatterplot to plot Y against Z. Now click Rotate to Comp+Resid. The resulting rotation of the 3-dimensional scatterplot removes the linear trend in X and is identical to the partial residual plot on the right.