DoAssignment study guide

D1.3 · Analyse two-variable data with scatter plots and regression

Learn to analyse two-variable data with scatter plots and regression through clear examples and targeted practice.

Ontario Grade 9 Mathematics

Data

Analysing Two-Variable Data Using Scatter Plots and Regression (MTH1W – D1.3)

Have you ever wondered whether students who study more tend to score higher on tests? Or whether taller basketball players tend to score more points? Both questions involve two variables — two quantities that we measure together for the same person or object. When we collect pairs of values like this, we can look for a pattern between them. In this lesson you will learn how to display two-variable data on a scatter plot, describe any pattern you see, draw a line of best fit, write its equation, and use that equation to make predictions. All of these ideas connect directly to the linear relations you studied in earlier grades.

What you will learn

  • Construct and read a scatter plot for two-variable data.
  • Describe the type, direction, and strength of a linear correlation.
  • Draw a line of best fit and write its equation in the form y = mx + b.
  • Use the equation of the line of best fit to make reasonable predictions.
  • Recognise the difference between interpolation and extrapolation, and explain when each is reliable.

Prerequisite Review: Linear Equations and Plotting Points

Before working with scatter plots, let's quickly review two skills you already have. First, plotting a point on a coordinate grid: a point written as (x, y) is placed x units along the horizontal axis and y units along the vertical axis. Second, the equation of a straight line: y = mx + b, where m is the slope (how steeply the line rises or falls) and b is the y-intercept (where the line crosses the vertical axis). You will use both of these skills throughout this lesson.
Slope tells you how much y changes for every 1-unit increase in x. For example, if m = 3, then each time x goes up by 1, y goes up by 3. If m is negative, y decreases as x increases. The y-intercept b is simply the value of y when x = 0. Keeping these ideas in mind will make the rest of the lesson straightforward.
m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}
  • A point (x, y) is plotted horizontally at x and vertically at y.
  • The line equation y=mx+by = mx + b has slope mm and y-intercept bb.
  • Slope mm = rise ÷ run = change in yy ÷ change in xx.
  • When m>0m > 0 the line rises left to right; when m<0m < 0 it falls.

What Is a Scatter Plot?

A scatter plot is a graph that shows the relationship between two numerical variables. Each data point represents one individual (a person, an object, a trial). One variable is shown on the horizontal axis (the x-axis) and the other on the vertical axis (the y-axis). Each individual becomes a single dot on the grid at the coordinates matching its two values.
For example, imagine you record the number of hours each of ten classmates studied for a quiz, and their quiz score out of 20. The independent variable — the one you think influences the other — goes on the x-axis. That is the number of study hours. The dependent variable — the one you think is influenced — goes on the y-axis. That is the quiz score. Plotting all ten data pairs gives you a scatter plot.
Once the dots are on the graph, you look at the overall shape. Do the dots drift upward from left to right, downward, or in no clear direction? This overall pattern is called the correlation between the two variables.
Each data point=(xindependent, ydependent)\text{Each data point} = (x_{\text{independent}},\, y_{\text{dependent}})
  • Each dot on a scatter plot represents one pair of values (x, y).
  • The independent variable goes on the x-axis; the dependent variable goes on the y-axis.
  • The pattern of the dots shows the correlation between the two variables.
  • Correlation describes direction (positive or negative) and strength (strong, moderate, or weak).

Describing Correlation: Direction and Strength

Direction comes first. If the dots generally rise from lower-left to upper-right, the correlation is positive — as x increases, y tends to increase too. If the dots fall from upper-left to lower-right, the correlation is negative — as x increases, y tends to decrease. If there is no clear rising or falling pattern, we say there is no linear correlation.
Strength describes how closely the dots follow a straight-line pattern. When the dots lie very close to an imaginary straight line, the correlation is strong. When they are more spread out but still show a direction, it is moderate. When the dots are scattered with only a faint direction, it is weak. Putting direction and strength together, you might describe a scatter plot as showing a 'strong positive linear correlation' or a 'weak negative linear correlation'.
It is important to remember that correlation does not mean causation. Just because two variables are related does not mean one causes the other. For example, cities with more ice-cream shops also tend to have more sunburns — but ice cream does not cause sunburn. Both are related to a third factor: hot weather. Always think critically about what a correlation really means.
Positive: m>0Negative: m<0None: no clear trend\text{Positive: } m > 0 \qquad \text{Negative: } m < 0 \qquad \text{None: no clear trend}
  • Positive correlation: both variables increase together.
  • Negative correlation: as one variable increases, the other decreases.
  • No linear correlation: dots show no clear straight-line pattern.
  • Strength (strong, moderate, weak) describes how closely dots follow a line.
  • Correlation does not prove causation.

