Learn · Grade 8 Mathematics (Pre-Algebra)

Fit a line to a scatter plot

Draw a straight line that follows the trend of a scatter plot, judge whether a line fits, and use it as a linear function to estimate.

Lesson 3 of 4About 30 minutesMA.8.DP.1.3

Written with AI assistance. No teacher has reviewed these lessons and questions yet.

01 · Learn the idea

A line that stands for the whole cloud

When the points of a scatter plot cluster around a straight line, you can draw that line. It is called a line of fit. It is one straight line that follows the trend of all the points together.

A good line of fit does three things. It slopes the same way the points do. It runs through the middle of the cloud, with about the same number of points above it as below it. And it stays close to the points along its whole length, not only at one end.

The line does not have to pass through any of the points. It can miss every one of them and still be a good fit.

The plot here is for 8 students in a made-up typing club. Across is weeks of practice and up is words typed per minute. The points are (1, 14), (2, 15), (3, 20), (4, 21), (5, 26), (6, 27), (7, 32) and (8, 33). The line drawn is y = 3x + 10. Four points are 1 word per minute above it and four are 1 below it.

  • y = 3x + 10
Eight points rising from (1, 14) to (8, 33), with the line y = 3x + 10 running through the middle of them.

02 · Build understanding

Worked example: fit a line with a ruler

Fit a line to the typing club plot. You need a straightedge you can move around on the page: a ruler, the edge of a sheet of paper or a piece of uncooked spaghetti. A clear ruler is best because you can see the points under it.

Step 1: Check that a line makes sense. The points rise steadily from left to right with no bend, so the association is linear and a straight line can follow it.

Step 2: Lay the ruler along the trend. Tilt it so it rises the way the points rise. Here the words per minute go up by about 3 for each week, so the ruler should climb about 3 units for each unit across.

Step 3: Slide the ruler up or down, keeping the tilt, until the points are split evenly: about half above the edge and half below.

Step 4: Draw the line along the edge, across the whole plot.

Step 5: Check by counting. With the line y = 3x + 10, the line is at 13 when x = 1 and the point is at 14, so that point is above. At x = 2 the line is at 16 and the point is at 15, so that point is below. Going on this way gives 4 points above and 4 below. The line follows the trend and splits the points evenly, so it fits.

03 · Build understanding

Worked example: from the line to a function

A line of fit is the graph of a linear function. Once you have its equation, you can put in an input and get an estimate.

Eight members of a made-up book club record minutes of reading each night and books finished in a semester. Minutes: 10, 15, 20, 25, 30, 35, 40, 45 and books: 5, 4, 7, 6, 9, 8, 11, 10. A line of fit is drawn with a ruler. It passes through the grid points (10, 4) and (40, 10). Estimate the books finished by a member who reads 22 minutes a night.

Step 1: Find the slope from two points on the line. Use points the line passes through, which need not be data points. Slope = (10 − 4)/(40 − 10) = 6/30 = 0.2.

Step 2: Find the y-intercept. Put (10, 4) into y = 0.2x + b: 4 = 0.2 × 10 + b, so 4 = 2 + b and b = 2.

Step 3: Write the function. The line of fit is y = 0.2x + 2, where x is minutes of reading and y is books finished.

Step 4: Estimate. For x = 22, y = 0.2 × 22 + 2 = 4.4 + 2 = 6.4. The line suggests about 6 books.

Step 5: Check that the estimate is sensible. The members who read 20 and 25 minutes finished 7 and 6 books, and 6.4 sits between those. An estimate from a line of fit is a reasonable guess, not a promise. It is most trustworthy inside the range of the data, here from 10 to 45 minutes.

Eight points for minutes of reading and books finished, with a line through (10, 4) and (40, 10).

y = 0.2x + 2

04 · Build understanding

Judging a line someone else drew

To judge a line, ask the same three questions. Does it slope the way the points do? Are the points split about evenly above and below? Does it stay close to the points from one end to the other?

Try three other lines on the typing club plot. The line y = 3x + 16 has the right tilt, but all 8 points are below it. It needs to slide down.

The line y = −3x + 37 falls from left to right while the points rise. It crosses the cloud in the middle and is far from the points at both ends. It slopes the wrong way.

The line y = 6x − 4 is the tricky one, and it is drawn here next to the good line. It has 4 points above it, 3 below it and 1 on it, which sounds balanced. But all the points above are on the left and all the points below are on the right: at x = 1 the line is at 2 while the point is at 14, and at x = 8 the line is at 44 while the point is at 33. It is too steep. Counting is a quick check, but the line must also follow the trend.

  • y = 3x + 10
  • y = 6x − 4
The typing club points with two lines: y = 3x + 10 through the middle of the points and the much steeper y = 6x − 4.

05 · Build understanding

Mistakes to watch for

Joining the first point to the last point. Those two points are no more important than the others. If either one sits a little high or low, the line through them is pulled away from the rest of the cloud.

Forcing the line through (0, 0). The typing line y = 3x + 10 crosses the vertical axis at 10, not at 0. A line pushed through the origin would have to be far too steep to reach the points on the right, and it would pass under the points on the left.

Drawing a zigzag from point to point. A line of fit is one straight line. It shows the trend, not every wiggle.

Fitting a line to a curve. If the points rise and then fall, no straight line follows them. Fit a line only when the association is linear.

Apply and explain

Your turn

Eli fits a line to a scatter plot by joining the lowest-left point to the highest-right point. All the other points end up below his line. Explain what is wrong with his method and how he should adjust the line.

Use paper or explain your thinking aloud before opening the solution.

Check your reasoning

Eli used only two of the points, so his line follows those two and not the whole cloud. A line of fit should have about the same number of points above it as below it, and his has none above. He should keep roughly the same tilt, because the line does rise the way the points do, and slide the ruler down until about half of the points are above the edge and half are below. The new line may not pass through any point at all, and that is fine.

  • Says the line should follow all the points, not only the two end points.
  • Uses the idea of about the same number of points above and below the line.
  • Describes a correct adjustment: slide the line down toward the middle of the points.

Ready to practice?

Try the questions, get feedback, and review your reasoning.

Fit a line to a scatter plot: practice →