Residuals Examples in Statistics

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Residuals.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Statistics.

Concept Recap

A residual is the difference between an observed data value and the value predicted by a statistical model, calculated as \text{residual} = y_{\text{observed}} - y_{\text{predicted}}. Positive residuals mean the model underestimated; negative residuals mean it overestimated.

If your model predicts 80 but the actual value is 85, the residual is +5. Residuals are 'leftovers' - what the model couldn't explain. Patterns in residuals reveal model problems.

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: A residual is the error for one data point: actual value minus predicted value. Residuals should look random with no pattern if the model fits well.

Common stuck point: Students ignore the residual plot and only look at R-squared. A high R-squared with a curved residual pattern means the linear model is still inappropriate.

Sense of Study hint: When analyzing residuals, first compute each residual as e_i = y_i - \hat{y}_i for every data point. Then plot residuals against predicted values (or the x-variable). Finally, check for patterns: a random scatter means good fit, while curves or funnels mean the model needs improvement.

Worked Examples

Example 1

hard
A regression model predicts \hat{y} = 30 for a data point, but the actual value is y = 35. Calculate the residual and interpret it.

Solution

  1. 1
    Step 1: Residual = y - \hat{y} = 35 - 30 = 5.
  2. 2
    Step 2: A positive residual means the model underestimated โ€” the actual value is 5 units above the predicted value.
  3. 3
    Step 3: The data point lies above the regression line.

Answer

Residual = 5. The model underestimated by 5 units.
Residuals measure the vertical distance between observed values and the regression line. Positive residuals indicate the point is above the line; negative residuals indicate it is below.

Example 2

hard
A residual plot shows a clear U-shaped pattern. What does this indicate about the regression model?

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

hard
Given \hat{y} = 20 + 4x and actual data points (2, 30), (3, 33), (4, 35), find the residual for each point.

Example 2

hard
A model predicts values 18, 22, and 26 for three points, while the actual values are 20, 21, and 30. Find the residuals and identify which point has the largest underprediction.

Related Concepts

Background Knowledge

These ideas may be useful before you work through the harder examples.

linear regressionprediction