Drawing a Line of Best Fit and Writing Its Equation

When a scatter plot shows a linear correlation, you can draw a line of best fit (sometimes called a trend line). This is a straight line that best represents the direction and spread of the data. It does not have to pass through any specific dot, but it should pass through the middle of the data cloud — roughly the same number of dots above it and below it.
To anchor the line in the right place, first find the centroid of the data. The centroid is the point whose x-coordinate is the mean of all x-values and whose y-coordinate is the mean of all y-values. Your line of best fit must pass through this point. Once you draw the line through the centroid with the data balanced above and below it, pick two clear points that lie exactly on the line (they do not have to be original data points). Use those two points to calculate slope with the slope formula, then substitute the slope and one of the points into y = mx + b and solve for b.
Using technology such as a graphing calculator or spreadsheet, you can use a built-in linear regression feature to obtain the equation of the best-fit line automatically. Whether you draw the line by hand or use technology, the result is a linear equation y = mx + b that models the relationship in the data. At this course level, the key skill is interpreting and using this equation, not deriving it by hand from formulas.
y=mx+by = mx + b
  • The line of best fit passes through the centroid (mean of x, mean of y) and balances the data cloud.
  • Pick two points that lie exactly on the drawn line — they may not be actual data points — to calculate slope.
  • Substitute slope and one point into y=mx+by = mx + b to find the y-intercept bb.
  • Technology (graphing calculator or spreadsheet) can perform linear regression to find the equation.
  • The equation y=mx+by = mx + b models the linear relationship between the two variables.

Using the Equation to Make Predictions: Interpolation and Extrapolation

Once you have the equation of the line of best fit, you can substitute any x-value into it to predict the matching y-value. There are two types of predictions, and they have very different levels of reliability.
Interpolation means predicting a y-value for an x-value that falls inside the range of your original data. For example, if your study-hours data ranges from 1 hour to 8 hours and you predict a score for 5 hours, that is interpolation. This type of prediction is generally reliable because you are staying within the territory the data covers.
Extrapolation means predicting a y-value for an x-value that falls outside the range of your original data — either below the smallest x or above the largest x. For example, predicting a score for 15 study hours when your data only goes up to 8 hours is extrapolation. This is far less reliable because you are assuming the linear pattern continues beyond what you have actually observed. The further you extrapolate, the less trustworthy the prediction becomes. Always state whether a prediction is interpolated or extrapolated, and comment on its reliability.
y = mx + b (substitute x to predict y)
  • Substitute an x-value into the equation to predict the corresponding y-value.
  • Interpolation: x is within the data range — generally reliable.
  • Extrapolation: x is outside the data range — less reliable; treat with caution.
  • State which type of prediction you are making when answering questions.

Types of Correlation at a Glance

TypeWhat the dots look likeSlope of best-fit lineExample
Strong positiveTight cluster rising left to rightm>0m > 0, steepHours studied vs. quiz score
Moderate positiveLoose drift rising left to rightm>0m > 0, gentleHeight vs. shoe size
No linear correlationDots spread with no clear directionNear zero or no line fits wellEye colour vs. test score
Moderate negativeLoose drift falling left to rightm<0m < 0, gentleHours of TV vs. GPA
Strong negativeTight cluster falling left to rightm<0m < 0, steepSpeed of typing vs. error rate

Study Hours and Quiz Score Data

Hours studied (x)Quiz score out of 20 (y)
16
28
310
411
513
615
716
818

Worked example

Study Hours and Quiz Scores

