Course contentsShow
← Data Science
Lesson 543 of 2,14514. Simple Linear RegressionFree lesson

Residuals as Unexplained Variation

Understand residuals represent variation in Y not explained by the linear relationship with X.

Residuals as Unexplained Variation

What you'll learn: You'll understand how residuals quantify the portion of your outcome variable that your linear model cannot explain.

The Core Idea

When you fit a linear regression line through your data, it captures the systematic relationship between X and Y. But rarely does every point fall perfectly on that line. The residuals—those vertical distances from each point to the fitted line—represent what's left over: the variation in Y that your X variable doesn't explain.

Think of it this way: if your regression line is a "signal" that explains patterns in the data, residuals are the "noise" that remains. They're the unexplained, leftover variation.

Why This Matters

Every data point has a story:

  • Fitted value (ŷ): "Here's what the model predicts based on the linear relationship"
  • Residual (e): "Here's how much the actual value differs from that prediction"

Large residuals mean your linear model missed something important for those observations. Small residuals mean the model captures most of the variation. When you calculate R-squared, you're essentially measuring what proportion of Y's total variation is explained by the model—and residuals represent the complement: the unexplained portion.

If residuals are large and systematic (not random), your linear model may be missing key relationships, suggesting you need a better model or additional predictors.

Key Insight

Residuals aren't just errors—they're a diagnostic tool revealing how much variation your model leaves unexplained. Small, random residuals indicate a good fit; large or patterned residuals suggest your straight-line model isn't capturing the full story.

Key Takeaway: Residuals quantify the unexplained variation in Y after accounting for the linear relationship with X—they're the gap between what your model predicts and what you actually observe.