01 / 21

Fitting Lines
to Data

Learn to draw a line of best fit through scatter plot data and interpret the slope and y-intercept in real-world contexts.

Pre-Algebra

What Is a Scatter Plot?

A scatter plot shows two numerical variables as dots on a coordinate plane. Each dot represents one data point: its horizontal position is the \(x\)-value and its vertical position is the \(y\)-value.

Hours Studied Test Score 1 2 3 4 5 6 50 60 70 80 90

The Line of Best Fit

A line of best fit (or trend line) is a straight line drawn through a scatter plot that follows the overall pattern of the data. It doesn't have to pass through every point: it should have roughly equal numbers of points above and below it.

Hours Studied Test Score 1 2 3 4 5 6 50 60 70 80 90 Line of Best Fit

Why Fit a Line?

Summarize
A single line captures the overall trend hidden in dozens or hundreds of data points.
Predict
Use the line to estimate \(y\)-values for \(x\)-values you haven't measured yet.
Communicate
Slope and intercept give a concise numeric story: how fast and where it starts.

The Equation: \(y = mx + b\)

Every straight line can be written as \(y = mx + b\), where \(m\) is the slope and \(b\) is the y-intercept.

x y
\(b=1\) (y-intercept)
\(\text{run} = 2\)
\(\text{rise} = 4\)
\(m = \frac{\text{rise}}{\text{run}} = \frac{4}{2} = 2\)
1 2 3 4 5

Interpreting Slope in Context

The slope \(m\) tells you the rate of change: for every 1-unit increase in \(x\), the value of \(y\) increases (or decreases) by \(m\) units.

Positive slope
Line goes up left-to-right. Example: "Each extra hour of study raises the test score by about 8 points."
Negative slope
Line goes down left-to-right. Example: "Each additional mile from the city center drops the rent by about \$50."

Interpreting the y-Intercept

The y-intercept \(b\) is the predicted value of \(y\) when \(x = 0\). In context, it represents the starting value before any of the \(x\)-variable has been applied.

Example
If \(y = 8x + 52\) models "test score vs. hours studied," then \(b = 52\) means a student who studies 0 hours is predicted to score about 52 points.
Caution
The intercept may not always make practical sense. If \(x\) = years of experience, then \(x = 0\) means "no experience," which might be outside the data range.

Slope vs. Intercept

Slope \(m\) y-Intercept \(b\)
What it tells you Rate of change Starting value
Where to read it Steepness of line Where line crosses y-axis
Units y-units per x-unit Same units as \(y\)
Example 8 points/hour 52 points

How to Draw a Line of Best Fit

1
Plot all data points on a scatter plot with labeled axes.
2
Look at the overall direction. Do the points trend upward, downward, or show no trend?
3
Place a ruler so the line follows the cloud of points and roughly balances points above and below.
4
Pick two points on the line (not necessarily data points) to calculate slope: \(m = \frac{y_2 - y_1}{x_2 - x_1}\).
5
Read the y-intercept where the line crosses the y-axis, or substitute a point into \(y = mx + b\) and solve for \(b\).

Example 1: Plant Growth

A student measures a plant's height (cm) each week. The data: (1, 3), (2, 5), (3, 6), (4, 8), (5, 11), (6, 12).

Week Height (cm) 1 2 3 4 5 6 1 5 9 13
\((2, 5.1)\)
\((5, 10.5)\)

Example 2: Lemonade Sales

A lemonade stand tracked daily temperature (°F) and cups sold:

Temperature (°F) Cups Sold 60 70 80 90 100 0 10 20 30 40 50

Example 3: Making a Prediction

Using the lemonade model \(y = 1.1x - 63\), predict cups sold on a 88 °F day.

1
Substitute \(x = 88\) into the equation: \(y = 1.1(88) - 63\).
2
Multiply: \(1.1 \times 88 = 96.8\).
3
Subtract: \(96.8 - 63 = 33.8\).
4
Interpret: The model predicts about 34 cups sold on an 88 °F day.

Positive, Negative, or No Trend?

Positive
As \(x\) increases, \(y\) increases. Line slopes upward. Slope \(m > 0\).
Negative
As \(x\) increases, \(y\) decreases. Line slopes downward. Slope \(m < 0\).
No trend
Points are scattered randomly. No clear line fits. Slope \(m \approx 0\).
Positive Negative No Trend

Interpolation vs. Extrapolation

Interpolation
Predicting within the range of your data. Generally reliable because the trend has been observed in that region.
Extrapolation
Predicting beyond the range of your data. Risky: the real-world trend may change outside the observed region.

Common Mistakes

✕ Connecting the dots
The line of best fit is one straight line, not a zigzag through every data point.
✕ Forcing through the origin
Unless the context demands it, the line doesn't have to pass through \((0, 0)\).
✕ Ignoring units
Slope without units is meaningless. Always state "per hour," "per degree," etc.

Quick Reference Summary

Concept Symbol Meaning
Equation of a line \(y = mx + b\) Predicts \(y\) from \(x\)
Slope \(m\) Rate of change (rise/run)
y-Intercept \(b\) Value of \(y\) when \(x = 0\)
Positive association \(m > 0\) Both variables increase together
Negative association \(m < 0\) One goes up, the other goes down
Interpolation — Predicting within data range
Extrapolation — Predicting beyond data range

Question 1 of 5

A line of best fit for "hours practiced vs. free-throw accuracy" has equation \(y = 4x + 30\). What does the slope mean in context?

Question 2 of 5

In the equation \(y = 4x + 30\), what does the y-intercept (30) represent?

Question 3 of 5

A scatter plot shows that as the number of absences increases, test scores decrease. The line of best fit has a slope of \(-3.5\). What does this tell you?

Question 4 of 5

A line of best fit passes through the points \((2, 10)\) and \((6, 26)\). What is the slope?

Question 5 of 5

Your data covers ages 10 to 18. Your line of best fit is \(y = 2.5x + 40\). Which prediction is most reliable?