A teacher records the number of hours eight students studied and their quiz score out of 20. The data pairs (hours, score) are: (1, 6), (2, 8), (3, 10), (4, 11), (5, 13), (6, 15), (7, 16), (8, 18). (a) Describe the correlation. (b) Find the centroid. (c) Two points that lie on the hand-drawn line of best fit are (2, 8) and (7, 16). Find the equation of the line. (d) Predict the score for a student who studied 4.5 hours. State whether this is interpolation or extrapolation. (e) Predict the score for a student who studied 12 hours. Comment on reliability.
  1. Step 1 – Describe the correlation
    Looking at the data pairs, as the number of hours increases from 1 to 8, the scores increase from 6 to 18. The dots would rise from lower-left to upper-right in a tight pattern. This indicates a strong positive linear correlation.
    Direction: positiveStrength: strong\text{Direction: positive} \qquad \text{Strength: strong}
  2. Step 2 – Find the centroid
    Add all x-values (hours) and divide by 8 to get the mean of x. Add all y-values (scores) and divide by 8 to get the mean of y. The centroid is the point (mean x, mean y). The line of best fit must pass through this point.
    xˉ=1+2+3+4+5+6+7+88=368=4.5,yˉ=6+8+10+11+13+15+16+188=978=12.125\bar{x} = \frac{1+2+3+4+5+6+7+8}{8} = \frac{36}{8} = 4.5, \qquad \bar{y} = \frac{6+8+10+11+13+15+16+18}{8} = \frac{97}{8} = 12.125
  3. Step 3 – Calculate the slope using two points on the line
    The two points on the drawn line are (2, 8) and (7, 16). Apply the slope formula: change in y divided by change in x. This means for every extra hour of study, the predicted score increases by 1.6 points.
    m=16−87−2=85=1.6m = \frac{16 - 8}{7 - 2} = \frac{8}{5} = 1.6
  4. Step 4 – Find the y-intercept
    Substitute the slope m = 1.6 and the point (2, 8) into y = mx + b. Solve for b by isolating it. The y-intercept b = 4.8 means the model predicts a score of 4.8 when study time is 0 hours.
    8=1.6(2)+b  ⟹  8=3.2+b  ⟹  b=4.88 = 1.6(2) + b \implies 8 = 3.2 + b \implies b = 4.8
  5. Step 5 – Write the equation
    Combine the slope and y-intercept into the standard linear form. Here x represents hours studied and y represents the predicted quiz score.
    y=1.6x+4.8y = 1.6x + 4.8
  6. Step 6 – Predict for 4.5 hours (interpolation)
    Substitute x = 4.5 into the equation. Since 4.5 is inside the data range of 1 to 8 hours, this is interpolation and the prediction is reliable.
    y=1.6(4.5)+4.8=7.2+4.8=12y = 1.6(4.5) + 4.8 = 7.2 + 4.8 = 12
  7. Step 7 – Predict for 12 hours (extrapolation)
    Substitute x = 12 into the equation. Since 12 is greater than the maximum x-value of 8 in the data, this is extrapolation. The prediction is unreliable because the linear pattern may not continue that far. The result of 24 also exceeds the maximum possible score of 20, which is a clear sign the model has broken down outside the data range.
    y=1.6(12)+4.8=19.2+4.8=24y = 1.6(12) + 4.8 = 19.2 + 4.8 = 24
Answer: Equation of line of best fit: y=1.6x+4.8y = 1.6x + 4.8. Predicted score for 4.5 hours: 12 out of 20 (interpolation — reliable). Predicted score for 12 hours: 24 (extrapolation — unreliable; a result above 20 is impossible for a quiz marked out of 20, confirming the model is not valid that far outside the data range).
Check: To check the line's position, substitute the centroid's x-value into the equation: y=1.6(4.5)+4.8=7.2+4.8=12y = 1.6(4.5) + 4.8 = 7.2 + 4.8 = 12. The centroid is (4.5, 12.125) and the line gives y = 12 at x = 4.5. These values are very close, which confirms the hand-drawn line is passing through approximately the right centre point. The small difference of 0.125 is expected because a hand-drawn line is not perfectly precise.

Common mistakes and how to avoid them

Forcing the line of best fit through the origin (0, 0) or through a specific data point.
Correction: The line of best fit passes through the centroid (mean x, mean y) and balances the data cloud. It does not need to touch any particular dot or the origin.
Using two original data points to calculate the slope instead of two points on the drawn line.
Correction: Pick two points that lie exactly on your drawn line — they may not be actual data points. Using data points that are not on the line gives a slope that does not match your line.
Confusing direction (positive/negative) with strength (strong/moderate/weak).
Correction: Direction and strength are two separate descriptions. A correlation can be strongly negative or weakly positive. Always name both when describing a scatter plot.
Treating an extrapolated prediction as reliable.
Correction: Extrapolation predicts outside the range of the data. The linear pattern may not continue there, so extrapolated predictions are uncertain and should always be described as less reliable.
Concluding that a strong correlation means one variable causes the other.
Correction: Correlation shows a relationship, not a cause. A third hidden factor could be causing both variables to change together. Always think critically before claiming causation.

