Residuals Examples in Math

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 Math.

Concept Recap

The difference between an observed value and its predicted value from a regression model: residual=yโˆ’y^\text{residual} = y - \hat{y} (observed minus predicted).

A residual is how much the model got wrong for a specific data point. Positive residual means the actual value was higher than predicted; negative means it was lower. If you plot all residuals, the pattern (or lack thereof) tells you whether the model is appropriate.

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 how far one data point falls above or below the regression line: e=yโˆ’y^e=y-\hat{y}.

Common stuck point: The procedure for residuals is the easy part; the trap is computing predicted minus observed. Asking "Am I taking one point's actual value minus the line's predicted value to measure its individual miss?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Am I taking one point's actual value minus the line's predicted value to measure its individual miss?

Worked Examples

Example 1

easy
Given y^=2+3x\hat{y} = 2 + 3x, and observed point (4,15)(4, 15): calculate the residual and interpret whether the model over- or under-predicts.

Answer

e=15โˆ’14=1e = 15 - 14 = 1 (positive). The model under-predicts by 1 unit.

First step

1
Calculate predicted value: y^=2+3(4)=2+12=14\hat{y} = 2 + 3(4) = 2 + 12 = 14

Full solution

  1. 2
    Calculate residual: e=yโˆ’y^=15โˆ’14=1e = y - \hat{y} = 15 - 14 = 1
  2. 3
    Positive residual: actual value (15) is ABOVE the predicted value (14)
  3. 4
    Interpretation: the model under-predicts by 1 unit for this observation
A residual e=yโˆ’y^e = y - \hat{y} measures the vertical distance between observed and predicted. Positive residual = point above the line (model under-predicts); negative residual = point below the line (model over-predicts). Residuals should average to zero for a good model.

Example 2

medium
Five observed and predicted values: (y,y^)(y, \hat{y}): (10,8),(15,14),(12,13),(20,19),(8,11)(10,8), (15,14), (12,13), (20,19), (8,11). Calculate all residuals, verify they sum to 0, and compute โˆ‘ei2\sum e_i^2.

Example 3

medium
Data: (1,3),(2,5),(3,4),(4,8)(1, 3), (2, 5), (3, 4), (4, 8). Fitted line: y^=1.5x+1.5\hat{y} = 1.5x + 1.5. Compute all residuals.

Example 4

medium
Define standardized residuals and explain why they help identify outliers.

Example 5

hard
Given a residual of 55 at x=3x = 3 where y^=2+4x\hat{y} = 2 + 4x, find yy. Then determine the residual if the line had been y^=2+5x\hat{y} = 2 + 5x instead.

Example 6

hard
Two students fit different lines to the same data. Student A reports residuals summing to 00; Student B reports residuals summing to 55. Whose line could be the LSRL?

Example 7

hard
A residual plot shows one residual much larger than the others. What is this point called and how should it be handled?

Practice Problems

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

Example 1

easy
A regression model gives residuals: {3,โˆ’2,4,โˆ’5,0}\{3, -2, 4, -5, 0\}. Are these residuals consistent with a valid LSRL? Calculate โˆ‘ei\sum e_i and โˆ‘ei2\sum e_i^2.

Example 2

hard
A residual plot shows residuals increasing in magnitude as y^\hat{y} increases (fan shape). What assumption is violated, and what does this mean for the validity of hypothesis tests in regression?

Example 3

easy
A model predicts 5050 but the observed value is 4747. Compute the residual.

Example 4

easy
Observed =20= 20, predicted =14= 14. Find the residual.

Example 5

easy
A residual is 00. What does that mean about the data point?

Example 6

easy
Using y^=2+3x\hat{y} = 2 + 3x, find the residual for the point (4,15)(4, 15).

Example 7

easy
A positive residual means the observed value is above or below the prediction?

Example 8

easy
What is the sum of all residuals from a least-squares regression line?

Example 9

easy
A residual plot shows points scattered randomly around 00 with no pattern. Does this support the linear model?

Example 10

easy
A residual plot shows a clear U-shaped curve. What does this suggest about the linear model?

Example 11

medium
For y^=10โˆ’2x\hat{y} = 10 - 2x, find the residual at the point (3,2)(3, 2).

Example 12

medium
Three points have residuals 44, โˆ’1-1, and r3r_3. If LSRL residuals must sum to 00, find r3r_3.

