Correlation and Regression AA SL
Correlation tells you how strongly two variables move together, and a regression line lets you predict one from the other. This page shows how to find and describe Pearson's correlation coefficient, how to find the regression line of on and of on with your calculator, and how to judge whether a prediction can be trusted, with worked examples and exam-style questions.
Formulas at a glance
Pearson's and the regression lines are found with the calculator, so there is no formula to learn or substitute into. What you must know is how to read the results and how far to trust a prediction.
Strength and direction of linear correlation
(Pearson's coefficient)
Not in the bookletRegression line of on , for predicting
Not in the bookletRegression line of on , for predicting
Not in the bookletThe point every on regression line passes through
Mean point
Not in the bookletWhich method to use
Use the correlation coefficient and the scatter diagram to judge the relationship, then the right regression line to predict.
| The question asks you to | Use | Notes |
|---|---|---|
| Describe the strength and direction of a linear relationship | Pearson's | The sign gives the direction. For the size, from 0 to 0.5 is weak, 0.5 to 0.8 is moderate and 0.8 to 1 is strong |
| Find from a table of paired data | Enter the two lists and run linear regression on the calculator | Enter the -values and -values in matching order |
| Say whether one variable causes the other | Correlation does not imply causation | Name a possible third variable that could affect both |
| Decide whether a straight line is a suitable model | Look at the scatter diagram as well as | A curved pattern can still give a high |
| Find the regression line of on | Linear regression on the calculator, | Keep the unrounded values stored for later working |
| Predict from a given | The regression line of on | Substitute the value of into |
| Predict from a given | The regression line of on | Run the regression again with the lists swapped. Do not rearrange the on line |
| Find the line, or a missing value, from the mean point | The regression line passes through | Substitute the mean point into the equation, and the two regression lines meet at the mean point |
| Interpret the line in context | The gradient is the change in for each increase of 1 in | Use the units in the question. The intercept is the value of when , which may not make sense |
| Comment on the reliability of a prediction | Inside the range of the data is interpolation, outside it is extrapolation | Extrapolation is unreliable because the pattern may not continue |
Section 1 of 2 SL4.4
Correlation and scatter diagrams
Correlation describes the strength and direction of a linear relationship between two variables, measured by Pearson's product-moment correlation coefficient , where . A regression line of on , found using technology, gives an equation used to predict from . Interpret both in context, with care over causation and extrapolation.
Correlation and regression, in brief
Correlation and causation
A strong correlation coefficient shows two variables move together, but it never proves that one causes the other - a third factor could be driving both.
Using a regression line far outside the data range (extrapolation) makes any estimate unreliable, since the linear trend isn't guaranteed to continue.
Key terms
What do and mean in ?
The gradient is the predicted change in for each increase of in , and is the predicted value of when . Always interpret them in the context of the data.
e.g. For with hours of study and a test mark, each extra hour is predicted to add marks, and is the predicted mark for no study.
What is a scatter diagram?
A scatter diagram plots each pair of values as a point, with one variable on each axis. Its pattern shows the direction and strength of any linear relationship.
e.g. The points , , and lie on a straight line rising to the right, so the correlation is positive.
What do positive and negative correlation mean?
Positive correlation means tends to increase as increases, so . Negative correlation means tends to decrease as increases, so .
e.g. A value shows strong negative correlation, while shows weak positive correlation.
What does the regression line of on pass through?
It passes through the mean point . Use it to predict for a given within the range of the data.
e.g. If and , the line passes through .
Worked example, step by step
The question Calculator needed [4 marks]
A librarian records, for seven pupils, the time hours spent on screens in a week and the number of pages read in the same week.
: 4, 6, 9, 12, 15, 18, 20
: 150, 160, 120, 112, 98, 62, 84
(a) Find the value of Pearson's product-moment correlation coefficient, .
(b) Describe the correlation between and .
(c) The librarian says that the data prove that more time on screens causes pupils to read fewer pages. Comment on this claim.
Worked solution: worked example
Answer: (a) . (b) Strong negative linear correlation. (c) The claim is not justified: correlation does not imply causation, and another factor could affect both.
Step 1 - Enter the data.
Put the seven values of in one list and the seven values of in a second list, in the same order, so that each pair lines up. Choose linear regression (or two-variable statistics) to get . M1 - Enter the data and use the calculator to find
Why? The calculator pairs the th entry of one list with the th entry of the other. If one list is shifted or a value is mistyped, every result after it is wrong.
Step 2 - Read off .
A1 -
Why? You do not calculate by hand. Copy the value the calculator gives for , not for , and keep its sign.
Step 3 - Describe the correlation.
The sign is negative, so as increases tends to decrease. Also , so the correlation is strong. There is between screen time and pages read. A1 - Strong negative linear correlation
Why? A full description needs both the strength and the direction, and the word linear, because only measures how close the points are to a straight line.
Step 4 - Comment on causation.
A strong correlation shows that the two variables are associated, but it does not show that one causes the other. Another variable could affect both: for example, tired pupils may spend more time on screens and also have less energy to read. R1 - Correlation does not imply causation, with a possible other factor
Why? This is the standard exam point: correlation does not imply causation. A good answer names a possible third variable rather than only repeating the sentence.
Step 5 - Check.
The points fall from left to right, which matches a negative . The value satisfies , and it is close to , so the points lie fairly close to a falling straight line.
Why? A sign that does not match the trend is the usual sign of a mistake, such as entering the lists the wrong way round or mistyping a value.
M1 Enter the data and use the calculator to find
A1
A1 Strong negative linear correlation
R1 Correlation does not imply causation, with a possible other factor
Now you try: enter your answers to be marked
These are real practice questions. Type your answer in each box and press Mark it. The worked solution and mark scheme appear straight away, and your first attempt is the one that counts. Use the keyboard for powers, roots and trig, and the working box for your notes.
Worked solution: practice question 1
| 1 | 2 | 3 | 4 | 5 | |
| 2 | 5 | 5 | 8 | 9 |
Worked solution: practice question 2
| 1 | 2 | 3 | 4 | 5 | |
| 2 | 5 | 5 | 8 | 9 |
Find the equation of the regression line of on .
Worked solution: practice question 3
Your score so far: 0 out of 8 marks
Calculator steps: Make a scatter diagram, Linear regression (line of best fit) and r
Common mistakes
- Claiming correlation proves causation. A strong value shows two variables move together; it never establishes that one causes the other, since a third factor could explain both.
- Extrapolating a regression line beyond the data range. Using to estimate at when the data only covers to produces an estimate with no guarantee of validity - the linear pattern might not continue.
- Mixing up on with on . The two regression lines are not the same line rearranged - if a question asks you to predict from a given , you need the regression line of on , not the line of on solved for .
Regression lines and prediction
When you have two connected sets of data, correlation tells you how strongly they move together, and regression gives you the actual line for predicting one from the other. This section covers Pearson's correlation coefficient , fitting and interpreting the regression line of on , using that line to make predictions, and knowing when a prediction can and can't be trusted.
Key terms
Five words worth knowing cold, each with an example showing what it means.
What is Pearson's r?
Pearson's product-moment correlation coefficient is a number between and that measures how strongly two variables follow a straight-line pattern. Values near mean a strong linear relationship; values near 0 mean little or no linear relationship. Your GDC calculates it directly from the data.
e.g. for data on hours of sunlight against plant height means an almost perfect positive linear relationship.
What is the regression line of y on x?
The regression line of on is the "line of best fit" that minimises the total squared vertical distance between the line and each data point. It's written , and it's the line you use whenever you're predicting from a given .
e.g. For temperature and sales , predicts sales for any given temperature within the data range.
What is the mean point?
The mean point is the point formed from the mean of the -values and the mean of the -values. Every regression line of on passes exactly through this point, which makes it a useful check on a calculated regression equation.
e.g. For and , and .
What is extrapolation?
Extrapolation is using a regression line to predict a value of for an that lies outside the range of the original data. This is unreliable because there's no evidence the same linear relationship continues beyond the data actually collected.
e.g. If ranges from to in the data, predicting at is extrapolation and the result should be treated with caution.
What does the gradient of a regression line mean?
The gradient in tells you, in context, how much changes for every one-unit increase in . Interpreting it correctly means stating both the size of the change and the units of and from the original question.
e.g. For with in $100s of marketing spend and in new customers, each extra $100 spent is associated with about 3 more new customers.
y on x and x on y
These are two different lines that both pass through the mean point but are otherwise not the same - picking the wrong one is a common source of lost marks.
| Feature | Regression of y on x | Regression of x on y |
|---|---|---|
| Form | ||
| Minimises errors in | the -direction | the -direction |
| Use to predict | from a given | from a given |
| Example |
Correlation and its interpretation
Reading r
The sign gives the direction. For the strength, from 0 to 0.5 is weak, 0.5 to 0.8 is moderate and 0.8 to 1 is strong.
Not in the formula booklet - found by GDCUsing the regression line for prediction
Interpolation
Predicting within the range of the given -data.
Generally reliable, since the model is only tested inside this range.
Not in the formula booklet - key exam ideaExtrapolation
Predicting outside the range of the given data.
Unreliable - always flag this in your answer if the value of falls outside the data range.
Not in the formula booklet - key exam ideaWorked example, step by step
The question Calculator needed [6 marks]
A fitness club records, for seven members, the time hours spent training in a week and the resting heart rate beats per minute.
: 2, 4, 5, 7, 8, 10, 12
: 78, 75, 73, 67, 66, 63, 57
(a) Find the equation of the regression line of on .
(b) Interpret the gradient of the line in this context.
(c) Estimate the resting heart rate of a member who trains for 11 hours in a week.
(d) Explain why the line should not be used to estimate the resting heart rate of a member who trains for 25 hours in a week.
Worked solution: worked example
Answer: (a) . (b) Each extra hour of training per week is predicted to reduce the resting heart rate by about beats per minute. (c) beats per minute. (d) hours is outside the data range, so this is extrapolation and the estimate is unreliable.
Step 1 - Enter the data and run the regression.
Put the -values in one list and the -values in a second list, in the same order. Run linear regression with as the explanatory variable and as the response variable. M1 - Attempt linear regression of on on the calculator
Why? The question asks for the line of on , so is the variable you are predicting from. Swapping the lists would give the line of on , which is a different line.
Step 2 - Write the equation.
The calculator gives and , so A1 -
Why? Give the equation in the form with 3 significant figures. Keep the unrounded values stored on the calculator for any later calculation.
Step 3 - Interpret the gradient.
The gradient is . For each extra hour of training per week, the resting heart rate is predicted to fall by about beats per minute. A1 - Each extra hour of training reduces the resting heart rate by about beats per minute
Why? The gradient is the change in for an increase of in . Give it with the units from the question and say that it is a prediction.
Step 4 - Predict within the range.
Substitute : The estimated resting heart rate is beats per minute. M1 - Substitute into the regression line A1 -
Why? The data cover , so is inside the range. Predicting inside the range is interpolation, and it is reasonably reliable.
Step 5 - Explain the extrapolation.
The data only cover to hours. A value of hours is far outside this range, so using the line is extrapolation. The line would give , which is not a realistic resting heart rate. R1 - is outside the range of the data, so this is extrapolation and unreliable
Why? There is no evidence that the straight-line pattern continues beyond the data. Say that the value lies outside the range of the data, and use the context to show why the result is doubtful.
Step 6 - Check.
The mean point is . Then , so the line passes through the mean point.
Why? Every regression line of on passes through . A line that misses it was entered or read wrongly. The negative gradient also matches the falling pattern in the table.
M1 Attempt linear regression of on on the calculator
A1
A1 Each extra hour of training reduces the resting heart rate by about beats per minute
M1 Substitute into the regression line
A1
R1 is outside the range of the data, so this is extrapolation and unreliable
Now you try: enter your answers to be marked
Worked solution: practice question 1
Your score so far: 0 out of 5 marks
Calculator steps: Linear regression (line of best fit) and r
Common mistakes
The four slip-ups that account for most of the marks lost on this topic - worth reading before you start practising, not just after you get one wrong.
- Using the y on x line to predict x. The regression line of on is designed to predict from a given - to predict from a given , you need the separate regression line of on .
- Ignoring extrapolation. Predicting a value far outside the range of the collected data assumes the linear trend continues, which is often not a safe assumption - always check the -value against the data range before trusting a prediction.
- Assuming a high r means a linear model is appropriate. only measures linear association and can still be high for a clearly curved relationship - always check the scatter diagram, not just the value of .
- Treating correlation as causation. A strong shows two variables move together, not that one causes the other - other factors could explain the relationship.
Using your GDC
The exact key presses for the TI-84 Plus CE, Casio fx-CG50, Casio fx-CG100 and TI-Nspire CX, with what the screen shows. Pick your calculator.
Make a scatter diagram
Used in: Correlation and scatter diagrams
How to make a scatter diagram on a TI-84 Plus CE
Scatter plot from two lists (STAT PLOT) | |
If L1 and L2 already hold data, press stat, choose 4:ClrList, then press 2nd 1 (L1) , 2nd 2 (L2) and enter to empty them. |
ClrList L1,L2 |
Press stat, choose 1:Edit and press enter. Type the x-values into L1, pressing enter after each: 2, 3, 5, 6, 8, 9, 11, 12. Press ▶ to move to L2 and type the y-values in the same order: 31, 38, 40, 52, 55, 63, 60, 74. The two lists must have the same number of values. |
L1 L2 L3 2 31 --- 3 38 --- 5 40 --- 6 52 --- 8 55 --- 9 63 --- 11 60 --- |
Press 2nd Y= (STAT PLOT), choose 1:Plot1 and press enter. Highlight On and press enter. Check that Type is the first icon (scatter plot), Xlist is L1 and Ylist is L2. If not, move to the item, press enter to choose the icon, or type the list name with 2nd 1 (L1) or 2nd 2 (L2). |
Plot1 On Off Type: scatter (first icon) Xlist:L1 Ylist:L2 |
Press zoom and choose 9:ZoomStat. The calculator sets the window to fit the data and draws the scatter plot. Press trace and ◀ ▶ to move from point to point and read each pair of values. The points rise from the lower left to the upper right: as x increases, y increases. |
|
When you have finished, press 2nd Y= (STAT PLOT) and choose 4:PlotsOff. A plot left on makes the next function graph fail with an error.
The full guide: Make a scatter diagram
Linear regression (line of best fit) and r
Used in: Correlation and scatter diagrams, Regression lines and prediction
How to find a line of best fit and r on a TI-84 Plus CE
Turn on r (once) | |
Press mode, use ▼ to reach STAT DIAGNOSTICS, move to ON with ▶ and press enter. Then press 2nd mode (QUIT). With diagnostics off, the correlation coefficient is not shown. This setting stays on until you reset the calculator. |
|
Enter the data and run LinReg(ax+b) | |
Press stat and choose 1:Edit. Clear any old values: move up to the L1 heading, press clear then enter, and do the same for L2. |
|
Type the -values into L1, pressing enter after each: 3, 5, 6, 8, 9, 11, 12, 14. Press ▶ to move to L2 and type the -values, pressing enter after each: 41, 48, 47, 58, 60, 69, 66, 77. Both lists must have the same number of values. |
L1 = 3, 5, 6, 8, 9, 11, 12, 14 L2 = 41, 48, 47, 58, 60, 69, 66, 77 |
Press stat, move to CALC with ▶, and choose 4:LinReg(ax+b). With the Stat Wizards on, a screen asks for Xlist and Ylist: set Xlist to L1 and Ylist to L2 (press 2nd 1 for L1 and 2nd 2 for L2), then move to Calculate and press enter. If the Stat Wizards are off, type |
LinReg(ax+b) y=ax+b a=3.2346939 b=30.7551020 r²=0.9678131 r=0.9837749 |
Read a (the gradient), b (the -intercept) and r. and , both to 3 significant figures. |
|
Predict a value from the line | |
Before you run LinReg, move to Store RegEQ on the wizard screen, press vars, then ▶ to Y-VARS and choose 1:Function then 1:Y1. The full-accuracy equation is then saved in Y1. On the home screen type when , to 3 significant figures. |
Y1(10) 63.1020408 |
If r does not appear, diagnostics are off: turn STAT DIAGNOSTICS on in the mode screen and run LinReg again. Use the full values of a and b, not rounded ones, when you predict.
The full guide: Linear regression (line of best fit) and r
See the full list of GDC guides for every calculator task.
Syllabus content covered
| Code | Syllabus content |
|---|---|
| SL4.4 | Linear correlation of bivariate data. Pearson's product-moment correlation coefficient, . Scatter diagrams; lines of best fit, by eye, passing through the mean point. Equation of the regression line of on . Use of the equation of the regression line for prediction purposes. Interpret the meaning of the parameters, and , in a linear regression . |
| SL4.10 | Equation of the regression line of on . Use of the equation for prediction purposes. |
Official IB source: Mathematics: analysis and approaches subject brief (PDF, ibo.org).
Quick questions
What does Pearson's correlation coefficient r measure?
measures the strength and direction of the linear relationship between two variables, ranging from (perfect negative) to (perfect positive). A value near means little or no linear correlation.
Does a value of r close to 1 prove that x causes y?
No. A strong correlation shows that the variables change together, but a third factor may affect both, or the link may be coincidence. Causation needs more evidence than correlation.
Why is extrapolation dangerous?
A regression line is only fitted to the data you have. Using it to predict far outside that range (extrapolation) assumes the same linear pattern continues, which often isn't true - the relationship can change, level off, or reverse beyond the data you actually collected.
Why can't I always use the y on x line to predict x?
The regression line of y on x is built to minimise errors in the y-direction, so it's optimised for predicting y from a given x. To reliably predict x from a given y, you need the separate regression line of x on y, which minimises errors in the x-direction instead.
Does r change if I change the units of the data?
No. Converting centimetres to metres, or adding a constant to every value, leaves unchanged. The gradient of the regression line does change, because it depends on the units.
Do I need to calculate r by hand?
No - the syllabus expects you to use your GDC to find r and the regression equation. Hand calculation is only there to help you understand what the value means, not something you'll be examined on directly. See the GDC guide for model-specific instructions.
Ready to practise properly?
Practice questions on every section, marked instantly like the real exam.