8TH GRADE MATH • STATISTICS AND PROBABILITY

Fit Lines to Scatter Plots

Learn how to draw a straight line through scatter plot data to describe trends and make predictions.

Historical Context & Motivation

Have you ever wondered how scientists predict the weather or how coaches figure out the best training plan? They look for patterns in data. For hundreds of years, mathematicians have been developing tools to spot trends and make smart guesses about the future. One of the simplest and most powerful tools is drawing a straight line through a set of data points.

The idea of using lines to model data didn't happen overnight. It grew slowly as people found better ways to collect, organize, and understand numbers. Let's look at some key moments in that story.

1600s
Early Data Tables
Scientists like Galileo began recording measurements in organized tables. This let them notice relationships between things like distance and time.
1833
The First Scatter Plot
English scientist John Herschel created one of the first known scatter plots. He plotted pairs of numbers on a grid and noticed that the dots seemed to follow a pattern.
1886
Francis Galton & Regression
Galton studied the heights of parents and children. He drew a line through his scatter plot to show the trend. This idea became known as the "line of regression."
Today
Lines of Fit Everywhere
Today, straight lines are used to model data in medicine, sports, economics, and technology. Even your phone's step counter uses data trends!

So here's the big question this lesson answers: when you have a bunch of data points on a scatter plot, how do you draw a single straight line that best represents the overall trend? And once you draw it, how do you know if it actually fits the data well?

Core Principles & Definitions

Before we start drawing lines, let's make sure we understand the key vocabulary. These four ideas are the building blocks of this whole lesson.

1

Scatter Plot

A graph where each data point is shown as a dot. One variable goes on the x-axis and the other on the y-axis. Each dot represents a pair of values.
2

Linear Association

When the dots in a scatter plot roughly follow a straight-line pattern. The association can be positive (going up) or negative (going down).
3

Line of Fit (Trend Line)

A straight line drawn through the scatter plot that comes as close as possible to most of the data points. It summarizes the overall trend.
4

Model Fit

How well the line represents the data. If most dots are close to the line, the fit is good. If dots are scattered far away, the fit is poor.
KEY TAKEAWAY
Think of a line of fit like a hiking trail on a mountainside. The hikers (data points) don't all walk exactly on the trail, but they stay pretty close to it. The trail shows the general direction everyone is heading. If hikers are wandering far from the trail, you might need a different path!

One important thing to remember: a line of fit only makes sense when the scatter plot shows a linear association. If the dots form a curve or have no pattern at all, forcing a straight line through them won't be helpful.

Visual Explanation — What a Line of Fit Looks Like

Let's look at a scatter plot that shows the relationship between hours spent studying and test scores. Notice how the dots trend upward from left to right. A line of fit is drawn through the middle of the data.

This scatter plot shows 14 data points (cyan dots). The pink line of fit runs through the middle of the data. Notice that most dots are close to the line, which tells us this is a good fit.

Look at the diagram above. The cyan dots represent individual students. As hours of studying increase (moving right), the test scores also increase (moving up). The pink line doesn't touch every dot, but it captures the general direction of the data. That's exactly what a line of fit is supposed to do.

💡 Quick Tip
When you draw a line of fit, try to have roughly the same number of dots above the line as below it. This helps your line sit in the "center" of the data.

Mathematical Framework — The Equation of a Line of Fit

You already know that the equation of a straight line looks like y = mx + b. When you draw a line of fit on a scatter plot, you can write its equation using the same form. This lets you make predictions!

SLOPE-INTERCEPT FORM
y = mx + b
y = the predicted output value (like a test score) • m = the slope (how steep the line is) • x = the input value (like hours studying) • b = the y-intercept (where the line crosses the y-axis)
SLOPE FORMULA
m = (y₂ − y₁) ÷ (x₂ − x₁)
Pick any two points on your line of fit (not necessarily data points — points that are ON the line itself). Subtract their y-values and divide by the difference in their x-values.

Here's the process in plain English. First, draw a line of fit on the scatter plot. Then pick two points that sit right on the line. Use those two points to calculate the slope (m). Finally, plug one of the points and the slope into y = mx + b to solve for b.

FINDING THE Y-INTERCEPT
b = y − mx
After finding the slope, substitute one of your two points (x, y) into this equation to find b.
📝 Remember
At this level, you are fitting the line "informally." That means you draw it by eye, trying to get it as close to the data as possible. You do NOT need a formula to place the line — just good judgment!

How to Judge If Your Line Fits Well

Not every line you draw through a scatter plot is a good fit. So how can you tell the difference between a great fit, an okay fit, and a terrible fit? The key is looking at how close the data points are to the line. Let's compare three situations.

Compare the three panels. In the good fit panel, data points cluster tightly around the line. In the okay fit panel, points are more spread out. In the poor fit panel, the line doesn't capture the pattern at all.

To judge the fit informally, ask yourself three questions:

  • Closeness: Are the data points close to the line, or are they far away?
  • Balance: Are there roughly the same number of points above and below the line?
  • Pattern: Do the dots follow the direction of the line, or do they curve away from it?

If the answer to all three is positive, congratulations — you have a good line of fit!

Worked Example — Drawing and Using a Line of Fit

Let's work through a full example together. A teacher recorded how many hours each student practiced basketball and how many free throws they made out of 20 attempts.

