Skip to content
Study Hall
Lesson 3 of 4Data and Mathematical Modelling
Unit 6 · Lesson 3 of 4

Scatter Plots, Correlation and Lines of Best Fit

Plot two-variable data on a scatter plot, describe the correlation by its direction, strength and form, draw a line of best fit and write its equation, use technology to fit linear, quadratic and exponential models, and know when a prediction can be trusted.

8 min read6 quick checks10 practice questionsInteractiveAsk AI about this →

Key things to remember

  1. 1Independent variable on the -axis, dependent variable on the -axis.
  2. 2Describe correlation by direction (positive, negative, none), strength (strong, weak) and form (linear, non-linear).
  3. 3The correlation coefficient is between and ; values near mean a strong linear pattern, values near mean little or no linear pattern.
  4. 4Line of best fit: from two points on the line, , then substitute one point into to find .
  5. 5Interpolation predicts inside the data's range; extrapolation predicts outside it and is less reliable.
  6. 6Correlation alone does not prove that one variable causes the other.

Suppose you run a snack stand at a summer sports field. Some days you sell 50 cold drinks, some days 140. You suspect the weather matters, so for 10 days you record two numbers: the high temperature and the number of drinks sold. Now each day gives a pair of values, and the question is no longer "what is typical?" but "how does one quantity change as the other changes?" That is two-variable data, and the first tool for it is a picture: the scatter plot. If the points form a clear pattern, you can describe it with an equation and use that equation to plan how much stock to buy tomorrow.

Variables and scatter plots

The independent variable is the one you think does the influencing, or the one you choose or measure first; it goes on the horizontal -axis. The dependent variable is the one you think responds; it goes on the vertical -axis. Here, temperature is independent and drinks sold is dependent: the weather might change sales, but sales cannot change the weather. Each day becomes one point . A scatter plot does not join the points with lines, because the days are separate observations.

Day12345678910
High temperature x (°C)14161820212325272931
Drinks sold y455862788095104120128145
Invented data: daily high temperature and cold drinks sold at a snack stand over 10 days.
10152025303504080120160High temperature x (°C): the independent variableDrinks sold y: the dependent variableday 5: x = 21, y = 80plotted as the point (21, 80)one dot per day; dots are not joined
Fig 1Scatter plot of the 10 days in the table, with temperature (independent) on the x-axis and drinks sold (dependent) on the y-axis. Day 5 is labelled as the point (21, 80); the dots are not joined.
Quick checkTry it before you read on
1
A lifeguard records the high temperature and the number of people at the beach each day. Which is the independent variable?
Quick checkTry it before you read on
2
Why are the points on a scatter plot not joined with lines?

Describing correlation: direction, strength, form

Correlation describes how two variables move together. Describe it in three parts. Direction: positive if tends to increase as increases (points rise to the right), negative if tends to decrease (points fall to the right), and none if there is no overall trend. Strength: strong if the points cluster tightly around a line or curve, weak if they are loosely scattered. Form: linear if the pattern follows a straight line, non-linear if it bends. Graphing technology also reports the correlation coefficient , a number from to that measures how close the points are to a straight line: values near mean strong positive linear correlation, near strong negative, and near little or no linear correlation. The drink data gives : strong, positive and linear.

xyStrong positiver ≈ 0.98xyWeak positiver ≈ 0.37xyNo correlationr ≈ 0xyWeak negativer ≈ −0.45xyStrong negativer ≈ −0.97xyNon-linear (curved)r ≈ −0.13
Fig 2Six scatter plots: strong positive, weak positive, no correlation, weak negative, strong negative, and a curved non-linear pattern, each labelled with its approximate correlation coefficient r.
Correlation does not prove causation
Two variables can rise together because a third variable drives both. On hot days a snack stand sells more cold drinks and a nearby clinic may see more sunburns, so drinks sold and sunburns would be positively correlated, but drinks do not cause sunburns: hot, sunny weather drives both. A hidden variable like this is called a lurking (or confounding) variable. The most direct way to show that one thing causes another is an experiment that changes one variable while keeping everything else the same.
Quick checkTry it before you read on
1
The points on a scatter plot fall to the right and lie close to a straight line. Which description fits?
Quick checkTry it before you read on
2
Which correlation coefficient describes points with almost no linear trend?
VideoKhan Academy looks at why two variables that move together may not have a cause-and-effect link, the idea behind this section's warning that correlation does not prove causation.Watch on YouTube

Drawing a line of best fit

When the correlation is linear, a line of best fit summarizes the trend. To draw one by eye: follow the direction of the points, put roughly as many points above the line as below it along its whole length, and pass through the middle of the cloud. The line does not have to pass through any data point. To find its equation , choose two points that lie on your line (easy grid points, far apart), find the slope, then substitute to find . For the drink data, a line drawn by eye passes through and .

1015202530354004080120160200High temperature x (°C)Drinks sold yextrapolation: y = 194 at 40 °Crun = 30 − 15 = 15rise = 136 − 49 = 87(15, 49)(30, 136)m = 87 ÷ 15 = 5.8, so y = 5.8x − 384 points above the line, 5 below, 1 on itsquares: points chosen on the line
Fig 3The snack stand points with the line y = 5.8x − 38. A slope triangle between the chosen points (15, 49) and (30, 136) shows rise 87 over run 15. Of the 10 data points, 4 lie above the line, 5 below and 1 on it. The dashed part from 31 °C to 40 °C is an extrapolation reaching 194 drinks.

