Algebra 1Data Analysis4 of 5
Data Analysis · 4

Scatter Plots and Lines of Fit

Real-world measurements rarely line up on an exact path, so we need a way to spot a trend inside a messy cloud of data and use it to make predictions.

1

Scatter Plots and Correlation

A scatter plot pairs two measurements on a graph to show whether they move together. Let's see what happens when we plot ten students' study hours against their exam scores, and how the overall slant of the cloud tells us the correlation.

Scatter Plots and Correlation
Exam Score\text{Exam Score}
Hours Studied\text{Hours Studied}
0\htmlClass{lc-mute}{0}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
5\htmlClass{lc-mute}{5}
6\htmlClass{lc-mute}{6}
40\htmlClass{lc-mute}{40}
60\htmlClass{lc-mute}{60}
80\htmlClass{lc-mute}{80}
100\htmlClass{lc-mute}{100}
(1,60)\obs{(1, 60)}
(2,75)\obs{(2, 75)}
(2,65)\obs{(2, 65)}
Positivecorrelation\begin{array}{c}\textbf{Positive}\\ \textbf{correlation}\end{array}
Exam Score\text{Exam Score}
HoursStudied\begin{array}{c}\text{Hours}\\\text{Studied}\end{array}
Negativecorrelation\begin{array}{c}\textbf{Negative}\\ \textbf{correlation}\end{array}
Exam Score\text{Exam Score}
Hours SpentScrolling onYour PhoneDuring Class\begin{array}{c}\text{Hours Spent}\\\text{Scrolling on}\\\text{Your Phone}\\\text{During Class}\end{array}
Nocorrelation\begin{array}{c}\textbf{No}\\ \textbf{correlation}\end{array}
Exam Score\text{Exam Score}
Shoe Size\begin{array}{c}\text{Shoe Size}\end{array}

Reading across from left to right tells us which correlation we have. The cloud climbs when both measurements grow together, drops when an increase in one goes with a decrease in the other, and shows no clear linear trend when there is no overall upward or downward slant.

2

Drawing a Line of Fit

Spotting a positive correlation tells us that students who studied more generally had higher scores. To predict a score where there is no dot, like at 4.5\surveyed{4.5} hours, we can use a line of fit (or trend line). A line of fit is a straight line drawn through the middle of the cloud that follows the path of the typical student.

Drawing a Line of Fit
Exam Score\text{Exam Score}
Hours Studied\text{Hours Studied}
0\htmlClass{lc-mute}{0}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
5\htmlClass{lc-mute}{5}
6\htmlClass{lc-mute}{6}
40\htmlClass{lc-mute}{40}
60\htmlClass{lc-mute}{60}
80\htmlClass{lc-mute}{80}
100\htmlClass{lc-mute}{100}
4.5\surveyed{4.5}
??

Tracing straight up from 4.5\surveyed{4.5} hours to our line of fit and over to the vertical axis gives a predicted exam score of 86\fit{86}.

Splitting the dots with five above and five below is not enough on its own. For predictions that follow the data across the graph, the line needs to sit in the center of the cloud and tilt along the upward direction of the dots.

To make predictions that follow the data across this graph, draw a line through the middle of the dots that follows their upward trend.
3

Writing the Equation of a Line of Fit

Tracing on a graph works one prediction at a time, but writing an equation for the line of fit lets us plug in any number of hours and calculate the predicted score right away. To write the line as an equation, we find where it starts at 00 hours on the vertical axis and how many points it climbs for each hour added.

Writing the Equation of a Line of Fit
Exam Score\text{Exam Score}
Hours Studied\text{Hours Studied}
0\htmlClass{lc-mute}{0}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
5\htmlClass{lc-mute}{5}
6\htmlClass{lc-mute}{6}
40\htmlClass{lc-mute}{40}
60\htmlClass{lc-mute}{60}
80\htmlClass{lc-mute}{80}
100\htmlClass{lc-mute}{100}
y=  ?y = \;?
Text solution
Read the starting value at 00 hoursThe line crosses the vertical axis at (0,50)\fit{(0, 50)}, which gives the predicted score with zero hours of studying.
Starting value (y-intercept)\displaystyle \text{Starting value } (y\text{-intercept}) =50\displaystyle = \fit{50}
Divide the score increase by the hour increase along the lineBetween (0,50)\fit{(0, 50)} and the clean grid crossing at (5,90)\fit{(5, 90)}, the line climbs 40\fit{40} points over 5\fit{5} hours.
Slope=40 points÷5 hours=8 points per hour\displaystyle \begin{aligned}\text{Slope} &= \fit{40}\text{ points} \div \fit{5}\text{ hours} \\ &= \fit{8}\text{ points per hour}\end{aligned}
Combine the starting value and the rate per hourStarting at 50\fit{50} and adding 8\fit{8} points for each hour xx gives the equation for the predicted score yy.
y⏟Score\displaystyle \underbrace{y}_{\text{Score}} =8⏟Slopex⏟Hours+50⏟y-intercept\displaystyle = \fit{\underbrace{8}_{\text{Slope}}}\underbrace{x}_{\text{Hours}} + \fit{\underbrace{50}_{y\text{-intercept}}}
4

