Prob and StatsTwo-Variable DataS-ID.C.8

The Correlation Coefficient

r measures the direction and strength of a linear pattern.

Not started Jump to practice

Words like "strong" and "weak" are vague. The correlation coefficient $r$ puts one number on the direction and strength of a linear pattern in a scatterplot. It is built from z-scores, using each variable's standard deviation.

Key idea

$$r = \dfrac{1}{n - 1}\sum z_x z_y,$$ the average product of the z-scores. Always $-1 \le r \le 1$. The sign gives the direction; values near $\pm 1$ mean the dots hug a line; values near 0 mean no linear pattern. $r$ has no units.

Why it works

Split the scatterplot at the point of means $(\bar{x}, \bar{y})$. A dot in the upper right has $z_x > 0$ and $z_y > 0$, so its product is positive; a dot in the lower left has two negatives, also a positive product. Dots in the other two corners give negative products. If most dots sit in the upper-right and lower-left corners, the products add to a large positive number: a positive association. Because z-scores have no units, changing inches to centimeters cannot change $r$, and swapping x and y cannot either.
Drag points and watch r in the readout. Try to make r near 0 with the points on a curve.

Worked example: Computing r by hand

Find $r$ for the points $(1, 3), (2, 5), (3, 4), (4, 7), (5, 6)$.
  1. Means: $\bar{x} = 3$, $\bar{y} = 5$. Deviations: x: $-2, -1, 0, 1, 2$; y: $-2, 0, -1, 2, 1$.
  2. Both variables have $\sum(\text{dev})^2 = 10$, so $s_x = s_y = \sqrt{10/4} \approx 1.58$, and $z_x z_y = \dfrac{(\text{x dev})(\text{y dev})}{2.5}$.
  3. Products of deviations: $4, 0, 0, 2, 2$, so $z_x z_y$: $1.6, 0, 0, 0.8, 0.8$.
  4. $$r = \dfrac{1.6 + 0 + 0 + 0.8 + 0.8}{4} = \dfrac{3.2}{4} = 0.8$$

Answer: $r = 0.8$: a fairly strong positive linear association.

Worked example: What r does and does not say

For $x = 1, 2, \ldots, 10$ and $y = x^2$, software gives $r \approx 0.97$. Does that mean the relationship is linear?
  1. The points lie exactly on a curve, $y = x^2$, with no scatter at all.
  2. $r$ is high because the curve bends only gently over this range, so a line comes close.
  3. A high $r$ does not prove the form is linear; you must look at the plot (and, soon, the residuals).

Answer: No. The relationship is a perfect curve; r only measures how close it is to a line.

Common mistake

Two classic misreadings. (1) Reading $r$ as the slope: $r = 0.8$ does not mean y rises 0.8 per unit of x; slope depends on units, $r$ does not. (2) Calling a strong curved pattern "no relationship" because $r \approx 0$; a U-shaped pattern can have $r$ near 0. Check by looking at the scatterplot every time.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • OpenStax, Introductory Statistics 2e, section 12.3 The Regression Equation
  • OpenStax, Introductory Statistics 2e, section 12.4 Testing the Significance of the Correlation Coefficient
  • Common Core State Standards for Mathematics, S-ID.C.8 (Compute and interpret the correlation coefficient)
@teddyrookbook GitHub