IB Mathematics: Analysis and Approaches — AA SL · Topic 4
Linear Correlation and Regression
Use paired data to find a model, make predictions and decide when those predictions are sensible.
Can study time help us predict a test score?
Eight students recorded their study times and test scores. None studied for exactly 5.5 hours. Can we use the pattern in their data to estimate a score for a similar student who studies for 5.5 hours?
What the regression line allows us to do
Here \(x\) is study time (hours), \(y\) is the observed score and \(\hat y\) (“\(y\)-hat”) is the predicted score, both out of 100. The rounded equation gives
\[\hat y\approx4.45x+38.0.\]For \(x=5.5\),
\[\hat y\approx4.45(5.5)+38.0\approx\boxed{62.5\text{ marks}}.\]The diamond is a prediction; \(\hat y\) need not equal the observed score \(y\).
Why learn this? We will find the regression line, use it to predict, and judge when predictions are sensible. The coefficient \(r\) measures the strength and direction of linear association; \(r\) alone does not measure prediction accuracy. We will compare interpolation (within the observed range) with extrapolation (outside it), which needs greater caution.
Learning goal
Read paired data, fit and use a straight-line model, and explain when its predictions are sensible.
Syllabus link
AA SL: SL 4.4. Scatter diagrams, correlation, regression and prediction.
Big idea
A pattern in observed data can help us estimate an unobserved value. A model needs interpretation as well as calculation.
Key relationship
\(\hat y=ax+b\) predicts \(y\) from \(x\). Use the scatter diagram and \(r\) to assess the linear association.
Before you start: recall coordinates, means, gradients and \(y=ax+b\). Try each checkpoint before reading its answer immediately below. All datasets are invented for learning.
From one variable to two variables
A variable is something we record or measure, such as study time or test score.
Univariate: one variable
Univariate data record one variable, such as each student’s test score.
Univariate analysis describes these values using averages, spread or graphs.
Bivariate: two variables
Bivariate data record two measurements for each person, object or occasion.
Bivariate analysis studies the relationship between the paired values.
Read the pair together: \((4,58)\) means that one student studied for 4 hours and scored 58 marks. Both numbers belong to the same student.
Next, we plot the pairs to see their relationship.
From pairs to a scatter diagram
A scatter diagram shows each pair as one point, so that we can see the relationship.
Choose the axes, then plot each pair
Put \(x\), the variable used to help predict, on the horizontal axis. Put \(y\), the variable we want to predict, on the vertical axis. Label the variables and units, using evenly spaced scales.
To plot \((4,58)\), move across to \(x=4\), then up to \(y=58\). Mark one point. Do not join the points.
Describe the pattern: its form, direction and how closely the points follow a straight line.
Worked example 1: read the pattern in context
Eight students record their study times and test scores. Each column gives one student’s pair.
| Study time \(x\) (hours) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Test score \(y\) (out of 100) | 42 | 49 | 47 | 58 | 61 | 67 | 65 | 75 |
- Describe the relationship shown by the data and scatter diagram.
- Explain why the rising trend does not mean that every student who studies longer has a higher score.
Solution
(a) There is a strong positive, approximately linear relationship: students who study for longer tend to score higher.
(b) The points do not all lie on one line. The student who studied for 3 hours scored 47, while the student who studied for 2 hours scored 49. The general pattern does not apply to every student.
Recognise the possible patterns
Our study-time data show one kind of relationship. Compare them with these other patterns before deciding whether a straight line is suitable.
Describe the form, direction and strength
Form: approximately linear (following a straight line), curved, or no clear pattern.
Direction: as \(x\) increases, \(y\) tends to increase (positive) or decrease (negative).
Linear strength: points close to a straight line show a strong linear relationship; more scattered points show a weaker one.
A relationship does not have to be linear
The last graph has a clear curved pattern. A straight line would not describe it well. A measure designed for linear relationships can therefore miss an important pattern. This is why we inspect the scatter diagram first.
An association is a relationship between variables. Linear correlation describes how closely the points follow a straight line. Also look for an outlier: a point that does not follow the main pattern.
Checkpoint A
A school records each student’s height and arm span. Explain why the data are bivariate. If we use height to predict arm span, which variable belongs on each axis?
Answer
The data are bivariate because there are two measurements from each student. Each pair must refer to the same student. Put height on the horizontal axis and arm span on the vertical axis, since arm span is being predicted.
When the scatter diagram shows an approximately straight pattern, a line can help us estimate one variable from the other. We now learn to draw a line of best fit by eye.
Draw a line of best fit by eye
Before we find the regression line with a calculator, it is important to understand an alternative: drawing a line of best fit by eye. We choose a line that follows the overall pattern. The regression line then gives THE optimum line of best fit, chosen by a precise mathematical rule.
The mean point gives an average position
\(\bar x\) (“\(x\)-bar”) is the mean of the \(x\)-values; \(\bar y\) is the mean of the \(y\)-values. Together they give the mean point, \(M=(\bar x,\bar y)\). Draw a line by eye through this central point, following the overall pattern.
Worked example 2: draw a line of best fit, step by step
Eight students record their study times and test scores.
| Study time \(x\) (hours) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Test score \(y\) (out of 100) | 42 | 49 | 47 | 58 | 61 | 67 | 65 | 75 |
- Calculate the coordinates of the mean point.
- Draw a scatter diagram and a line of best fit by eye.
- Use two points on your drawn line to find one possible equation.
Solution
(a) Calculate both means. There are \(n=8\) pairs of values, so divide each total by 8:
\[\begin{aligned}\bar x&=\frac{1+2+3+4+5+6+7+8}{8}=\frac{36}{8}=4.5,\\\bar y&=\frac{42+49+47+58+61+67+65+75}{8}=\frac{464}{8}=58.\end{aligned}\]The mean study time is 4.5 hours and the mean score is 58 marks, so \(\boxed{M=(4.5,58)}\).
(b) Steps 1 and 2: plot the data, then mark the mean point
- Plot the eight pairs. Use study time on the horizontal axis and score on the vertical axis, as in Worked example 1.
- Mark \(M=(4.5,58)\). Move to \(x=4.5\), halfway between 4 and 5, then up to \(y=58\). Mark the point and label it \(M\).
Steps 3–5: turn the ruler, check and draw
- Turn the ruler, keeping it through \(M\). Place the ruler’s straight edge through \(M\). Turn it to follow the rising pattern, but keep the edge through \(M\). Compare a line that is not steep enough with one that is too steep.
- Check all the points. Aim to have about as many points above the line as below it. Also check that the points are reasonably close to the line.
5. Draw the line. Draw one straight line across the graph, keeping it through \(M\).
(c) Find the gradient \(a\) and intercept \(b\)
Write the line as \(y=ax+b\). Choose two points far apart on the line you drew. They do not have to be data points. Here, use \(P=(0.5,40)\) and \(Q=(8.5,76)\).
Because the line passes through \(M=(4.5,58)\), substitute this point into \(y=4.5x+b\):
\[58=4.5(4.5)+b\quad\Longrightarrow\quad b=37.75.\]One reasonable by-eye line is therefore \(\boxed{y=4.5x+37.75}\).
What makes this a reasonable drawing?
It passes through \(M\) and follows the general pattern. The numbers of points above and below do not have to be exactly equal. Do not just join the first and last data points, or force the line through \((0,0)\). More than one by-eye line can be reasonable.
Your turn: choose a line and find its equation
We have seen one reasonable drawing. Now make the choices yourself. Use the plot below or redraw it on graph paper. Cover the answer while you work.
Checkpoint B
The same eight students have these paired measurements:
| Study time \(x\) (hours) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Test score \(y\) (out of 100) | 42 | 49 | 47 | 58 | 61 | 67 | 65 | 75 |
- Mark the mean point \(M=(4.5,58)\). Draw your own reasonable line of best fit through it.
- Choose two points far apart on your line. Use them to find one possible equation \(y=ax+b\).
Record your two points \(P\) and \(Q\), your gradient, and your equation.
Answer
Your line should pass through \(M\), follow the overall pattern and lie reasonably close to the observations. Your two chosen points must lie on your drawn line; they need not be observations.
Calculate \(a=(y_Q-y_P)/(x_Q-x_P)\), then use \(58=4.5a+b\) to find \(b\). As a check, your equation should give approximately 58 when \(x=4.5\), allowing for graph-reading accuracy.
The example’s \(y=4.5x+37.75\) is one acceptable answer. A different reasonable drawing can give a different equation. Assess the drawing and method as well as the numbers.
Several reasonable drawings are possible. Next, we introduce the calculated regression line and learn what its equation tells us.
The regression line: a calculated line of best fit
Different lines drawn by eye can give different predictions. The regression line of \(y\) on \(x\) is a calculated line for predicting \(y\) from \(x\). We can think of it as THE optimum line of best fit to the observed data, with “optimum” defined by the fitting rule below.
Read the model \(\hat y=ax+b\)
We write \(y\) for an observed value and \(\hat y\) (“\(y\)-hat”) for the value predicted by the line.
Gradient \(a\): the predicted change in \(y\) when \(x\) increases by 1. Give its units as \(y\)-units per \(x\)-unit.
Intercept \(b\): the predicted value of \(y\) at \(x=0\). Check whether \(x=0\) makes sense and is supported by the data.
The regression line, like the line of best fit we drew by eye, passes through the mean point \((\bar x,\bar y)\), so \(\boxed{\bar y=a\bar x+b}\).
Before using the TI-Nspire CX, learn to interpret and use the equation it gives us.
Worked example 3: interpret the fitted model
For study time \(x\) hours and score \(y\) out of 100, technology gives
\[\hat y=4.452380952\ldots x+37.964285714\ldots.\]Our line drawn by eye, \(\hat y=4.5x+37.75\), has slightly different coefficients.
The data cover 1–8 hours. The student who studied for 6 hours scored 67.
- Interpret the gradient and intercept.
- Predict the score at 6 hours.
- Explain why the prediction differs from the observed score.
Solution
(a) Each extra hour predicts about 4.45 more marks. At 0 hours, the model predicts about 38.0 marks, but 0 hours is outside the observed range, so that prediction has limited support.
(b) Substitute \(x=6\), using the unrounded coefficients:
\[\begin{aligned}\hat y(6)&=4.452380952\ldots(6)+37.964285714\ldots\\&\approx\boxed{64.7\text{ marks}}.\end{aligned}\](c) The line describes an overall trend. It need not pass through each observation, so the predicted score of 64.7 marks can differ from the observed score of 67.
The method behind the regression line
The method of least squares chooses the line that minimizes the total of the squared vertical differences between the observations and the line.
For section 4.4, find the coefficients with technology. Read more about the method of least squares in the optional appendix, which explains the rule using residuals and square areas; those calculations are not required here.
IB questions often write \(y=ax+b\); the hat simply identifies a prediction.
Checkpoint C
A bicycle’s predicted resale value is \(\hat y=-74.9x+899\) euros, where \(x\) is its age in years. (a) Interpret the gradient. (b) Predict the value at 4 years. Must the actual selling price equal this prediction?
Answer
(a) The model predicts a decrease of €74.90 in value per additional year of age.
(b) \(\hat y(4)=-74.9(4)+899=\boxed{\text{€599.40}}\). This describes the overall pattern; an individual bicycle’s actual selling price may differ.
Next, we learn to find and store the equation on the TI-Nspire CX, then use it to predict.
TI-Nspire CX: find and use the regression line
Here we learn to find and store the regression line on the TI-Nspire CX, then use it to predict the score at 6 hours of study.
Your route
To calculate the equation and predict, complete Steps 1 and 3–8. For calculator plots, also complete Steps 2 and 9. If you skip Step 2, inspect the supplied scatter diagram in Section 2 before fitting the line.
Choose Home → New Document → Add Lists & Spreadsheet. Keep all pages in the same problem so they share the lists and saved equation.
| Study time, \(x\) (hours) | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Score, \(y\) (out of 100) | 42 | 49 | 47 | 58 | 61 | 67 | 65 | 75 |
1. Enter the paired data.
Name the columns hours and score. Enter all eight pairs from row 1, below the formula row marked \(=\).