Finding the Equation Without a Visible yy-Intercept

Sometimes the left side of the graph is cut off or the vertical crossing is hard to read, so we have to find the starting value at 00 hours using two clean spots further along the line.

Finding the Equation Without a Visible y-Intercept
Exam Score\text{Exam Score}
Hours Studied\text{Hours Studied}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
5\htmlClass{lc-mute}{5}
6\htmlClass{lc-mute}{6}
40\htmlClass{lc-mute}{40}
60\htmlClass{lc-mute}{60}
80\htmlClass{lc-mute}{80}
100\htmlClass{lc-mute}{100}
(2,66)\fit{(2, 66)}
(5,90)\fit{(5, 90)}
y-intercept=  ?y\text{-intercept} = \;?
Text solution
Find the slope between two clean spots on the lineFrom (2,66)\fit{(2, 66)} to (5,90)\fit{(5, 90)}, the line climbs 24\fit{24} points over an increase of 3\fit{3} hours.
Slope=24 points÷3 hours=8 points per hour\displaystyle \begin{aligned}\text{Slope} &= \fit{24}\text{ points} \div \fit{3}\text{ hours} \\ &= \fit{8}\text{ points per hour}\end{aligned}
Walk backward along the line to 00 hoursGoing back 22 hours from (2,66)\fit{(2, 66)} takes away two steps of 8\fit{8} points each to give the starting value.
Starting value\displaystyle \text{Starting value} =66−16\displaystyle = \fit{66} - 16 =50\displaystyle = \fit{50}
Write the equation from the slope and starting valueCombining the rate of 8\fit{8} points per hour with the starting value of 50\fit{50} gives the exact same equation.
y\displaystyle y =8x+50\displaystyle = \fit{8}x + \fit{50}

Any two distinct spots chosen on the line itself give the exact same slope of 8\fit{8} points per hour and walk back to the same starting value of 50\fit{50} at 00 hours. Picking student dots off the line can give a different slope or starting value.

Any two distinct spots on the line of fit give the same slope and starting value, while picking dots off the line can give a different slope or starting value.
5

Interpolation and Extrapolation

With the equation y=8x+50y = \fit{8}x + \fit{50}, predicting at a study time inside the surveyed range is interpolation, and predicting outside that range is extrapolation. Extrapolation is riskier because the observed trend may not continue outside the surveyed range.

Interpolation and Extrapolation
Exam Score\text{Exam Score}
Hours Studied\text{Hours Studied}
0\htmlClass{lc-mute}{0}
1\htmlClass{lc-mute}{1}
2\htmlClass{lc-mute}{2}
3\htmlClass{lc-mute}{3}
4\htmlClass{lc-mute}{4}
5\htmlClass{lc-mute}{5}
6\htmlClass{lc-mute}{6}
40\htmlClass{lc-mute}{40}
60\htmlClass{lc-mute}{60}
80\htmlClass{lc-mute}{80}
100\htmlClass{lc-mute}{100}
y=8x+50y = \fit{8}x + \fit{50}
x=4.5y=  ?x=20y=  ?\begin{alignedat}{2} x &= 4.5 &\qquad y &= \;? \\ x &= 20 & y &= \;?\end{alignedat}
Text solution
Plug in x=4.5x = \surveyed{4.5} hours to predict inside the data (interpolation)Because 4.5\surveyed{4.5} hours is inside the surveyed range of 1\surveyed{1} to 6\surveyed{6} hours, this prediction is interpolation. The equation predicts a score of 86\fit{86}, though an individual student's score can differ.
y\displaystyle y =8(4.5)+50\displaystyle = \fit{8}(\surveyed{4.5}) + \fit{50} =36+50\displaystyle = 36 + \fit{50} =86\displaystyle = \fit{86}
Plug in x=20x = \outside{20} hours to test far outside the data (extrapolation)Because 20\outside{20} hours is far beyond the surveyed range of 1\surveyed{1} to 6\surveyed{6} hours, extending the straight-line rule predicts an impossible score on a 100100-point test.
y\displaystyle y =8(20)+50\displaystyle = \fit{8}(\outside{20}) + \fit{50} =160+50\displaystyle = 160 + \fit{50} =210\displaystyle = \fit{210}

