PRE-ALGEBRA • STATISTICS & PROBABILITY

Fitting Lines to Data — I can fit a line to data informally and interpret slope and intercept in context.

Learn how to draw a line through scattered data points and explain what the slope and intercept really mean.

Where Did This Idea Come From?

People have been collecting data for thousands of years. Farmers tracked rainfall. Traders recorded prices. But for a long time, nobody had a good way to see patterns hiding inside all those numbers.

Drawing a line through data points is one of the simplest and most powerful tools in all of math and science. It lets you summarize messy, real-world information with a single straight line. That line can then help you make predictions about things you haven't measured yet.

1600s
Early Data Tables
Scientists like Galileo began recording measurements in organized tables, looking for relationships between variables like distance and time.
1686
First Scatter Plot
Edmund Halley (the comet guy!) created one of the earliest scatter plots by graphing air pressure against altitude.
1805
Least Squares Method
Adrien-Marie Legendre published a mathematical method for finding the "best" line through data. This idea is still used today in every field of science.
Today
Lines of Fit Everywhere
From weather forecasts to sports stats, fitting lines to data is one of the most common tools in the modern world.

The big question this lesson answers is: How do you draw a reasonable line through a cloud of data points, and what does that line actually tell you?

Core Ideas You Need to Know

Before you start drawing lines, let's make sure you understand a few key ideas. These are the building blocks for the whole lesson.

1

Scatter Plot

A graph where each data point is shown as a dot. The x-axis shows one variable, and the y-axis shows another. You use it to spot patterns.
2

Line of Fit

A straight line drawn through a scatter plot that follows the general trend of the data. It doesn't have to pass through every single point.
3

Slope

How steep the line is. It tells you how much y changes each time x increases by 1. Think of it as the "rate of change."
4

Y-Intercept

The point where the line crosses the y-axis (where x = 0). It often represents a starting value before anything changes.
5

Trend

The overall direction of the data. A positive trend goes upward from left to right. A negative trend goes downward. No trend means the dots look random.
KEY TAKEAWAY
Think of a line of fit like drawing a path through a messy room. You can't step on every single toy, but you find the path that gets closest to most of them. The line doesn't need to touch every data point—it just needs to follow the general direction of the data.

Seeing the Line in a Scatter Plot

The best way to understand a line of fit is to see one in action. Below is a scatter plot that shows how many hours students studied and the test scores they earned. Notice how the dots roughly follow an upward pattern.

Each cyan dot is one student's data. The dashed pink line is the line of fit—it follows the overall upward trend without touching every point.

Look at the diagram above. The dots are not in a perfect line. Some are a little above the pink line, and some are a little below it. That's totally normal! Real data is messy. The line of fit just captures the overall direction the data is heading.

✏️ How to Draw a Line of Fit by Hand
Use a ruler or the edge of a piece of paper. Try to have roughly the same number of points above your line as below it. The line should run through the "middle" of the cloud of dots.

The Equation Behind the Line

Every straight line can be described by a simple equation. Once you know this equation, you can plug in any x-value and predict the matching y-value.

SLOPE-INTERCEPT FORM
y = mx + b
y = the output (what you predict) • m = slope (rate of change) • x = the input • b = y-intercept (starting value)
SLOPE FORMULA
m = (y₂ − y₁) ÷ (x₂ − x₁)
Pick two points on your line (not data points—points on the line). Subtract the y-values, then subtract the x-values. Divide.

The slope tells you the speed of change. In our study-hours example, a slope of 8 would mean that for every extra hour a student studies, their test score goes up by about 8 points.

The y-intercept tells you the starting point. If b = 55, that means a student who studies 0 hours would score about 55 on the test. It's the score you "start with" before studying kicks in.

🤔 Does the y-intercept always make sense?
Not always! Imagine a line that predicts a person's height based on their age. The y-intercept would be the height at age 0—a newborn. That might be reasonable. But sometimes the y-intercept gives a silly answer. Always check if x = 0 makes sense in your real-world situation.

What Slope and Intercept Look Like

Slope and intercept aren't just numbers—they tell a story. Let's see what different slopes look like on a graph and what they mean in real life.

A positive slope means the line goes up. A negative slope means the line goes down. A zero slope means the line is flat—no change at all.
Interpreting slope and y-intercept in everyday situations
Real-World ExampleSlope MeaningY-Intercept Meaning
Hours studied → Test scorePoints gained per extra hourScore with zero hours of study
Age of a car → Value in dollarsDollars lost per year (negative!)The price when the car was brand new
Minutes exercising → Calories burnedCalories burned per minuteCalories burned at rest (before exercising)

Step-by-Step: Fitting a Line and Interpreting It

A lemonade stand owner tracked the temperature outside and how many cups of lemonade she sold. Here is her data:

Temperature (°F)Cups Sold
6010
7018
7520
8025
9035
9538
Lemonade Stand: Fitting a Line
1
Step 1 — Plot the PointsPut temperature on the x-axis and cups sold on the y-axis. Plot each pair as a dot on graph paper or a coordinate plane.
2
Step 2 — Draw a Line of FitUse a ruler to draw a straight line through the middle of the dots. Try to have about the same number of points above and below the line. Our line passes close to the points (60, 10) and (90, 34).
3
Step 3 — Find the SlopePick two points on the line (not necessarily data points). We'll use (60, 10) and (90, 34). Slope = (34 − 10) ÷ (90 − 60) = 24 ÷ 30 = 0.8
m = 0.8 cups per degree
4
Step 4 — Find the Y-InterceptUse the slope and one point in y = mx + b. Plug in (60, 10): 10 = 0.8 × 60 + b → 10 = 48 + b → b = 10 − 48 = −38.
b = −38
5
Step 5 — Write the EquationOur line of fit is y = 0.8x − 38.
y = 0.8x − 38
6
Step 6 — Interpret in ContextSlope: For every 1°F increase in temperature, the stand sells about 0.8 more cups of lemonade. Y-intercept: At 0°F, the model predicts −38 cups, which doesn't make sense. This tells us the model only works for temperatures near the data we collected.

When Lines of Fit Work—and When They Don't

A line of fit is an awesome tool, but it isn't magic. Let's compare what it does well and where it falls short.

Strengths vs. Limitations of informal line fitting
Strengths ✅Limitations ⚠️
Quick to draw—you only need a rulerDifferent people may draw slightly different lines
Good for making predictions within the data rangePredictions far outside the data range can be wild (like −38 cups!)
Easy to interpret slope and intercept in contextOnly works when the data actually follows a straight-line pattern
Summarizes a lot of data with one equationIt ignores outliers (unusual data points) that might matter
💡 KEEP THIS IN MIND
A line of fit is like a weather forecast—it gives you a good estimate, not a guarantee. It works best when you stay close to the data you actually have. Making predictions way outside that range is called extrapolation, and it can lead to silly answers.

From Informal Lines to Formal Methods

You just learned how to fit a line informally—by eyeballing it with a ruler. In later math courses, you'll learn a formula that finds the absolute best line through the data. Here's a quick preview.

Informal vs. formal line fitting
FeatureInformal Line of Fit (This Lesson)Least-Squares Regression (Future Course)
How you draw itBy eye, using a rulerCalculated with a formula or computer
AccuracyGood estimateMathematically the best possible line
Everyone gets the same answer?No—lines will vary slightlyYes—the formula gives one answer
Tools neededPencil and rulerCalculator or software

The skills you're building right now—understanding slope, intercept, and trend—are the foundation for all of that future work. You're learning the thinking; the formulas come later.

Practice Problems

PROBLEM 1CONCEPTUAL
A scatter plot shows the number of hours a student sleeps and the number of yawns they make during class. The line of fit has a negative slope. In your own words, what does the negative slope mean in this situation?
PROBLEM 2BASIC CALCULATION
A line of fit passes through the points (2, 14) and (6, 30). Find the slope of the line. What does the slope mean if x is weeks of practice and y is the number of free throws made out of 50?
PROBLEM 3INTERMEDIATE
A line of fit for data about the age of a phone (in years) and its resale value (in dollars) is y = −50x + 400. Find the predicted resale value of a phone that is 3 years old. Then explain what the slope and y-intercept mean.
PROBLEM 4APPLIED
A farmer recorded the rainfall (in inches) and crop yield (in bushels per acre) over several years. Her line of fit is y = 12x + 20. How many bushels per acre does the model predict when rainfall is 5 inches? If the highest rainfall in her data was 8 inches, would you trust a prediction for 20 inches of rain? Explain.
PROBLEM 5CRITICAL THINKING
Two students each draw a line of fit for the same scatter plot. Student A's line is y = 3x + 5. Student B's line is y = 2.5x + 7. Both lines look reasonable. Can both be correct? Why might their lines be different, and how would you decide which is better?

Lesson Summary

A scatter plot shows the relationship between two variables as a cloud of dots. When the dots follow a roughly straight pattern, you can draw a line of fit through the middle of them. This line is described by the equation y = mx + b, where m (the slope) tells you the rate of change—how much y changes for each 1-unit increase in x—and b (the y-intercept) tells you the starting value when x equals zero.

Always interpret slope and intercept in context—use the real-world units from the problem. A positive slope means the line rises, a negative slope means it falls, and a slope of zero means no change. Remember, your line is an estimate—predictions are most trustworthy within the range of your original data.

Varsity Tutors • Pre-Algebra • Fitting Lines to Data