2a. Add a Data & Statistics page.
From the spreadsheet, choose Doc → Insert → Data & Statistics.

2b. Choose the horizontal variable.
Select Click to add variable below the plot, then choose hours.

2c. Choose the vertical variable.
Select Click to add variable on the left, then choose score.

2d. Check your scatter diagram.
Look for eight points, with hours on the horizontal axis and score on the vertical axis.

3. Open Statistics.
Return to Lists & Spreadsheet. Press Menu, then choose Statistics.

4. Open Stat Calculations.
Choose Stat Calculations.

5. Choose the linear model.
Select Linear Regression (mx+b). Here \(m\) is the gradient and \(b\) the intercept.

We have checked the scatter diagram and selected linear regression. Next, choose the two lists and save the equation so that we can use it to make predictions.
6. Choose the lists and save.
Set X List to hours, Y List to score, and Save RegEqn to f1. Leave Frequency List as 1. Select OK.

f1 to make predictions. It stores the full regression equation, ready to use in Step 8.7. Read the fitted equation.
Read \(m\approx4.452381\) and \(b\approx37.964286\). These match Worked example 3.

8. Use the stored equation to predict the score at 6 hours
We saved the line as f1. Now use it to predict a score without rounding the coefficients.
8a. Add a Calculator page.
Choose Doc → Insert → Calculator. Keep the new page in the same problem as the data and regression.