Key concepts

When you look at a scatter plot from left to right, a rising cloud shows a positive correlation (study hours and exam scores), a falling cloud shows a negative correlation (phone hours in class and exam scores), and a scattered cloud with no overall upward or downward slant shows no correlation (shoe size and exam scores). With no clear upward or downward trend, an increasing or decreasing line would not follow the data.

When there is a clear, roughly straight trend, draw the line of fit right through the center of the cloud tilted in the direction the dots are moving, not just splitting the dots with a flat horizontal line. Once the line is drawn, ignore the scattered data dots and pick two clean grid crossings that sit directly on the line, such as (2,66)\fit{(2, 66)} and (5,90)\fit{(5, 90)}. Divide the vertical change by the horizontal change to get the slope (24 points÷3 hours=8 points per hour\fit{24}\text{ points} \div \fit{3}\text{ hours} = \fit{8}\text{ points per hour}). Read the yy-intercept where the line crosses 00 on the horizontal axis, or walk the slope backward from a clean point on the line to 00 if the crossing is cut off (66−16=50\fit{66} - 16 = \fit{50}). Put the starting value and rate of change together into the equation:

y⏟Predicted value\displaystyle \underbrace{y}_{\text{Predicted value}} =8⏟Slopex+50⏟y-intercept at x=0\displaystyle = \fit{\underbrace{8}_{\text{Slope}}}x + \fit{\underbrace{50}_{y\text{-intercept at } x = 0}}

Predicting inside the surveyed range is interpolation, like x=4.5→y=86x = \surveyed{4.5} \to y = \fit{86} within 1\surveyed{1} to 6\surveyed{6} hours. Predicting outside it is extrapolation, like x=20→y=210x = \outside{20} \to y = \fit{210}. Treat extrapolation with care because the observed trend may not continue. Here, 210\fit{210} exceeds the test's maximum score of 100100.

6

Practice

1

For each pair of measurements, state whether a scatter plot would show a positive correlation, a negative correlation, or no correlation: (a) the number of miles driven since filling a gas tank and the gallons of gas left in the tank; (b) a student's locker number and their grade on a history test; (c) the number of items in a grocery cart and the total checkout bill.

For each pair, ask what happens to the second measurement as the first measurement increases: does it generally go up, go down, or not change in any pattern?

In (a), watch out for confusing gas used with gas left in the tank. Thinking "more driving means more gas" leads to the wrong answer of positive correlation. As miles driven goes up, the gallons of gas left in the tank goes down: negative correlation.
In (b), a locker number has nothing to do with how well a student knows history: no correlation.
In (c), as the number of items in the cart goes up, the total checkout bill generally goes up: positive correlation.
2

A scatter plot of 1212 used cars shows age in years on the horizontal axis and price in dollars on the vertical axis, with the cloud of dots slanting downward from left to right. A student draws a flat horizontal line across the middle so that 66 dots are above the line and 66 dots are below it, and claims it is a good line of fit. Explain why the student is wrong and how the line should be drawn instead.

Having half the dots above the line and half below is not enough to make a good line of fit. What does a flat line miss about how price generally changes as age increases?

The student's mistake is thinking that splitting the dots with 66 above and 66 below makes a good fit on its own. A flat horizontal line completely ignores the downward trend. Instead, the line of fit must sit in the center of the cloud and slant downward from left to right to follow the negative correlation.
3

A scatter plot shows the age of a puppy in weeks (xx) and its weight in pounds (yy). Two actual puppies in the data set are plotted at (2,5)\obs{(2, 5)} and (6,17)\obs{(6, 17)}, neither of which touches the line of fit. The line of fit itself crosses the vertical axis at (0,3)\fit{(0, 3)} and passes cleanly through the grid corner at (4,11)\fit{(4, 11)}. Write the equation of the line of fit, and explain what its yy-intercept and slope mean in real life.

First decide which pair of points measures the line itself rather than two individual puppies, then find the starting weight at 00 weeks and the pounds gained per week.

