Math Error Lab

Check 30 · Statistics

Line of best fit on a scatterplot: residuals and slope

The scatterplot has a line through the dots, and the question asks for a residual. You find the predicted value, subtract, and get a clean positive number. But the dot you are looking at sits below the line, so its residual has to be negative.

In this guide

The short answer

How do you find a residual from a line of best fit?

A residual is the observed value minus the value the line predicts, at the same x. If a line of best fit is y = 2.5x − 100, it predicts 100 iced drinks on an 80°F day. A day with 92 drinks has a residual of 92 − 100 = −8. The negative sign means the dot sits 8 drinks below the line. Dots above the line have positive residuals.

Prefer video? Watch the 1-minute lesson

Residual = observed − predicted. Below the line means negative.
A scatterplot of daily high temperature from 68 to 96 degrees against iced drinks sold, with a rising line of best fit, y = 2.5x − 100. The day at 80 degrees is highlighted. Its observed value, 92 drinks, is 8 drinks below the line’s predicted value of 100, so its residual is −8.70809080100120140High temperature (°F)Iced drinkspredicted 100residual −8observed 92
Predicted − observed100 − 92 = 8Trap: 8
Observed − predicted92 − 100 = −8Below the line

The line also shows that heat and sales rise together. It does not show that one causes the other.

What you’ll practice

  • Find a residual as observed minus predicted.
  • Interpret the slope and y-intercept of a line of best fit in context.
  • Tell an association apart from a cause.

Before you start: You can put a number into y = mx + b and subtract with negative numbers.

An original worked example

The dot is below the line, so the residual is negative

A café’s scatterplot compares the daily high temperature x, in degrees Fahrenheit, with the number of iced drinks sold y. The line of best fit is y = 2.5x − 100. On one day the high was 80°F and the café sold 92 iced drinks. What is the residual for that day?

The tempting wrong path
  1. Predicted drinks at 80°F: 2.5(80) − 100 = 100.
  2. Residual: 100 − 92 = 8.
  3. So the residual is 8.

Tempting answer8

Where it goes wrong

The prediction is right. The subtraction is backwards. A residual is observed minus predicted, the real dot minus the line. The café sold 92 drinks, fewer than the 100 the line predicts, so the dot is below the line and the residual must be negative.

The correct method

  1. Find the predicted value. Put x = 80 into the line of best fit.

    y = 2.5(80) − 100
    y = 100
  2. Read the observed value from the data. The café sold 92 drinks.

    observed = 92
  3. Subtract in this order: observed minus predicted.

    92 − 100 = −8
  4. Check the sign against the picture. The café sold less than predicted, so the dot is below the line and the residual is negative.

    residual = −8
The answer: −8

Watch it worked out

The same slip in a short video lesson

Lesson 29 of the SAT Math Study System shows this trap on an SAT-style question, then works a harder one. It runs under a minute.

The check to keep

Check 30

Residual = observed − predicted. A dot below the line has a negative residual.

Write “observed − predicted” before you put in any numbers, and label which number is which. Then look at the dot. A dot above the line must give a positive residual, and a dot below must give a negative one. When an answer choice says one variable causes the other, ask whether the data came from a randomized experiment.

Slope, intercept, cause and curved data

Start by reading the shape of the dots. If they rise from left to right, the association is positive. If they fall, it is negative. Dots packed close to a straight path show a strong linear association, and loosely scattered dots show a weak one. A dot far from the rest is an outlier.

The slope of a line of best fit is the predicted change in y for each 1-unit increase in x. For y = 2.5x − 100, each extra degree goes with 2.5 more iced drinks, according to the model. Over a 4°F rise, the line predicts 2.5 × 4 = 10 more drinks. Say “predicted” or “on average,” because real days scatter around the line.

The y-intercept is the predicted y when x = 0. Here it says the café sells −100 drinks on a 0°F day, which is impossible. An intercept only means something when x = 0 makes sense and sits near the data. Using a line far outside the range of the data is called extrapolation, and those predictions can be badly off.

