What r cannot see · Statistics & Data Science Class 9–10 | StemPy Lab
Course 5.1·Lesson 3 of 3
What r cannot see
The correlation coefficient sees only straight lines. A perfect curve can give r near 0, and one wrong point can turn a strong r upside down. This lesson shows the cases where r misleads and the habit that protects you: always look at the scatter plot first.
about 30 min1 simulation1 practice question1 Python program6 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
explain why r near 0 does not mean "no relationship";
show how one outlier can change r a lot;
list what r does and does not tell you, and look at the plot before you trust a number.
A park on hot and cold days
A made-up park counts its visitors at noon on seven days, from a cold day to a very hot one.
Noon temperature (∘C)
Visitors
10
120
14
260
18
380
22
420
26
370
30
250
34
110
The visitors rise and then fall. On a cold day few people come, and on a very hot day few people come too. The relationship is strong. Yet r=−0.037, very close to 0.
A scatter plot of a made-up park. Noon temperature in degrees Celsius runs across from 8 to 36, and the number of visitors runs up from 0 to 480. Seven dots rise to a peak near 22 degrees and then fall again, in the shape of a hill.
Why? The rising half gives positive products, and the falling half gives negative products. They cancel. r looks only for a straight line, and there is no straight line here. So r near 0 means no straight-line relationship. It does not mean no relationship.
One wrong number
Eight made-up students measure their height and their arm span in centimetres. The two are nearly equal for most people, and the plot is a strong straight line: r=0.987. Then one span of 171cm is typed as 17cm. With that one mistake, r=−0.465. One point out of eight has turned a strong positive pattern into a negative one.
An outlier is a point far from the rest of the pattern. It can come from a typing error, a broken instrument, or a real but unusual case. r uses squares of distances, so a point far away has a large pull. What should you do? First check whether it is a mistake, and correct it if it is. If it is real, report r with and without it, and say why.
What r does not tell you
It does not see curves. A strong curved pattern can have r near 0, or a high r that hides a bend.
It is pulled by outliers. One point can raise r, lower it, or change its sign.
It does not give the slope.r=0.9 can belong to a steep line or a nearly flat one. The next course finds the slope.
It does not prove a cause. Two variables can move together because a third one drives both. The course on correlation and cause is about this.
It changes with the range. If you look only at students who practise 6 to 8 hours, the pattern looks weaker than for the whole class.
So the rule is simple. Draw the scatter plot first. Work out r only for a pattern that looks straight.
Your turn: new numbers
Try it in Python
The program works out r for the park, and for the arm spans with and without the typing mistake.
The usual mistakes
Saying "r=0, so there is no relationship". Say "no straight-line relationship", and look at the plot.
Deleting an awkward point. Remove a point only if it is a mistake. Otherwise report both results.
Comparing r from different ranges. A narrow range of x usually gives a smaller r.
Reading a cause into r. A high r shows that two variables move together, nothing more.
Remember these
r measures straight-line patterns only.
One outlier can change r a lot, even its sign.
Look at the scatter plot before you trust r.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
A friend says: "The correlation between hours of sleep and test marks is 0.02, so sleep has nothing to do with marks." What would you ask first?
A scatter plot has 20 points close to a rising line and one point far below it at the right. If that point is removed, does r go up or down?
Can two data sets with the same r=0.8 have very different scatter plots?
Why does an outlier far from the means pull r so strongly?
A data set has r=0.97. Does that prove that the points lie on a straight line?
References
OpenStax, Introductory Statistics, Chapter 12 (Linear Regression and Correlation), the sections on the correlation coefficient and on outliers.
Enroll free in Scatter Plots and Correlation
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.