Course contentsShow
← Data Science
Lesson 561 of 2,14515. Regression DiagnosticsFree lesson

Residuals vs Predictor Plots

Plotting residuals against individual predictors to identify non-linear relationships or missing interactions.

Residuals vs Predictor Plots

What you'll learn: How plotting residuals against your predictor variable helps you spot non-linear patterns and uncover relationships your linear model might be missing.


Why Plot Residuals Against the Predictor?

You've already seen the residuals vs fitted values plot, which gives you an overall health check. But when you plot residuals against the original predictor variable (X) itself, you get a more direct view of whether the relationship between X and Y is truly linear—or whether something more complex is going on.

If your linear model is appropriate, residuals should scatter randomly around zero across all values of X. No patterns, no curves, no trends.

What to Look For

Non-Linearity

If you see a curved pattern (like a U-shape or inverted U), your predictor has a non-linear relationship with the outcome. Your straight-line model is systematically missing the curve. This suggests you might need polynomial terms (like X²) or transformations (like log(X)).

Missing Interactions

When you have multiple predictors (even though we're in simple regression territory now), if residuals show different patterns at different X values, it could hint that X's effect depends on another variable—an interaction you haven't modeled yet.

Heteroscedasticity

Just like in the fitted values plot, if the spread of residuals changes as X increases, you've got non-constant variance tied specifically to that predictor.

The Detective Work

Think of this plot as zooming in with a magnifying glass. Instead of looking at overall predictions, you're asking: "Does this specific variable have a relationship with my errors?" If yes, you're leaving information on the table.

Key Takeaway: Residuals vs predictor plots reveal whether your straight-line assumption holds for each X variable and help diagnose non-linearity or missing complexity before they sabotage your model's validity.