Basketball practice data
Hours of PracticeFree Throws Made (out of 20)
15
27
39
410
513
614
716
817
Finding the Equation of a Line of Fit
1
Step 1 — Plot the DataPlace each pair of values as a dot on the scatter plot. Hours of practice goes on the x-axis. Free throws made goes on the y-axis.
2
Step 2 — Draw the Line of FitLook at the data. The dots trend upward. Draw a straight line through the middle of the data so that roughly half the points are above the line and half are below. The line should follow the direction of the dots.
3
Step 3 — Pick Two Points on the LineChoose two points that sit right on your line (they don't have to be data points). A well-centered line through this dataset passes through (2, 8) and (8, 17). Notice that these points are chosen to keep the line balanced through the middle of the data — roughly equal numbers of data points fall above and below.
Points on line: (2, 8) and (8, 17)
4
Step 4 — Calculate the SlopeUse the slope formula: m = (y₂ − y₁) ÷ (x₂ − x₁). Substitute the two points: m = (17 − 8) ÷ (8 − 2) = 9 ÷ 6 = 1.5. The slope is 1.5, which means for each extra hour of practice, a student makes about 1.5 more free throws.
m = 1.5
5
Step 5 — Find the Y-InterceptPlug the slope and one point into y = mx + b. Using the point (2, 8): 8 = 1.5(2) + b → 8 = 3 + b → b = 5.
b = 5
6
Step 6 — Write the EquationPut the slope and y-intercept together.
y = 1.5x + 5
7
Step 7 — Use the Equation to PredictHow many free throws would a student likely make after 6 hours of practice? Substitute x = 6: y = 1.5(6) + 5 = 9 + 5 = 14. The model predicts about 14 free throws, which matches the data point (6, 14) closely — a great sign that our line is well-calibrated! We can also check x = 8: y = 1.5(8) + 5 = 12 + 5 = 17, which matches the data exactly.
Prediction at x = 6: y = 14 free throws

Common Mistakes and Helpful Tips

Drawing a line of fit is not an exact science at this level. It's informal, meaning you use your best judgment. But there are some common mistakes to avoid and tips that can help you draw a better line.

Common MistakeWhy It's a ProblemWhat to Do Instead
Connecting the first and last data pointsThose two points might be outliers. This ignores the middle of the data.Look at the overall trend of ALL the points before drawing.
Forcing a line through the origin (0, 0)The y-intercept might not be zero. Forcing it can tilt the line the wrong way.Let the line go wherever it fits best.
Drawing a line when there is no linear patternIf the data curves or has no pattern, a straight line is misleading.First check: does the scatter plot suggest a linear association?
Having all points on one side of the lineThe line isn't in the middle of the data.Adjust until about half the points are above and half are below.
KEY TAKEAWAY
Think of fitting a line like placing a ruler on a messy desk. You want the ruler to go through the middle of the clutter so that items are spread out equally on both sides. If all the stuff is on one side of the ruler, it's not centered — adjust it!

Connection to Advanced Ideas

Right now, you're fitting lines by eye — informally. That's exactly what the Common Core standard asks you to do. But in high school and college math, you'll learn more precise methods. Here's a sneak peek at how things level up.

What You Do Now (8th Grade)What Comes Later (High School & Beyond)
Draw the line of fit by eyeUse the "least squares" method — a formula that finds the single best-fit line mathematically
Judge fit by looking at how close points areCalculate a number called r (correlation coefficient) that measures fit exactly, from −1 to 1
Use y = mx + b for straight-line modelsUse curved equations (quadratic, exponential) for data that doesn't follow a straight line
Make predictions within the data rangeLearn about interpolation (predicting within data) vs. extrapolation (predicting beyond data) and why extrapolation is risky

The informal skills you're building now — recognizing patterns, drawing reasonable lines, and judging how well a model fits — are the foundation for all of these advanced topics. Every data scientist, engineer, and researcher started right where you are now!

Practice Problems

PROBLEM 1CONCEPTUAL
Explain in your own words what a "line of fit" is and why it's useful. When should you NOT draw a line of fit on a scatter plot?
PROBLEM 2BASIC CALCULATION
A line of fit passes through the points (2, 10) and (6, 26). Find the slope of this line and write its equation in y = mx + b form.
PROBLEM 3INTERMEDIATE
A scatter plot shows the number of minutes students read per day (x) and their vocabulary quiz scores (y). The data points are: (10, 55), (20, 60), (30, 68), (40, 73), (50, 80), (60, 85). Draw a rough line of fit by choosing two reasonable points on the trend, write the equation, and predict the score for a student who reads 45 minutes per day.
PROBLEM 4APPLIED
A pet store tracks the age of puppies (in weeks) and their weight (in pounds). The store's line of fit equation is y = 1.5x + 3, where x is age in weeks and y is weight in pounds. A customer asks: "My puppy is 12 weeks old and weighs 25 pounds. Is my puppy heavier or lighter than average for its age?" Use the equation to answer.
PROBLEM 5CRITICAL THINKING
Two students each draw a different line of fit for the same scatter plot. Student A's line passes through (0, 5) and (10, 25). Student B's line passes through (0, 8) and (10, 22). Both lines have about the same number of data points above and below them. How can you decide which line is a better fit?

Lesson Summary

In this lesson, you learned that scatter plots display pairs of data as dots on a coordinate grid. When the dots follow a straight-line pattern, we say there is a linear association. You can then draw a line of fit through the middle of the data to summarize the trend. To write the equation of this line, pick two points on the line, calculate the slope (m), and solve for the y-intercept (b) using y = mx + b.

To judge the model fit, check whether data points cluster closely around the line and whether about half are above and half are below. A good line of fit lets you make predictions for values within the data range. Remember: only use a straight line when the scatter plot actually suggests a linear association. These informal skills form the foundation for advanced statistics you'll explore in high school.

Varsity Tutors • 8th Grade Math • Fit Lines to Scatter Plots