Line of best fit: prediction & residuals
The rule. To predict from a line of best fit written as y = mx + b, put the input in for x and work out y. A residual is the actual value minus the predicted value: a point above the line has a positive residual, meaning the model predicted too low there, and a point below the line has a negative residual, meaning the model predicted too high. Predicting for an input inside the range of the data you collected is called interpolation and is reasonable. Predicting far outside that range is called extrapolation and is less trustworthy, because the pattern may not continue. The slope of the fitted line is the modeled rate of change, measured in units of y for each unit of x.
How to approach it
Start here. Decide which task it is: a prediction (put in x), a residual (compare the actual to the predicted), a reliability judgment (inside the data range or far outside it), or reading the slope.
Plan
- To predict, substitute the x-value into y = mx + b and evaluate.
- For a residual, subtract the predicted value from the actual value, and read the sign as predicting too low or too high.
- To judge reliability, check whether the input sits inside the range of the collected data.
- To read the slope, state the rate of change with its units of y per x.
Work it. Evaluate or subtract as the task needs, keeping the sign of a residual meaningful.
Check yourself. Did you substitute into the right variable? Is the residual the actual minus the predicted, so that a point above the line is positive? Is the input inside the data range? Are the slope's units y per x?
Worked examples
Worked example 1
A line of best fit is y = 3x + 5. At x = 4 the actual data value is 20. Find the model's prediction at x = 4 and the residual for this point.
The model is y = 3x + 5. At x = 4 we first predict y, then compare it to the actual value of 20. The residual is the actual value minus the predicted value.
Plan
- Substitute x = 4 into y = 3x + 5 to get the prediction.
- Subtract the predicted value from the actual value, 20.
- Read the sign of the residual.
| predicted = 3(4) + 5 | substitute x = 4 |
| = 17 | multiply, then add |
| residual = actual - predicted | definition of a residual |
| = 20 - 17 | substitute the actual and predicted values |
| = 3 | subtract |
Check. The actual value 20 is above the predicted 17, so the point lies above the line and the residual should be positive. It is +3, meaning the model predicted 3 too low here.
Answer: the prediction is 17 and the residual is +3
Worked example 2
A line of best fit is y = 2x + 1. A data point at x = 5 has a residual of -4. What is the actual y-value of that point?
The residual is the actual value minus the predicted value. We can find the predicted value from the model, then use the given residual to solve backward for the actual value.
Plan
- Substitute x = 5 into y = 2x + 1 to get the prediction.
- Write residual = actual - predicted.
- Solve for the actual value using residual = -4.
| predicted = 2(5) + 1 = 11 | substitute x = 5 |
| residual = actual - predicted | definition of a residual |
| -4 = actual - 11 | substitute the residual and prediction |
| actual = 7 | add 11 to both sides |
Check. With an actual value of 7 and a prediction of 11, the residual is 7 - 11 = -4, matching the given value, and the negative sign fits a point that lies below the line.
Answer: the actual y-value is 7
Common mistakes
Prediction computation error
Misuses the equation — drops the intercept, evaluates in the wrong order, or solves for x instead of finding y. Fix: substitute the x-value into the whole equation and evaluate y.
Residual sign/direction error
Reverses the residual — calls a point above the line negative, subtracts actual from predicted, or swaps predicting too low and too high. Fix: residual is actual minus predicted, so a point above the line is positive.
Extrapolation-reliability error
Treats a prediction far outside the data range as just as trustworthy as one inside it, not seeing that it is an extrapolation. Fix: predictions far beyond the data are less reliable because the pattern may not hold.
Slope-as-rate misread
Misreads the slope's meaning or units — using the intercept as the rate, or flipping the units. Fix: the slope is the change in y per one unit of x, in units of y per x.
Related lessons
- Before this: Two-variable data: scatterplots & line of best fit
- Before this: Interpret slope & intercept of a linear model in context
Practice this until it sticks
The adaptive tutor has 5 practice questions on this skill, names the exact mistake when you miss one, and gives you a fresh problem to confirm the fix. It is part of the Digital SAT program: $59 once, 12 months of access, no renewal.
See the Digital SAT programEnroll