Lesson 7 of 8 · 16 min
Pearson's correlation coefficient, r
Calculate Pearson's correlation coefficient r from raw data with technology, and interpret it to quantify the strength and direction of a linear association.
What you will be able to do
- State what measures and the values it can take.
- Calculate from raw data with a calculator or spreadsheet.
- Use to describe the strength and direction of a linear association, in context.
- Recognise when should not be used: non-linear associations and data with outliers.
"Moderate" or "strong" by eye is a judgement call, and two people can look at the same scatterplot and disagree. Pearson's correlation coefficient, , settles it with a number calculated from the data: its sign gives the direction of a linear association and its size gives the strength.
These are the netball data from the last lesson, with . Drag points towards a straight line and watch move towards 1; scatter them and it moves towards 0; make the pattern fall and it turns negative.
Definition
Pearson's correlation coefficient
measures the strength and direction of a linear association between two numerical variables.
- It always lies between and .
- The sign gives the direction: is positive, is negative.
- The size gives the strength: the closer is to or , the closer the points are to a straight line.
- or means every point lies exactly on a line; near 0 means no linear association.
| Value of | Linear association |
|---|---|
| perfect positive | |
| strong positive | |
| moderate positive | |
| weak positive | |
| no linear association | |
| weak negative | |
| moderate negative | |
| strong negative | |
| perfect negative |
Which value of shows the strongest linear association?
With a scientific calculator
- Switch to statistics (regression) mode and choose the linear model, often shown as .
- Enter the explanatory variable in the column and the response variable in the column, one pair per row.
- Display the regression results and read . (The and values are the line you'll fit in the next topic.)
With a spreadsheet
Put the values in A2:A11 and the values in B2:B11. Then
=CORREL(A2:A11, B2:B11)gives (so does=PEARSON(...))=RSQ(B2:B11, A2:A11)gives , which comes next lesson.
Worked example
Calculate and interpret r with technology
The owner of a beach kiosk on the Gold Coast recorded the daily maximum temperature and the number of ice-creams sold on 10 days in November.
| Max. temperature (°C) | 22 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 33 | 35 |
|---|---|---|---|---|---|---|---|---|---|---|
| Ice-creams sold | 118 | 135 | 140 | 162 | 158 | 175 | 181 | 176 | 205 | 214 |
(a) Use technology to calculate Pearson's correlation coefficient, correct to three decimal places.
(b) Interpret the value of .
Step 1: Decide which variable is
Temperature may explain ice-cream sales, so enter temperature as and ice-creams sold as .
comes out the same either way, but entering and correctly matters for everything else the calculator gives you, such as the least-squares line in the next topic.
Step 2: Enter the data and calculate
In your calculator's statistics mode, choose linear regression, enter the 10 pairs and read the result:
Step 3: Check the form
Sales rise steadily with temperature, with no sign of a curve, so a measure of linear association is appropriate.
only measures linear association. If the scatterplot curved, would mislead.
Step 4: Interpret
is close to 1, so there is a strong positive linear association between daily maximum temperature and the number of ice-creams sold: on hotter days the kiosk tends to sell more ice-creams.
Try it yourself first, then check the working one step at a time.
Answer
(a) . (b) There is a strong positive linear association between daily maximum temperature and the number of ice-creams sold.
Method
Enter the explanatory variable as and the response variable as .
Use linear regression in statistics mode and read , rounded to three decimal places.
Check that the scatterplot is linear.
Interpret with the value, strength, direction, the word linear and the context.
Watch out for
Writing "strong correlation" with no direction, no mention of linear and no context. Each of those is part of the interpretation.
Exam tip
Interpreting r
Quote the value, then give strength, direction, the word linear, and the context:
" indicates a strong positive linear association between daily maximum temperature and the number of ice-creams sold."
Eight students recorded how many hours they slept the night before a reaction-time test, and their reaction time.
| Sleep (hours) | 5 | 5.5 | 6 | 6.5 | 7 | 7.5 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|
| Reaction time (ms) | 352 | 341 | 330 | 338 | 312 | 318 | 298 | 290 |
Use technology to calculate Pearson's correlation coefficient, correct to three decimal places.
measures how close the points are to a straight line, so it only describes linear associations. Always look at the scatterplot first. Here is the concentration of a medicine in a patient's blood in the hours after a dose.
The points follow a clear hump-shaped curve, yet .
An of says there is no linear association — and that is true. But the association is strong: the concentration rises, peaks and falls along a smooth curve. can't see curves, so an near 0 does not mean the variables are unrelated, and an near does not prove the form is linear.
Worked example
When r looks strong but the pattern curves
A Brisbane start-up recorded the total number of downloads of its new app at the end of each of the first 10 weeks after launch.
| Week | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Downloads (thousands) | 2 | 3 | 4 | 6 | 8 | 12 | 17 | 24 | 34 | 48 |
A team member calculates and reports "a strong positive linear association between week and downloads". Evaluate this conclusion.
Step 1: Check the calculation
With week as and downloads as , technology gives . The arithmetic is right.
Step 2: Look at the form
The downloads grow faster each week — by 1 thousand between weeks 1 and 2, but by 14 thousand between weeks 9 and 10 — so the points curve upwards. The form is non-linear.
Step 3: Decide whether r applies
measures the strength of a linear association only. For a curved pattern it isn't an appropriate measure, however close to 1 it is.
Step 4: Evaluate the conclusion
The conclusion is not valid. The association is strong and positive, but it is non-linear, so it should not be described as linear or measured with . Treating it as linear would badly underestimate the downloads in later weeks.
"Evaluate" needs a judgement and a reason. Here the reason is the form you can see in the scatterplot.
Try it yourself first, then check the working one step at a time.
Answer
The conclusion is not valid. Although , the scatterplot curves upwards, so the association is strong, positive and non-linear, and should not be used to describe it.
Method
Always look at the scatterplot before using .
If the pattern is curved, describe the form as non-linear and don't rely on .
A value of near does not prove an association is linear.
Watch out for
Accepting the conclusion because is close to 1.
Common mistake
Outliers drag r around
A used-car dealer's data on nine cars' ages and odometer readings had . One reading had been typed as 8 (thousand km) instead of 82. With the typo fixed, . A single point changed the description from "strong" to "almost perfect" — so check outliers before you quote .
Where does r come from?
Pearson's is the average product of the -scores of each pair (dividing by , as for the sample standard deviation):
Draw a vertical line through and a horizontal line through . A point to the top-right or bottom-left has two -scores with the same sign, so it adds a positive product; a point to the top-left or bottom-right adds a negative product.
When most points lie top-right and bottom-left, the products are mostly positive and is close to 1. When the points are spread over all four quarters, the products cancel and is close to 0. Dividing by the standard deviations makes unit-free, which is why it always lies between and .
For 40 teenagers, Pearson's correlation coefficient between weekly hours of screen time and weekly hours of physical activity is . Which statement interprets this correctly?
Summary
measures the strength and direction of a linear association, and always lies between and .
The sign gives the direction; the size gives the strength (strong for , moderate from 0.5, weak from 0.25, and no linear association below 0.25).
Calculate with technology: the linear regression option in your calculator's statistics mode, or
=CORREL()in a spreadsheet.Interpret with its value, strength, direction, the word linear and the context.
Check the scatterplot first: is meaningless for a non-linear pattern, and outliers can distort it.
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.