Be careful not to use the off-line puppy dots (2,5)\obs{(2, 5)} and (6,17)\obs{(6, 17)}. Using them gives the wrong slope of 12÷4=3\trial{12} \div \trial{4} = \trial{3} pounds per week and the wrong equation y=3x−1y = \trial{3}x - \trial{1}. Measuring the line itself from (0,3)\fit{(0, 3)} to (4,11)\fit{(4, 11)} shows an increase of 8\fit{8} pounds over 4\fit{4} weeks:
Slope=8 pounds÷4 weeks=2 pounds per week\displaystyle \begin{aligned}\text{Slope} &= \fit{8}\text{ pounds} \div \fit{4}\text{ weeks} \\ &= \fit{2}\text{ pounds per week}\end{aligned}
The yy-intercept of 3\fit{3} means the line predicts a weight of 3\fit{3} pounds at 00 weeks (birth). The slope of 2\fit{2} means the predicted weight increases by 2\fit{2} pounds for each additional week of age. The equation of the line of fit is y=2x+3y = \fit{2}x + \fit{3}.
4

A scatter plot tracks the hours a candle has been burning (xx) and its height in centimeters (yy). The left side of the graph is cut off so 00 hours is out of view, but the line of fit passes cleanly through the grid corners (3,21)\fit{(3, 21)} and (7,13)\fit{(7, 13)}. Find the starting height at 00 hours and write the equation of the line of fit.

Find how many centimeters the candle changes each hour between 33 and 77 hours, then walk backward 33 hours from (3,21)\fit{(3, 21)} to undo the burning back to 00 hours.

From 33 hours to 77 hours is an increase of 4\fit{4} hours, and the height drops from 21 cm\fit{21}\text{ cm} to 13 cm\fit{13}\text{ cm}, a change of −8 cm\fit{-8}\text{ cm}:
Slope=−8 cm÷4 hours=−2 cm per hour\displaystyle \begin{aligned}\text{Slope} &= \fit{-8}\text{ cm} \div \fit{4}\text{ hours} \\ &= \fit{-2}\text{ cm per hour}\end{aligned}
When walking backward 33 hours from (3,21)\fit{(3, 21)} to 00 hours, don't subtract 3×2=6 cm3 \times 2 = 6\text{ cm} to get 15 cm\trial{15}\text{ cm} (and y=−2x+15y = \fit{-2}x + \trial{15}). Because the candle was taller before those 33 hours of burning, going backward adds the 6 cm6\text{ cm} back on:
Starting height\displaystyle \text{Starting height} =21+6\displaystyle = \fit{21} + 6 =27 cm\displaystyle = \fit{27}\text{ cm}
The estimated starting height at 00 hours is 27 cm\fit{27}\text{ cm}, and the equation of the line of fit is y=−2x+27y = \fit{-2}x + \fit{27}.
5

A coach surveys swimmers who practiced between 2\surveyed{2} and 8\surveyed{8} hours per week (xx) and records the seconds they cut from their race time (yy). The line of fit has the equation y=1.5x+1y = \fit{1.5}x + \fit{1}. Use the equation to predict the seconds cut for a swimmer who practices 66 hours per week and for one who practices 4040 hours per week. Identify which prediction is interpolation, which is extrapolation, and explain why the 4040-hour prediction is less trustworthy.

Plug x=6x = 6 and x=40x = 40 into y=1.5x+1y = \fit{1.5}x + \fit{1}, then compare each practice time against the surveyed range of 2\surveyed{2} to 8\surveyed{8} hours (inter=inside\surveyed{\text{inter}} = \surveyed{\text{inside}}, extra=outside\outside{\text{extra}} = \outside{\text{outside}}).

After multiplying by 1.5\fit{1.5}, don't forget to add the +1+ \fit{1} starting value (leaving it out gives 99 seconds and 6060 seconds), and don't swap the labels interpolation and extrapolation.
For 6\surveyed{6} hours:
y=1.5(6)+1=9+1=10 seconds\displaystyle \begin{aligned}y &= \fit{1.5}(\surveyed{6}) + \fit{1} \\ &= 9 + \fit{1} = \fit{10}\text{ seconds}\end{aligned}
This is interpolation because 6\surveyed{6} hours is inside the surveyed range of 2\surveyed{2} to 8\surveyed{8} hours.
For 40\outside{40} hours:
y=1.5(40)+1=60+1=61 seconds\displaystyle \begin{aligned}y &= \fit{1.5}(\outside{40}) + \fit{1} \\ &= 60 + \fit{1} = \fit{61}\text{ seconds}\end{aligned}
This is extrapolation because 40\outside{40} hours is outside the surveyed range. The 61\fit{61}-second prediction is less trustworthy because the data do not show whether the same trend continues at 40\outside{40} hours. Fatigue or physical limits could change the trend.