Lesson summary

  • A scatter plot displays two-variable data as dots on a coordinate grid, with the independent variable on the x-axis and the dependent variable on the y-axis.
  • Correlation is described by its direction (positive, negative, or none) and its strength (strong, moderate, or weak).
  • The line of best fit passes through the centroid (mean x, mean y) and balances the number of points above and below it.
  • The equation of the line of best fit has the form y=mx+by = mx + b; find mm using two points on the line, then solve for bb.
  • Interpolation (predicting within the data range) is more reliable than extrapolation (predicting outside the data range).
  • Correlation does not imply causation; a hidden third variable may explain the relationship.

Check your understanding

Question 1

A scatter plot shows that as the outside temperature increases, hot chocolate sales decrease. What type of correlation does this show?
  1. Strong positive linear correlation
  2. No linear correlation
  3. Weak positive linear correlation
  4. Negative linear correlation
Show answer and explanation
Negative linear correlation
As temperature (x) increases, sales (y) decrease, so the line of best fit would slope downward — this is a negative linear correlation. The question does not give enough information to judge strength precisely, but the direction is clearly negative.

Question 2

The line of best fit for a data set is y=2.5x+3y = 2.5x + 3. What is the predicted y-value when x=4x = 4?
  1. 10
  2. 13
  3. 14
  4. 11
Show answer and explanation
13
Substitute x = 4: y=2.5(4)+3=10+3=13y = 2.5(4) + 3 = 10 + 3 = 13. The correct answer is 13.

Question 3

A student's data on hours of sleep (x) and reaction time in milliseconds (y) ranges from x = 4 to x = 9. She uses the equation to predict a reaction time for x = 11 hours. What type of prediction is this, and is it reliable?
  1. Interpolation; reliable
  2. Extrapolation; reliable
  3. Interpolation; unreliable
  4. Extrapolation; unreliable
Show answer and explanation
Extrapolation; unreliable
Since x = 11 is beyond the maximum data value of x = 9, this is extrapolation. Extrapolated predictions are unreliable because the linear pattern may not continue outside the range of the data.

Question 4

Which of the following is always true about a correctly drawn line of best fit?
  1. It passes through every data point on the scatter plot.
  2. It passes through the origin.
  3. It passes through the centroid of the data.
  4. It always has a positive slope.
Show answer and explanation
It passes through the centroid of the data.
The line of best fit must pass through the centroid — the point (mean of x, mean of y). It does not need to pass through any individual data point, the origin, or have a positive slope.

Key terms

Two-variable data
Data where two numerical values are recorded for each individual, allowing you to look for a relationship between them.
Scatter plot
A graph where each pair of values is plotted as a single dot; used to show the relationship between two numerical variables.
Independent variable
The variable that is thought to influence the other; plotted on the horizontal (x) axis.
Dependent variable
The variable that is thought to be influenced by the independent variable; plotted on the vertical (y) axis.
Correlation
The relationship between two variables in a scatter plot, described by its direction (positive or negative) and strength (strong, moderate, or weak).
Line of best fit (trend line)
A straight line drawn through a scatter plot that best represents the overall direction and spread of the data; passes through the centroid.
Centroid
The point (mean of x, mean of y); the balance point of the data through which the line of best fit must pass.
Extrapolation
Using the line of best fit to predict a y-value for an x-value that falls outside the range of the original data; less reliable than interpolation.

Continue through MTH1W

View the complete MTH1W Ontario Grade 9 Mathematics curriculum and lessons

Use the free MTH1W test and exam review guide

About this lesson and its review

Published by DoAssignment. This reviewed lesson follows Ontario Grade 9 Mathematics (MTH1W), expectation D1.3. It is a study resource, not an official curriculum publication.

Before publication, content is checked for structure, mathematical or chemical notation, calculations, course boundaries, and readability. Errors can still occur, so corrections are welcomed.

Official curriculum reference

Report a correction or ask a question