Math Core

Lesson 9.2 · Bivariate Data

Lines of best fit

When a scatter plot shows a linear association, you can draw one straight line that captures the trend. That line turns a cloud of dots into an equation, and the equation lets you describe the data and make predictions.

A line that follows the trend

Here is the study-time data from the last lesson, with a line drawn through the middle of the points.

x-axis: hours studied. y-axis: test score. The line is y = 5.5x + 57.Open in grapher →

The line doesn't pass through every point. It can't, because the points don't lie exactly on a line. Instead it runs through the middle of the data: 66 points are above it and 66 are below it, and none of them is very far away.

Definition

Line of best fit

A straight line drawn on a scatter plot that shows the trend of the data as closely as possible. It is also called a line of fit or trend line.

Drawing a good line of fit

In 8th grade you draw a line of fit by eye. A good one follows a few rules.

What makes a good line of fit

  1. It follows the direction of the data (up for a positive association, down for a negative one).
  2. It has about as many points above it as below it.
  3. The points are as close to it as possible, all along the line, not just at one end.
  4. It ignores outliers instead of bending toward them.

A line of fit doesn't have to pass through any data point at all. Different people may draw slightly different lines, and that's fine, as long as each one follows the rules.

Common mistake

Don't just connect the first point to the last point. Those two points might be unusual, and the line through them could miss the rest of the data. Look at all the points and aim for the middle of the cloud.

Writing the equation

Once the line is drawn, write its equation in slope-intercept form, y=mx+by = mx + b, exactly as you would for any line. Choose two points on the line (not necessarily data points) that are easy to read.

Worked example: Finding the equation of a line of fit

A lemonade stand tracked the high temperature (in °F) and the number of cups sold on ten days. A line of fit is drawn.

x-axis: high temperature in °F. y-axis: cups of lemonade sold.Open in grapher →

The line passes through (60,10)(60, 10) and (90,43)(90, 43). Find its equation.

Solution. Find the slope:

m=43−1090−60=3330=1.1m = \frac{43 - 10}{90 - 60} = \frac{33}{30} = 1.1

Substitute one point into y=1.1x+by = 1.1x + b to find bb:

10=1.1(60)+b10=66+bb=−56\begin{aligned} 10 &= 1.1(60) + b \\ 10 &= 66 + b \\ b &= -56 \end{aligned}

The equation is y=1.1x−56y = 1.1x - 56.

What the slope and intercept mean

In a real-world line of fit, the slope and the yy-intercept have meanings in the units of the problem.

  • The slope is the predicted change in yy for each increase of 11 in xx.
  • The yy-intercept is the predicted value of yy when x=0x = 0.

Worked example: Interpreting slope and intercept

For the used cars from the last lesson, a line of fit is y=−2.2x+25y = -2.2x + 25, where xx is the car's age in years and yy is the price in thousands of dollars.

x-axis: age of the car in years. y-axis: price in thousands of dollars. The line is y = -2.2x + 25.Open in grapher →

What do the slope and the yy-intercept mean?

Solution.

  • Slope −2.2-2.2: for each extra year of age, the price drops by about 2.22.2 thousand dollars, or 2,200 dollars.
  • yy-intercept 2525: a brand-new car (age 00) is predicted to cost about 25 thousand dollars.

Making predictions

To predict, substitute the xx-value into the equation.

Worked example: Predicting with a line of fit

Use y=1.1x−56y = 1.1x - 56 to predict how many cups of lemonade the stand will sell on an 8888°F day.

Solution.

y=1.1(88)−56=96.8−56=40.8y = 1.1(88) - 56 = 96.8 - 56 = 40.8

The stand should sell about 4141 cups. You can't sell 0.80.8 of a cup, so round to a sensible whole number.

Predictions are most trustworthy inside the range of the data. The lemonade data runs from 6060°F to 9595°F. On a 4040°F day the equation predicts 1.1(40)−56=−121.1(40) - 56 = -12 cups, which is impossible. The pattern simply doesn't continue that far.

Tip

To check a prediction, find the xx-value on the graph, go straight up to the line, and read across to the yy-axis. Your calculated answer and your graph reading should be close.

Practice

Practice 1

Which statement describes a good line of fit?

Practice 2

A class measured a bean plant's height every week. The scatter plot and a line of fit are shown.

x-axis: week. y-axis: plant height in centimeters.Open in grapher →

Use the line to estimate the plant's height, in centimeters, at week 77.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

The line of fit for the bean plant is y=2x+1y = 2x + 1, where xx is the week and yy is the height in centimeters. Predict the plant's height at week 1212.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

In the line of fit y=2x+1y = 2x + 1 for the bean plant, what does the slope 22 mean?

Practice 5

A line of fit on a scatter plot passes through the points (0,12)(0, 12) and (5,32)(5, 32). Write its equation in the form y=mx+by = mx + b. Enter only the right side.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 6

For the study-time data, a line of fit is y=5.5x+57y = 5.5x + 57. One student studied 33 hours and scored 7878. How many points higher was the actual score than the score the line predicts?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

A student recorded her phone's battery level while streaming videos. A line of fit is y=−8x+100y = -8x + 100, where xx is the hours of use and yy is the battery percentage. According to the line, after how many hours will the battery be at 20%20\%?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

Data on kids ages 66 to 1212 gives the line of fit y=2.5x+30y = 2.5x + 30, where xx is age in years and yy is height in inches. Why is it a bad idea to use this line to predict the height of a 4040-year-old?