8b. Select the stored function.
Press var, highlight f1, then press Enter to insert its name.

8c. Enter the study time.
Complete the entry as f1(6). The number 6 is the study time in hours.

8d. Calculate the prediction.
Press Enter. The calculator gives the model’s predicted score.

The model predicts about 64.7 marks for 6 hours. This is an estimate; the recorded score was 67.
Checkpoint D
Find and use a new model independently. Save your study-time document, then start a separate document for this checkpoint. Keep its data and Calculator page in the same problem.
A driver records distance travelled and fuel used for five comparable journeys:
| Distance (km) | 20 | 40 | 60 | 80 | 100 |
|---|---|---|---|---|---|
| Fuel used (litres) | 1.8 | 3.1 | 4.6 | 6.0 | 7.2 |
Try the following without consulting the button-by-button guide.
- Use distance to predict fuel use. Check that the pairs follow an approximately straight pattern, choose the X and Y lists, and find the regression equation. Store it as
f1. - Use the stored equation to predict the fuel used for a 50 km journey. State the command and give the prediction to three significant figures.
Answer to Checkpoint D
(a) The pairs follow an approximately straight, rising pattern. Put distance in X List and fuel used in Y List. Technology gives \(\boxed{\hat y=0.0685x+0.43}\), where \(x\) is distance in kilometres and \(\hat y\) is predicted fuel use in litres. Save the equation to f1.
(b) Enter f1(50): \(3.855\text{ litres}\approx\boxed{3.86\text{ litres}}\).
If your result differs: check all five paired rows, the X and Y lists, and that the new equation is saved to f1. Keep full stored values until the final answer.
Return to your saved study-time document. Follow optional Step 9, or go directly to Section 6. Its original lists, regression equation and results are still there.
9. Optional: display the regression line on the scatter diagram
Return to the same Data & Statistics page as in Step 2d: the existing scatter diagram with hours on the horizontal axis and score on the vertical axis.
Step 2d shows tab 1.2; the screenshots below show tab 1.3. The tab number can change when pages are inserted. Identify the page by its scatter diagram.
Why display the points and fitted line?
Exam questions will rarely require you to display both the data points and the regression line on your calculator screen. These plots can still help you see the pattern in your data and are useful for Internal Assessment (IA) work.
You must still be able to read and sketch scatter diagrams and calculate, interpret and use regression equations when a question requires them.
9a. Open Analyze.
On this scatter-diagram page, press Menu, then choose Analyze.

9b. Open Regression.
In the Analyze menu, choose Regression.

9c. Choose the linear fit.
Select Show Linear (mx+b), then press Enter.

9d. Check the displayed line.
The same eight points now appear with their regression line.

