Why Look at an Adjusted Relationship?
In multiple regression, a predictor’s relationship with the outcome is assessed while other terms in the model are also present. A plot of ordinary residuals against one predictor can be useful, but it does not display the fitted linear contribution of that predictor. A component-plus-residual plot includes that contribution along with the residual, making it easier to inspect whether the predictor’s adjusted relationship might be curved.
The plot is a diagnostic, not a substitute for fitting a model or a formal test. Its central question is specific: after accounting for the other fitted terms, does the relationship associated with this predictor look adequately linear? The answer is visual evidence to consider alongside the model, the data, and other diagnostics.
Definition and Construction
Start with an additive multiple regression model containing an intercept and \(p\) predictors:
Here \(Y_i\) is the outcome for observation \(i\), \(x_{ij}\) is the value of predictor \(j\), and \(\varepsilon_i\) is the model error. The fitted model estimates the coefficients by least squares. Its fitted value is \(\hat{y}_i\), and its residual is \(e_i=y_i-\hat{y}_i\). To make the usual conditional-mean interpretation, the model assumes that the other terms are adequately specified and that the errors have mean zero conditional on the predictors. Independence and constant error variance matter for many inferential procedures, but are not required simply to calculate the plotted values.
The point can also be written by substituting the residual definition:
Thus, the vertical coordinate is the observed outcome after subtracting the fitted intercept and the fitted contributions of the other predictors. The predictor being examined is not subtracted; its fitted contribution is retained. The plotted values are not raw outcomes, nor are they ordinary residuals.
Worked Example: Calculating Component-Plus-Residual Values
Suppose a hypothetical data set produces the fitted model \(\hat{y}=10+2x+3z\), where the target predictor \(x\) and the other predictor \(z\) are both quantitative. The table gives four observations.
| Observation | \(x\) | \(z\) | \(y\) | \(\hat{y}=10+2x+3z\) | \(e=y-\hat{y}\) | \(e+2x\) |
|---|---|---|---|---|---|---|
| 1 | 0 | 0 | 11 | 10 | 1 | 1 |
| 2 | 0 | 1 | 12 | 13 | -1 | -1 |
| 3 | 1 | 0 | 11 | 12 | -1 | 1 |
| 4 | 1 | 1 | 16 | 15 | 1 | 3 |
For observation 4, the fitted value is \(10+2(1)+3(1)=15\), so the residual is \(16-15=1\). Its component-plus-residual value for \(x\) is \(1+2(1)=3\). Equivalently, subtract the fitted intercept and the fitted contribution of \(z\) from the observed outcome: \(16-10-3(1)=3\).
The four plotted points are \((0,1)\), \((0,-1)\), \((1,1)\), and \((1,3)\). The vertical coordinates retain the fitted \(x\) contribution while removing the fitted contribution of \(z\). With only four points and two distinct \(x\) values, this example does not establish whether a curve is present; it demonstrates the calculation.
Reading the Shape
Under the additive model, if the conditional mean is correctly specified as linear in \(x_j\), the expected component-plus-residual value changes linearly with \(x_j\), with slope \(\beta_j\). A smooth curve drawn through the points can be compared with a straight-line trend. Systematic bending in the smooth may indicate that the linear form for this predictor is inadequate after accounting for the other included terms.
The plot does not guarantee that a bend is caused by curvature in this predictor alone. The calculation removes the other predictors’ fitted contributions; it cannot correct an incorrectly specified effect of another predictor. A pattern can also be affected by unusual observations or by sparse data in parts of the predictor range. Interpret the shape as evidence to investigate, not as proof of a particular model change.
Unlike an ordinary residual-versus-predictor plot, the component-plus-residual plot includes \(\hat{\beta}_j x_{ij}\) on its vertical axis. The two plots answer related but different visual questions. Because the component is added back, a clear positive or negative linear trend is expected in a component-plus-residual plot when the estimated slope is not near zero. The diagnostic interest is whether the smooth departs systematically from a straight-line pattern, not whether the plotted values have zero slope.
\(E(Y_i-\beta_0-\sum_{k\ne j}\beta_kx_{ik}\mid x_{i1},\ldots,x_{ip})=\beta_jx_{ij}\).
This follows by substituting the conditional mean and cancelling \(\beta_0\) and each term with \(k\ne j\). The fitted component-plus-residual values use estimated rather than population coefficients, so in real data they are an approximate diagnostic for this adjusted linear pattern.
Worked Example: Spotting Possible Conditional Curvature
In a hypothetical analysis, the fitted model is \(\hat{y}=20+1.2x+0.5z\). Here \(x\) is a treatment-intensity measure and \(z\) is a baseline score. The model includes a linear term for each predictor but no curved term for \(x\). For illustration, assume the listed residuals are the OLS residuals from this fit.
| \(x\) | \(z\) | Fitted value | Residual \(e\) | Component-plus-residual \(e+1.2x\) |
|---|---|---|---|---|
| -2 | 0 | 17.6 | 0.9 | -1.5 |
| -2 | 4 | 19.6 | 0.9 | -1.5 |
| -1 | 0 | 18.8 | -0.9 | -2.1 |
| -1 | 4 | 20.8 | -0.9 | -2.1 |
| 1 | 0 | 21.2 | -0.9 | 0.3 |
| 1 | 4 | 23.2 | -0.9 | 0.3 |
| 2 | 0 | 22.4 | 0.9 | 3.3 |
| 2 | 4 | 24.4 | 0.9 | 3.3 |
For \(x=-2,z=4\), the fitted value is \(20+1.2(-2)+0.5(4)=19.6\). The component-plus-residual value is \(0.9+1.2(-2)=-1.5\). The same calculation at \(x=-1\) gives \(-0.9+1.2(-1)=-2.1\). At \(x=1\) it gives \(-0.9+1.2=0.3\), and at \(x=2\) it gives \(0.9+2.4=3.3\).
The values dip from \(x=-2\) to \(x=-1\), then rise at \(x=1\) and \(x=2\). A smooth through these points would suggest a bend rather than a simple straight-line trend, so curvature in the adjusted relationship with \(x\) is worth investigating. The pattern is the same at both displayed \(z\) values, which makes it less likely to be merely a difference between those two groups. Still, the plot alone does not identify a cause or determine which alternative model is appropriate.
Interactions Change the Interpretation
The basic definition is clearest when the predictor has an additive linear contribution. If a model contains an interaction, the slope for a predictor can depend on another predictor. For example, in a model with \(x\), \(z\), and \(xz\), the conditional slope for \(x\) at a given value of \(z\) is \(\beta_x+\beta_{xz}z\). A single component-plus-residual plot using only \(e_i+\hat{\beta}_x x_i\) does not display that varying slope as one simple adjusted relationship.
In this setting, interpret the target relationship at relevant values or strata of the interacting predictor. At a fixed \(z=z_0\), the \(x\) component is \((\hat{\beta}_x+\hat{\beta}_{xz}z_0)x\); other model terms must be handled consistently with that conditioning. This prevents a pooled curve from being mistaken for a single conditional relationship when the model itself specifies different slopes.
Worked Example: A Predictor Whose Slope Depends on Another Predictor
Suppose a hypothetical fitted model is \(\hat{y}=8+1.1x+0.7z+0.4xz\). The fitted slope for \(x\) is \(1.1+0.4z\). At \(z=2\), it is \(1.1+0.4(2)=1.9\) outcome units per unit of \(x\). At \(z=5\), it is \(1.1+0.4(5)=3.1\) outcome units per unit of \(x\). Thus a single common slope for \(x\) would not describe both conditions.
For one observation with \(x=4\), \(z=2\), and observed \(y=18\), the fitted value is \(8+1.1(4)+0.7(2)+0.4(4)(2)=17\), so \(e=18-17=1\). The ordinary component-plus-residual value using only the \(x\) main-effect coefficient is \(e+1.1x=1+1.1(4)=5.4\). It omits the interaction’s contribution to the \(x\) slope.
For a plot specifically conditional on \(z=2\), use the conditional \(x\) component: \(e+(1.1+0.4(2))x=1+1.9(4)=8.6\). This also equals \(y-8-0.7(2)=18-8-1.4=8.6\). A conditional plot at \(z=5\) would use the slope \(3.1\) instead. The correct display depends on the conditional relationship being examined.
Practical Reading and Common Pitfalls
A disciplined reading starts with the fitted model and the exact predictor term being inspected. Then check the point pattern and its smooth against a straight-line trend, while noting whether observations are concentrated in particular predictor ranges. If a few observations appear to drive the bend, examine them using the influence diagnostics already introduced; do not automatically remove a valid observation merely because it changes the pattern.
- Mistake: expecting a flat plot. That expectation belongs to ordinary residuals under a well-specified mean model. A component-plus-residual plot includes the fitted predictor contribution, so a linear trend is expected.
- Mistake: reading a bend as proof of causation. A bend is diagnostic evidence of possible mean-structure inadequacy, not evidence that changing the predictor causes the outcome to curve.
- Mistake: treating the adjustment as perfect. The plot subtracts other terms as fitted. If one of those effects is misspecified, it can leave a pattern that appears associated with the target predictor.
- Mistake: ignoring an interaction. When a slope varies with another predictor, a pooled plot may conceal or combine distinct conditional relationships.
A component-plus-residual plot is most informative when there is adequate data across the predictor’s range and no single extreme point determines the smooth. It helps translate a multiple regression fit into a focused diagnostic view: what does the adjusted relationship for this predictor look like, and is the assumed linear form plausible?
Check Your Understanding
Answer each question using the definitions and reasoning in this tutorial.
- In an additive model, a case has residual \(e_i=-0.6\), \(x_{ij}=3\), and \(\hat{\beta}_j=0.8\). What is its component-plus-residual value?
- Explain why a component-plus-residual plot is not expected to be flat when the fitted coefficient for the predictor is nonzero.
- What kind of pattern in a smooth through the plotted points would suggest that a linear term may be inadequate?
- Why does subtracting the other predictors’ fitted contributions not guarantee that a detected bend belongs only to the predictor on the horizontal axis?
- In a model containing an interaction between \(x\) and \(z\), what is the fitted slope for \(x\), and why should the plot’s interpretation specify a value or stratum of \(z\)?