Example 13

medium
A data point has the largest absolute residual in a dataset. What is such a point called, and does a large residual alone make it influential?

Example 14

medium
Observed values y=(10,14,22)y = (10, 14, 22) have predictions y^=(12,14,20)\hat{y} = (12, 14, 20). Compute all three residuals.

Example 15

medium
A residual plot shows residuals increasing in spread as xx grows (a fan shape). What model assumption is violated?

Example 16

medium
If a residual is โˆ’5-5 at a point where the predicted value is 3030, what was the observed value?

Example 17

medium
Two models fit the same data: Model A has all residuals near zero with random scatter; Model B has high r2r^2 but a curved residual plot. Which model is more trustworthy?

Example 18

medium
The standard deviation of the residuals (denoted ss) is reported as 44. Roughly interpret this value.

Example 19

medium
Using y^=6+x\hat{y} = 6 + x, find the residual for the point (5,9)(5, 9).

Example 20

challenge
A line y^=1+2x\hat{y} = 1 + 2x fits points (1,4),(2,4),(3,8)(1,4), (2,4), (3,8). Compute the residuals and verify they sum to zero. If not, what does that tell you?

Example 21

challenge
A point with a large positive residual lies at the far right edge (large xx). Removing it changes the slope substantially. Classify the point.

Example 22

challenge
Given residuals with values 3,โˆ’2,โˆ’2,1,r53, -2, -2, 1, r_5 from an LSRL, find r5r_5, then state the residual sum of squares (RSS) using all five.

Example 23

easy
A regression line predicts y^=12\hat{y} = 12 for x=5x = 5. The actual observation is y=9y = 9. Find the residual.

Example 24

easy
Given y^=4xโˆ’3\hat{y} = 4x - 3 and observed point (2,7)(2, 7), compute the residual.

Example 25

easy
For a least-squares regression line, โˆ‘(yiโˆ’y^i)\sum (y_i - \hat{y}_i) always equals what value?

Example 26

medium
Residuals from a regression: {4,โˆ’3,2,x,โˆ’1}\{4, -3, 2, x, -1\} where the residual sum is zero. Find xx.

Example 27

medium
For points (2,5),(4,7),(6,11)(2, 5), (4, 7), (6, 11) and line y^=1.5x+1\hat{y} = 1.5x + 1, compute SSR (sum of squared residuals).

Example 28

medium
Predicted y^\hat{y} values: 10,12,1510, 12, 15. Observed yy: 11,9,1811, 9, 18. Compute the mean of the residuals.

Example 29

hard
An LSRL fit gives residuals with โˆ‘ei2=80\sum e_i^2 = 80 and n=12n = 12. Estimate the residual standard error (use nโˆ’2n - 2 degrees of freedom).

Example 30

hard
A residual plot shows a curved (parabolic) pattern. What kind of model might better fit the data?

Example 31

hard
A regression has n=20n = 20, SST =200= 200, SSR =50= 50. Find R2R^2.

Example 32

easy
Predicted y^=100\hat{y} = 100, observed y=100y = 100. What is the residual?

Example 33

medium
For an LSRL with intercept b0=2b_0 = 2 and slope b1=3b_1 = 3 fit on xห‰=5\bar{x} = 5, yห‰=?\bar{y} = ?. Verify the line passes through (xห‰,yห‰)(\bar{x}, \bar{y}).

Example 34

medium
A residual plot shows residuals fanning out as y^\hat{y} grows. What is this called and what does it suggest?

Example 35

medium
A residual plot has all positive residuals on the left and all negative residuals on the right. What kind of pattern is missed?

Example 36

easy
Given y^=10โˆ’2x\hat{y} = 10 - 2x and observed (3,6)(3, 6), find the residual.

Example 37

medium
From a regression with se=2.5s_e = 2.5 and a residual of e=6e = 6, find the standardized residual.

Example 38

hard
Suppose a quadratic relationship y=x2y = x^2 is fit with a line y^=ax+b\hat{y} = ax + b. What kind of residual plot would result?

Example 39

challenge
For LSRL with no intercept (line forced through origin: y^=bx\hat{y} = bx), is โˆ‘ei=0\sum e_i = 0 guaranteed?

Background Knowledge

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

linear regression lsrl