The line follows the overall pattern; individual observations can lie above or below it. Use the full stored equation, f1, for predictions.
If your result differs
| What you notice | What to check |
|---|---|
| A list name is unavailable | Name the column in its name cell above the formula row. Keep the new page in the same problem. |
| Different gradient or intercept | Enter all eight pairs. Use hours for X List and score for Y List; leave Frequency List as 1. |
f1(6) gives no useful result | Save the regression equation to f1; use a Calculator page in the same problem. |
| The points or line look wrong | Check each pair against the table. If sorting, move whole rows so each student’s measurements stay together. |
Finding the Regression Line Equation, Correlation Coefficient, and Predicting Values | TI-Nspire CX
Use the video for extra support after trying the written steps. Explain the outputs, not just the buttons.
Open on YouTubeWe can now find a regression equation and make predictions. Next, we use Pearson’s correlation coefficient, \(r\), alongside the scatter diagram to describe the strength and direction of the linear association. This helps us judge whether a straight-line model suits the pattern in our data.
Pearson’s correlation coefficient, \(r\)
We have found a regression line. We now want a number that describes how strongly the two variables are linearly related.
This is Pearson’s product-moment correlation coefficient, \(r\), calculated from the paired data. Return to the output from Section 5. Read the row labelled \(\boldsymbol{r}\); the nearby \(r^2\) row is a different quantity.
Read and interpret \(r\)
The coefficient satisfies \(\boxed{-1\leq r\leq1}\).
\(r=1\): all points lie on a rising straight line.
\(r=-1\): all points lie on a falling straight line.
\(r\) close to \(0\): little linear correlation; a curved relationship may still exist.
The sign gives the direction. The absolute value, \(|r|\), is the distance from zero: ignore the sign. Values of \(|r|\) nearer 1 indicate stronger linear correlation.
Our study data: \(r\approx0.969\), indicating a strong positive linear correlation.
“Weak” and “strong” do not have universal numerical boundaries.
Worked example 4: compare two correlations
Sample A compares bicycle age and resale value, with \(r=-0.86\). Sample B compares practice time and test score, with \(r=0.54\). The plots illustrate these two correlations.
- Interpret \(r=-0.86\) for the bicycles.
- Which sample has the stronger linear correlation? Explain.
Solution
(a) There is a strong negative linear correlation: older bicycles tend to have lower resale values.
(b) Sample A is stronger because \(|-0.86|=0.86>0.54\). Its points lie more closely around a straight line. The negative sign gives the direction; it does not make the correlation weaker.
Useful checks: \(r\) has no units. Swapping \(x\) and \(y\) does not change it. If either variable is constant, \(r\) is undefined. A value of \(r=0.86\) does not mean that “86% of \(y\) is caused by \(x\)”. Always inspect the scatter diagram first.
Checkpoint E
Which is stronger: \(r=-0.80\) or \(r=0.35\)? Explain your choice and what the negative sign tells us.
Answer
\(r=-0.80\) is stronger because \(|-0.80|=0.80>0.35\). The negative sign means that \(y\) tends to decrease as \(x\) increases; it does not mean the association is weak.
Before trusting the coefficient, check what it can tell us
Before using \(r\), check for unusual points and avoid claiming that correlation proves cause.
An outlier can change the result
An outlier is a point that does not follow the main pattern. It can change both the coefficient and a fitted line, so we investigate it before drawing a conclusion.
Check an unusual point before removing it
Check that the value was recorded and measured correctly. If it is correct and relevant to your question, keep it in the investigation. If you leave out a point, explain why. Compare the model with and without that point to see how much it changes.
Correlation does not imply causation
Causation means that one variable produces a change in another. Correlation alone cannot establish this. Suppose a town records a positive correlation between ice-cream sales and visits to the sea for swimming. It does not follow that buying an ice cream causes someone to swim.
Worked example 5: improve the conclusion
A student claims that strong correlation proves ice-cream sales cause more swimming.
- Explain the error.
- Suggest a conclusion that the data support and a useful next investigation.
Solution
(a) Higher temperature could explain both increases; association alone does not establish cause.
(b) “On the observed days, greater sales were associated with more swimming visits.” Record temperature and compare similar-temperature days. This can clarify the association, but still does not prove causation.
We can now describe the linear association in a sample. Next, we learn how a critical value helps us decide whether the sample provides sufficient evidence of linear correlation in a wider group.
Evidence of linear correlation: critical values
Pearson’s \(r\) describes the linear pattern in our sample: the observations we collected. We may also ask whether the sample gives sufficient evidence of linear correlation in a wider group. For example, ten bicycles are our sample; the wider group could be comparable bicycles sold in the same market.
Sometimes a question gives us a critical value. In our own investigation, we may choose this approach, but the threshold must come from an appropriate statistical rule; we cannot choose an arbitrary number.
A critical value is a threshold for the size of the correlation coefficient, \(|r|\). We conclude that there is sufficient evidence of linear correlation only when \(|r|\) meets the stated threshold rule.
A sample can show a pattern by chance. The cutoff must suit the sample size and evidence standard. In 4.4 questions, use the supplied value when needed; selecting a cutoff for an investigation requires further guidance.
Compare \(|r|\) with the critical value
For example, suppose our rule considers both positive and negative correlation and uses a positive critical value \(c\):
Sufficient evidence of linear correlation when
\[\boxed{|r|>c}.\]Compare \(|r|\) with \(c\), then use the original sign of \(r\) to state the direction. Under this rule, \(|r|\leq c\) gives insufficient evidence. Follow the exact rule, including what happens at equality.
Worked example 6: use a supplied threshold
A sample of ten bicycles gives \(r=-0.72\) between age and resale value. The supplied rule gives sufficient evidence of linear correlation when \(|r|>0.632\).
- Apply the rule and state the conclusion in context.
- Another sample of ten bicycles gives \(r=0.54\). Apply the same rule.
Solution
(a) \(|-0.72|=0.72>0.632\). There is sufficient evidence of a negative linear correlation between bicycle age and resale value under this rule: older bicycles tend to have lower resale values.
(b) \(|0.54|=0.54<0.632\). There is insufficient evidence of linear correlation under this rule. This does not prove that there is no relationship.
Checkpoint F
Under the strict rule \(|r|>0.632\), decide whether \(r=-0.70\) and \(r=0.632\) meet the threshold. Explain each decision.
Answer
\(|-0.70|=0.70>0.632\), so the first result meets the rule. For \(r=0.632\), \(|r|\) equals the cutoff; it is not greater, so it does not meet the supplied strict rule.
Keep the questions separate: describing strength does not require a critical value. Meeting a threshold does not prove causation or guarantee a useful prediction.
Next, we check the data range and context to judge when predictions are sensible.
How reliable are our predictions?
We can now calculate predictions. Next, we decide how much confidence to place in them by checking the observed range, the pattern and the context.
Compare the requested value with the observed range
Interpolation: estimating \(y\) for an \(x\) inside the observed \(x\)-range.
Extrapolation: estimating \(y\) for an \(x\) below the smallest observed \(x\)-value or above the largest. We assume that the same trend continues beyond the observations.
Worked example 7: predict, then check the range
For study time \(x\) hours and score \(y\) out of 100, use
\[\hat y=4.452380952\ldots x+37.964285714\ldots.\]The model was fitted using study times from 1 to 8 hours.
- Estimate the score at 5.5 hours and comment on reliability.
- Explain why the model is unsuitable at 15 hours.
Solution
(a) Substitute \(x=5.5\) into the stored model:
\[\hat y(5.5)=62.452380\ldots\approx\boxed{62.5\text{ marks}}.\]Since \(1\leq5.5\leq8\), this is interpolation. The pattern is close to linear, so it is a reasonable estimate for a similar student. Their actual score may differ.
(b) The model gives \(\hat y(15)=104.75\) marks. This extrapolates beyond 1–8 hours and exceeds the maximum score of 100. The linear trend cannot continue indefinitely.
Interpolation does not guarantee accuracy
Also consider unusual points, the size and quality of the sample, and whether the student or situation is similar to those studied. A large \(|r|\) alone is not enough.
What if we want to predict the other variable?
Our model predicts a score from a study time. Knowing a score and trying to estimate study time reverses the question. That changes the role of the variables.
A \(y\)-on-\(x\) line predicts \(y\) from \(x\)
This model was fitted to predict \(y\) from \(x\). Rearranging its equation does not fit a new model for predicting \(x\) from \(y\).
If \(a\ne0\), we can rearrange \(y=ax+b\) to obtain \(x=(y-b)/a\). This finds a point on the existing line; it does not make that line the regression fitted to predict \(x\) from \(y\).
If a question asks you to use a given model backwards, do the algebra and recognize this limitation. Do not claim it automatically gives the best regression estimate of \(x\). An optional numerical comparison appears in Appendix B: reversing the prediction.
Checkpoint G
A model was fitted for \(1\leq x\leq8\). Classify predictions at \(x=4.5\) and \(x=9\). Why is the second less well supported? Does rearranging the equation automatically produce the best model for predicting \(x\)?
Answer
\(x=4.5\) gives interpolation; \(x=9\) gives extrapolation. The second value is outside the observed range, so the assumed trend has less support there. Rearranging a \(y\)-on-\(x\) line does not refit it to predict \(x\) from \(y\).
Answer the question that started the investigation
Can study time help us predict a test score?
For these eight students, the scatter diagram shows an approximately linear pattern, and \(r\approx0.969\) indicates a strong positive linear association between study time and test score. The fitted model is \(\hat y\approx4.45x+38.0\).
Using the stored equation, the predicted score for 5.5 hours of study is about 62.5 marks. This is interpolation within the observed range of 1–8 hours. Individual scores may differ, and the small sample limits how widely we can apply the model. The association does not establish that additional study time alone causes the increase.
Three different questions
| Question | What to check |
|---|---|
| How strong is the linear association? | Inspect the scatter diagram and interpret \(r\). |
| Is there sufficient evidence under a stated rule? | Compare \(|r|\) with the supplied critical value, following the stated rule. |
| Is this prediction sensible? | Check the observed range, the pattern and unusual points, and whether the new situation is comparable to those studied. |
Predict in the correct direction, use full stored values, and give units and sensible accuracy. None of these checks establishes causation.
Now try Questions 1–10. Question 5 practices the complete method. Use Question 10 as your independent readiness check, then use the answers to diagnose errors. The appendices are optional.
Practice: apply the ideas independently
Try these original questions before reading the answers. Write separately, show the calculations and explain conclusions in context. The ten questions total 72 marks.
Question 1: Read the pattern [7 marks]
- Describe the form and direction of the relationship in each diagram. [3]
- Identify the diagram showing the strongest linear association and justify your choice. [2]
- Explain why a value of \(r\) near zero would not by itself distinguish diagrams B and C. [2]
Question 2: Compare correlation coefficients [5 marks]
Three datasets have coefficients \(r_A=-0.92\), \(r_B=0.51\) and \(r_C=0.08\).
- Order the datasets from strongest to weakest linear association. [1]
- State the direction of the association in dataset A and explain why its negative sign does not make it weaker than B. [2]
- A student says “\(r_A=-0.92\) means that \(x\) causes 92% of \(y\).” Explain why this interpretation is invalid. [2]
Question 3: Use the mean point [4 marks]
A regression line of \(y\) on \(x\) has equation \(\hat y=2.4x+7.2\). The mean of the \(x\)-values is 5.
- Find the mean of the \(y\)-values. [2]
- A student substitutes \(y=24\), obtains \(x=7\) and calls this the best regression estimate of \(x\). Explain the limitation in this claim. [2]
Question 4: Interpret a model [8 marks]
A model for the resale value \(y\) euros of a bicycle aged \(x\) years is
\[\hat y=-74.9x+899.\]The model was fitted using bicycles aged between 1 and 6 years.
- Interpret the gradient in context. [2]
- Interpret the intercept and state a limitation of this interpretation. [2]
- Estimate the value of a 4-year-old bicycle. [2]
- Explain why a prediction for a 12-year-old bicycle should be treated with caution. [2]
GDC required for Questions 5–7 and 10
Use technology for \(r\) and regression. Use the full calculator values of \(a\) and \(b\) for predictions. Give non-exact numerical answers to three significant figures unless stated otherwise. Include units and explain answers using the context of the question.
Question 5: Practice time and score [17 marks]
Six students record their practice time \(x\) hours and their test score \(y\) out of 100.
| \(x\) (hours) | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| \(y\) (marks) | 46 | 50 | 58 | 61 | 69 | 76 |
- Find the mean point. [2]
- Draw a scatter diagram and a line of best fit by eye through the mean point. Use two points on your drawn line to find one possible equation. [5]
- Find the equation of the regression line of \(y\) on \(x\). [2]
- Find \(r\) and interpret it in context. [2]
- Estimate the score for a student who practices for 4.5 hours. [2]
- Interpret the gradient of your regression line. [2]
- Discuss the reliability of using this model for a student who practices for 10 hours. [2]
Question 6: A surprising coefficient [6 marks]
| \(x\) | \(-3\) | \(-2\) | \(-1\) | 0 | 1 | 2 | 3 |
|---|---|---|---|---|---|---|---|
| \(y\) | 9 | 4 | 1 | 0 | 1 | 4 | 9 |
- Find \(r\). [1]
- Sketch a scatter diagram of the data. [2]
- Explain why “there is no relationship between \(x\) and \(y\)” is false, and comment on the suitability of a linear model. [3]
Question 7: Investigate an unusual observation [6 marks]
The six pairs are \((1,2)\), \((2,4)\), \((3,5)\), \((4,8)\), \((5,9)\) and \((6,12)\).
- Find \(r\) for the six pairs. [1]
- A seventh pair, \((9,1)\), is added. Find the new \(r\) and describe the change in linear association. [3]
- Suggest a responsible next step before deciding whether to retain the new point. [2]
Question 8: Association and cause [3 marks]
A school finds a positive correlation between students’ shoe sizes and their reading scores across several year groups. Explain why this does not establish that larger shoes improve reading, and suggest a possible confounding variable. [3]
Question 9: Use a critical value [6 marks]
A sample of eight bicycles gives \(r=-0.75\) between age and resale value. The supplied rule states that there is sufficient evidence of linear correlation when \(|r|>0.707\).
- Apply the rule and state a conclusion in context. [2]
- Another sample of eight bicycles gives \(r=0.60\). Explain why the rule does not justify saying that there is no relationship. [2]
- Explain why meeting the critical-value rule does not establish that one variable causes the other to change. [2]
Question 10: Temperature and heating energy [10 marks]
Independent readiness check. Try this question with your calculator, without consulting the worked examples or the button-by-button guide.
Over eight days, a household records the mean outdoor temperature \(x\) and the electricity \(y\) used for heating that day. The heating system and usual indoor temperature setting remain unchanged.
| \(x\) (\({}^\circ\mathrm{C}\)) | 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 |
|---|---|---|---|---|---|---|---|---|
| \(y\) (kWh) | 38 | 33 | 35 | 28 | 25 | 22 | 19 | 16 |
The owner wants to estimate heating energy use from outdoor temperature. Use technology and give non-exact answers to three significant figures.
- Find an appropriate linear regression equation and Pearson’s correlation coefficient. Interpret the coefficient in context. [4]
- Estimate the heating energy use when the mean outdoor temperature is \(11^\circ\mathrm{C}\). Interpret the gradient of your model in context. [4]
- Explain how the reliability of this prediction differs from a prediction at \(20^\circ\mathrm{C}\). [2]
Use the answers to improve your method
The next section gives worked answers so you can check your reasoning as well as your final numbers. If you made an error, revisit the explanation, cover its solution, and try the method again.
Answers and worked guidance
Question 1
Solution
(a) A: approximately linear and negative.
B: no clear pattern or linear direction.
C: curved (U-shaped); \(y\) first decreases and then increases as \(x\) increases.
(b) A. Its points cluster most closely around a straight line.
(c) Both may have \(r\) close to zero. Pearson’s \(r\) measures linear association and does not reveal the curved structure in C; we need the scatter diagrams.
Question 2
Solution
(a) A, B, C, because \(0.92>0.51>0.08\).
(b) A has a negative association. Strength is compared using \(|r|\), so A is stronger than B.
(c) \(r\) is neither a percentage of \(y\) nor a measure of causation. It summarizes the direction and strength of linear association.
Question 3
Solution
(a) The fitted line passes through \((\bar x,\bar y)\):
\[\bar y=2.4(5)+7.2=\boxed{19.2}.\](b) Rearranging gives \(x=7\), but it reverses a line fitted to predict \(y\) from \(x\). It is not generally the regression of \(x\) on \(y\), so “best regression estimate” is not justified by that rearrangement alone.
Question 4
Solution
(a) The fitted model predicts a decrease of €74.90 in resale value for each additional year of age.
(b) The intercept predicts €899 at age 0; no bicycles of that age were in the data, so this interpretation is extrapolation.
(c) \(\hat y(4)=-74.9(4)+899=\boxed{\text{€599.40}}\).
(d) Twelve years is outside the observed range of 1–6 years. The same linear depreciation pattern may not continue, so the prediction has limited support.
Question 5
Solution
(a) \(\bar x=21/6=3.5\) and \(\bar y=360/6=60\), so \(\boxed{M=(3.5,60)}\).
(b) Your line may differ from the one shown. It should pass through \(M=(3.5,60)\) and follow the overall pattern. Check that your axes have variables and units and that all six pairs are plotted accurately.
The displayed line gives one possible answer: choose \(P=(1,45)\) and \(Q=(6,75)\) on the line. Then
\[ a=\frac{75-45}{6-1}=6,\qquad 60=6(3.5)+b\ \Longrightarrow\ b=39. \]So one possible equation is \(y=6x+39\). Other reasonable equations are acceptable; check that \(3.5a+b\approx60\).
(c) \(\boxed{\hat y=6x+39}\). In this example, the illustrated line drawn by eye happens to match the regression line. This will not generally happen.
Calculator check: six pairs, \(\sum x=21\), \(\sum y=360\), \(M=(3.5,60)\). Put practice time in X List and score in Y List.
(d) \(r=0.993710629\ldots\approx\boxed{0.994}\): a strong positive linear association between practice time and test score.
(e) \(\hat y(4.5)=6(4.5)+39=\boxed{66\text{ marks}}\).
(f) The model predicts an increase of 6 marks per extra hour of practice.
(g) Ten hours is outside the observed 1–6 hours: extrapolation. A strong correlation does not prove that the same trend continues. Only six students were studied, so the model may not work well for other students.
Question 6
Solution
(a) \(\boxed{r=0}\) (a calculator may display a tiny rounding error).
(b) Plot all seven pairs on labelled axes. The points form a symmetric U-shaped pattern:
(c) The data satisfy \(y=x^2\) exactly, so a relationship certainly exists. It is quadratic, and a straight line does not describe its shape appropriately.
Question 7
Solution
(a) \(r=0.990478003\ldots\approx\boxed{0.990}\).
(b) Append \((9,1)\) as the seventh paired row and recalculate: \(r=0.113513978\ldots\approx\boxed{0.114}\). The originally strong positive linear association becomes very weak.
Data check: first run \(n=6\), \(\sum x=21\), \(\sum y=40\); second run \(n=7\), \(\sum x=30\), \(\sum y=41\). Read \(r\), not \(r^2\).
(c) Check the original record and how the measurements were made. Correct any error you can confirm. Otherwise, explain how the point changes the results. Do not delete it just to increase \(r\).
Question 8
Solution
Correlation does not establish causation. Age or year group is a plausible confounder: older students tend to have both larger feet and higher reading scores. The association alone does not show that changing shoe size would improve reading.
Question 9
Solution
(a) \(|-0.75|=0.75>0.707\). There is sufficient evidence of a negative linear correlation between bicycle age and resale value under the supplied rule: older bicycles tend to have lower resale values.
(b) \(|0.60|=0.60<0.707\). The sample does not meet the evidence criterion. That is insufficient evidence under the rule, not proof that there is no relationship.
(c) The rule assesses evidence of a linear association; it does not establish a cause. Other variables may affect the observations, so the correlation alone cannot prove a causal explanation.
Question 10
Solution
(a) Temperature is the known input, so fit \(y\) on \(x\): use temperature as X List and heating energy as Y List. Inspecting the pairs gives an approximately straight, decreasing pattern. Technology gives
\[\hat y=-1.583333333\ldots x+41.25,\] \[r=-0.982842099\ldots\approx\boxed{-0.983}.\]There is a strong negative linear association: warmer days tend to use less electricity for heating in this household. A rounded form of the equation is \(\hat y\approx-1.58x+41.3\); retain the stored coefficients for predictions.
(b) Save the equation to f1, then evaluate
For each \(1^\circ\mathrm{C}\) increase in mean outdoor temperature, the model predicts about 1.58 kWh less electricity used for heating that day.
(c) \(11^\circ\mathrm{C}\) lies within the observed range \(2\)–\(16^\circ\mathrm{C}\), so the estimate is interpolation. The near-linear pattern supports it for a comparable day in this household, although the actual use may differ. A prediction at \(20^\circ\mathrm{C}\) is extrapolation: the data do not show whether the same trend continues that far.
If your result differs: check \(n=8\), \(\sum x=72\), \(\sum y=216\) and \(M=(9,27)\). Both the gradient and \(r\) should be negative. Using the rounded equation in (b) gives \(23.9\) kWh; the required \(23.8\) kWh comes from the stored equation.
Are you ready to use the method independently?
After Question 10, tick each step you could complete without help:
If a step needed help, revisit its section using the revisit table, then try that step again without guidance.
Also check that you can explain what a supplied critical value decides and why correlation alone does not establish cause.
The core lesson is complete. If you want to understand how the calculator chooses its line, optional Appendix A explains least squares.
Read more: the method of least squaresOptional extension
Appendix A: How least squares chooses the regression line
Optional explanation. In section 4.4, we find the regression coefficients using technology; manual derivation is not required. Here we explain how least squares makes “best fit” precise by comparing predicted and observed values.
Step 1: compare the actual and predicted values
A line predicts \(\hat y=ax+b\). The hat means predicted, rather than actual. A residual is
\[ \begin{aligned} e &=\text{actual value}-\text{predicted value}\\ &=\boxed{y-\hat y}. \end{aligned} \]We keep \(x\) fixed and compare the two \(y\)-values, so the gap is vertical. Above the line the residual is positive; below it, negative; on it, zero.
For study time \(x\) hours and test score \(y\) out of 100, consider the line drawn by eye, \(\hat y=4.5x+37.75\). One student studied for 3 hours and scored 47:
\[\hat y=4.5(3)+37.75=51.25,\] \[e=47-51.25=\boxed{-4.25\text{ marks}}.\]Step 2: square each residual so errors do not cancel
Adding positive and negative residuals could hide the errors through cancellation. Squaring makes every contribution non-negative. Picture a square with side length \(|e|\): its area is \(e^2\). A larger square means a larger error.
Checkpoint A1
An observed score is 60 and a line predicts 64. Find the residual and its square. Is the point above or below the line?
Answer
\(e=60-64=-4\) and \(e^2=16\). The residual is negative because the observation is below the line. The square is positive even though the residual is negative.
Step 3: choose the smallest total square area
The regression line of \(y\) on \(x\) is the optimal straight line under the least-squares rule: among all lines \(y=ax+b\), it minimizes the total of the squared vertical residuals. This gives a precise best fit to these data. A calculator finds its coefficients for us.
To see the squares clearly, use a separate, small dataset with just three points: \((1,2)\), \((3,5)\) and \((5,5)\). The lines below are \(\hat y=0.5x+2.5\), drawn by eye, and the regression line \(\hat y=0.75x+1.75\).
How one square is calculated
For the point \((1,2)\), the regression line predicts \(\hat y=0.75(1)+1.75=2.5\). Its residual is \(2-2.5=-0.5\), so its squared residual is
\[(y-\hat y)^2=(2-2.5)^2=\boxed{0.25}.\]Checkpoint A2
Use \(\hat y=0.75x+1.75\) for the other two points, \((3,5)\) and \((5,5)\).
- Find their squared residuals and check the total for all three points.
- Does “best fit” mean the smallest error at every individual point?
Answer
(a) At \(x=3\), \(\hat y=4\), so \((5-4)^2=1\). At \(x=5\), \(\hat y=5.5\), so \((5-5.5)^2=0.25\). The total is \(0.25+1+0.25=\boxed{1.5}\).
(b) No. The regression line minimizes the total squared vertical residuals. An individual error can increase: at \((5,5)\) the by-eye line has zero error, while the regression line has residual \(-0.5\).
The calculator finds the coefficients that give this smallest total. The residuals and squares explain the rule behind its choice.
The fitting rule also helps explain why predicting \(x\) from \(y\) is a different problem. The next optional appendix compares the two prediction directions.
Read more: why reversing the line changes the predictionOptional extension
Appendix B: Why reversing the line changes the prediction
The core lesson asks you to recognize the limitation of reverse prediction. This optional comparison shows numerically why two prediction directions can give different lines.
A regression of \(y\) on \(x\) is chosen to predict \(y\) from \(x\). Solving its equation backwards is algebraically possible, but it does not generally give the regression model chosen to predict \(x\) from \(y\).
Same data; different prediction questions
| \(x\) | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| \(y\) | 2 | 4 | 3 | 6 | 5 |
For these data, \(r=0.8\). The two technology-fitted models are
\[\underbrace{\hat y=0.8x+1.6}_{\text{predict }y\text{ from }x},\] \[\underbrace{\hat x=0.8y-0.2}_{\text{predict }x\text{ from }y}.\]The second model is given here to illustrate the caution. Regression of \(x\) on \(y\) is studied explicitly in syllabus section 4.10, for both AA SL and HL.
Illustration: compare two prediction directions
Use \(\hat y=0.8x+1.6\) and \(\hat x=0.8y-0.2\). For \(y=5\):
- Find the \(x\)-value obtained by rearranging the \(y\)-on-\(x\) equation.
- Use the supplied \(x\)-on-\(y\) model to estimate \(x\).
- Explain the difference.
Solution
(a) \(5=0.8x+1.6\ \Longrightarrow\ x=4.25\).
(b) \(\hat x=0.8(5)-0.2=3.8\).
(c) The first number is where a horizontal line meets the model fitted to predict \(y\). The second comes from the model fitted to predict \(x\). The models predict different variables. Rearranging the first equation does not turn it into the second model.
Next, optional Appendix C shows how to present and assess a regression model in your own investigation using a spreadsheet.
Read more: use regression in an investigationOptional extension
Appendix C: Use regression in an investigation
After completing the core practice, you may want to investigate your own paired data in an internal assessment (IA). Google Sheets can help present the data and explore the model. This section is optional and goes beyond the compulsory calculation methods of 4.4.
A purposeful spreadsheet investigation
- State the question, the population of interest, and how the paired measurements were obtained. Label both variables and their units.
- Keep each pair on one row. Insert a scatter chart, select the intended \(x\) and \(y\) columns, and inspect the pattern before fitting.
- Under the chart’s series options, add a linear trendline, display its equation and, if useful, \(R^2\). Use
=CORREL(A2:A9,B2:B9)to obtain signed \(r\) for the eight rows in our running example. - Explain the gradient, judge the prediction range, and discuss unusual points and limitations. A screenshot needs interpretation alongside it.
\(R^2\) is not \(r\)
For ordinary simple linear regression with an intercept, \(R^2=r^2\). Thus \(R^2\) loses the direction of the relationship. For example,
\[R^2=0.81\quad\Longrightarrow\quad |r|=0.9.\]- \(r=0.9\) if the fitted gradient is positive;
- \(r=-0.9\) if the fitted gradient is negative.
In this setting, \(R^2=0.81\) means that 81% of the observed variation in \(y\) about its mean is accounted for by the fitted linear model. It does not mean that 81% of \(y\) is caused by \(x\).
An extra check: look at the residuals
A residual is \(e=y-\hat y\); see Appendix A. Plot the original \(x\)-value on the horizontal axis and its residual on the vertical axis. A clear curve in this residual plot suggests that a straight-line model may not describe the data well.
Linear Regression with Google Sheets, scatter graph, regression equation, r^2 value, r value
Useful for presenting and exploring data in an IA. Pay particular attention to the distinction between \(R^2\) and signed \(r\).
For further help, the final section brings together the supporting tutorials.
Further support and references
The written explanations, examples, checkpoints and practice answers form the complete core lesson. These videos offer another explanation if you would find it useful; they are not required to complete the lesson.
Optional tutorials
Finding the Regression Line Equation, Correlation Coefficient, and Predicting Values | TI-Nspire CX
Calculator method: Section 5. Follow the written instructions first, then use the video for extra support.
Interpolation and Extrapolation | Linear Regression Exam Question | IB & IGCSE Extended Maths
Prediction and reliability: Section 8. Compare the calculation with the reasons used to judge the prediction.
Watch the interpolation and extrapolation tutorial on YouTube
Linear Regression with Google Sheets, scatter graph, regression equation, r^2 value, r value
Optional investigation: Appendix C. Pay attention to the distinction between \(R^2\) and signed \(r\).