A line of best fit shows association, not cause. Iced drink sales and sunscreen sales rise together, but neither causes the other. Hot, sunny weather drives both. A café’s sales records only show what happened, and something else could be behind the pattern. To show cause, you need an experiment where the conditions are assigned at random.

Not every scatterplot is straight. If equal steps in x add the same amount to y, a line fits. If equal steps in x multiply y by the same number, an exponential model fits. The values 40, 60, 80, 100 add 20 each step, so they are linear. The values 40, 60, 90, 135 are multiplied by 1.5 each step, so they are exponential. Residuals help here too. If they form a curve instead of a random scatter around zero, a straight line is missing the pattern.

Your turn. Keep the answer closed.

Three questions to try

Work each one on paper first. Then type your answer and check it. If it is off, you get a hint about the likely slip, not the answer.

Practice 1

A line of best fit for used bikes is y = −15x + 240, where x is a bike’s age in years and y is its predicted price in dollars. A 6-year-old bike in the data sold for $172. What is the residual for that bike, in dollars?

See the worked answer to practice 1

22

  1. Find the predicted price at x = 6.

    y = −15(6) + 240
    y = 150
  2. Subtract: observed minus predicted.

    172 − 150 = 22
  3. The bike sold for more than predicted, so its dot is above the line and the residual is positive.

    residual = 22

Practice 2

A scatterplot shows a plant’s height y, in centimeters, against weeks since planting x. The line of best fit is y = 1.8x + 4. According to the line, by how many centimeters does the predicted height increase over 5 weeks?

See the worked answer to practice 2

9 centimeters

  1. The slope, 1.8, is the predicted increase in height for each 1 week.
  2. Over 5 weeks: 1.8 × 5 = 9 centimeters.
  3. Check with two predictions. At x = 0 the line gives 4, and at x = 5 it gives 1.8(5) + 4 = 13. The increase is 13 − 4 = 9.

Practice 3

A line of best fit is y = 0.5x + 12. The data point (20, k) has a residual of −3. What is the value of k?

See the worked answer to practice 3

19

  1. Predicted value at x = 20: 0.5(20) + 12 = 22.
  2. Residual = observed − predicted, so −3 = k − 22.
  3. Add 22 to both sides: k = 19.
  4. Check: the residual is negative, so the point is below the line, and 19 is less than 22.

Common questions about scatterplots and lines of best fit

Does a line of best fit show that x causes y?

No, a line of best fit shows only that the two variables move together in the data. Iced drink sales and sunscreen sales both rise on hot days, but buying one does not cause the other. To show cause, you need a randomized experiment, where the conditions are assigned at random.

What does a negative residual mean?

A negative residual means the real data point is below the line of best fit, so the line predicted too high. If the line predicts 100 drinks and the café sold 92, the residual is 92 − 100 = −8. A positive residual means the point is above the line.

How do you interpret the slope of a line of best fit?

The slope is the predicted change in y for each 1-unit increase in x, in the units of the problem. For y = 40x + 150, where x is hours worked and y is pay in dollars, each extra hour of work goes with a predicted $40 more in pay.

What does the y-intercept mean on a scatterplot?

The y-intercept is the value the line predicts when x = 0. For a line y = 40x + 150 that relates hours worked to pay, 150 is the predicted pay for 0 hours. If x = 0 is far outside the data, like a 0°F day for a café, the intercept may have no real meaning.

Can you use a line of best fit to predict outside the data?

You can, but the prediction is risky. Predicting far outside the data is called extrapolation, and it assumes the trend keeps going. If a café’s data covers 70°F to 95°F, the line y = 2.5x − 100 predicts −50 drinks at 20°F, which is impossible.

Put the checks to work

Can you catch it on a new question?

Try five original questions. See every worked answer and keep the checks you want to practice.

Try the free check

About 3 minutes. No email needed.