The slope has a meaning in context: each extra degree Celsius goes with about 5.8 more drinks sold, on average. Graphing technology finds the line that fits best by a precise rule (least squares) and gives , very close to the line drawn by eye. But not every relationship is a straight line. A graphing tool (such as Desmos or a spreadsheet) can fit a quadratic model when the data rises and falls (or falls and rises) in a U shape, or an exponential model when the values multiply by about the same number each step. Look at the scatter plot first and choose the model whose shape matches; a high for a straight line does not prove the data is linear.

ModelShape of the pointsInvented dataEquation from technology (rounded)
LinearStraight trend; y changes by about the same amount for each step in xTemperature vs drinks sold (table above)y ≈ 5.8x − 38.5
QuadraticRises then falls (or falls then rises) in a U shapeBall height h (m) at t = 0, 0.5, 1, …, 4 s: 1.5, 11.2, 18.6, 23.4, 26.0, 26.1, 23.8, 19.0, 11.5h ≈ −4.9t² + 22.0t + 1.4
ExponentialValues multiply by about the same factor each step; curve gets steeperVideo views on days 0 to 6: 200, 290, 410, 600, 860, 1240, 1780
Three kinds of model fitted with technology to invented data sets.
Loading interactive…
Explore scatter plots with positive, negative and no correlation, compare the line of best fit with quadratic and exponential fits, and predict by interpolation or extrapolation.
AInterpolation
  • Predicting inside the range of the data
  • Example: drinks sold at 22 °C (data runs 14 °C to 31 °C)
  • Usually reliable when the correlation is strong
BExtrapolation
  • Predicting outside the range of the data
  • Example: drinks sold at 40 °C
  • Risky: the pattern may change where you have no data
Why extrapolation is risky
The line predicts drinks at 40 °C, but on a dangerously hot day fewer people might come to the field at all, or the stand might simply run out. Nothing in the data tells you how people behave at 40 °C. The -intercept is an extrapolation too: would mean "minus 38 drinks at 0 °C," which is impossible. Treat an extrapolated value as a rough guess and say so.
Quick checkTry it before you read on
1
When you draw a line of best fit by eye, which line should you aim for?
Quick checkTry it before you read on
2
A line of best fit passes through the points and , both on the line. Write its equation in the form .
VideoAn Ontario teacher plots scatter plots, describes the correlation and fits a line to the data to make predictions.Watch on YouTube

Worked examples

Reveal one step at a time and try to beat it to the next line.

Example 1
For the snack stand data, a line of best fit drawn by eye passes through and . Find its equation and predict the drinks sold on a 22 °C day. Is this interpolation or extrapolation?
Example 2
(Invented data.) For 10 people, technology fits daily screen time (hours) against hours of sleep and reports with . Describe the correlation, interpret the slope, and predict the sleep for 3 hours of screen time.
Example 3
(Invented data.) Views of a video on days 0 to 6 were 200, 290, 410, 600, 860, 1240, 1780. Should you use a linear or exponential model? Technology gives . Predict the views on day 8.

Where marks get lost

  • Putting the dependent variable on the x-axis. Ask which variable responds to the other; that one goes on the y-axis.
  • Forcing the line of best fit through the first and last data points, or joining the points dot to dot. The line follows the overall trend with points on both sides.
  • Using two data points that are not on your line to find its equation. Use points that lie on the line you drew.
  • Concluding that one variable causes the other just because they are strongly correlated.
  • Trusting an extrapolated prediction as much as an interpolated one.

Flashcards 8

Independent variable
Dependent variable
Positive correlation
Negative correlation
+ 4 more

Practice

1
You study how the number of hours a part-time worker works affects their weekly pay. Which variable belongs on the x-axis?
2
Which correlation coefficient shows the strongest linear relationship?
3
Using the line of best fit for the snack stand, predict the drinks sold on a 25 °C day.
drinks
4
A line of best fit passes through and . What is its slope?
5
Data on plant height was collected for days 1 to 20. Which prediction is an extrapolation?
6
Across many towns, the number of fire trucks sent to a fire is positively correlated with the damage done. What is the best explanation?
7
What is the name for predicting a value outside the range of the collected data?
8
The model gives the views of a video on day . Find the views on day 3, rounded to the nearest whole number.
views
9
Match each description of a scatter plot to the best model.
y goes up by about the same amount for each step in x
y rises to a peak and then falls, in an upside-down U shape
y is multiplied by about the same factor for each step in x
Points are scattered with no trend at all
10
Put the steps for making a prediction from a scatter plot in order.
  1. 1Substitute the new x-value and state whether it is interpolation or extrapolation
  2. 2Choose two points on the line and find its equation
  3. 3Draw a line of best fit through the middle of the points
  4. 4Plot the data with the independent variable on the x-axis
  5. 5Describe the direction, strength and form of the correlation

Spot a mistake on this page? Let us know