Unit 5 · Topic 5.2 Beta

Correlation

3 min read · freeNot practiced

A scatterplot shows the direction, form and strength of a relationship, but "strong" and "fairly strong" are hard to compare from one plot to the next. For a linear pattern, one number does the job: the correlation, written rr.

What rr tells you

  • The sign gives the direction: r>0r > 0 for a positive association, r<0r < 0 for a negative one.
  • The size gives the strength of the linear pattern: near 1 or −1-1 when points hug a line, near 0 when there is no linear pattern.
  • rr is always between −1-1 and 1. It equals 1 or −1-1 only when every point lies exactly on a line.
Four small scatterplots with their correlations computed from the data: strong positive, r = 0.99; moderate negative, r = -0.79; weak positive, r = 0.29; and a strong curved arch with r = 0.04.
Figure 1. Four data sets with their correlations. LevlPrep original diagram.

The figure shows four data sets. Rough guide: a size above about 0.8 is strong, 0.5 to 0.8 moderate, below 0.5 weak. But look at the fourth plot: the points follow an arch almost perfectly, yet r=0.04r = 0.04. Correlation measures how well a line fits, nothing else.

Where the number comes from

The formula uses z-scores, which you met with one variable. Standardize each xx and each yy, multiply each pair, and average the products (dividing by n−1n - 1, as for a standard deviation):

r=1n−1∑zxzy,zx=x−x¯sx,zy=y−y¯sy.r = \frac{1}{n - 1}\sum z_x z_y, \qquad z_x = \frac{x - \bar{x}}{s_x},\quad z_y = \frac{y - \bar{y}}{s_y}.

Why does this work? Draw lines at x¯\bar{x} and y¯\bar{y}. A point above average on both variables has two positive z-scores, so a positive product; a point below average on both has two negative z-scores, again a positive product. Points in the other two corners give negative products. If most points sit in the upper right and lower left, the products add up to a positive rr.

Worked example. Find rr for the four points (2,3)(2, 3), (4,5)(4, 5), (6,4)(6, 4), (8,8)(8, 8).

Means and standard deviations: x¯=5\bar{x} = 5, sx=2.582s_x = 2.582; y¯=5\bar{y} = 5, sy=2.160s_y = 2.160.

z-scores: zxz_x=−1.162,−0.387,0.387,1.162= -1.162, -0.387, 0.387, 1.162 and zyz_y=−0.926,0,−0.463,1.389= -0.926, 0, -0.463, 1.389.

Products: 1.0761.076, 00, −0.179-0.179, 1.6141.614, which add to 2.5112.511.

rr=14−1(2.511)= \frac{1}{4 - 1}(2.511)=0.837= 0.837: a fairly strong, positive, linear association.

In practice, use technology: a linear regression or correlation command on the two lists reports rr directly. The formula is for understanding, not for long hand calculations.

Interpreting rr in context

For the teacher's 8 students, technology gives r=0.951r = 0.951 between hours studied and quiz score. Write it like this: "There is a strong, positive, linear association between hours studied and quiz score for these students." Do not write "95% of students ..." or "scores rise 0.95 points per hour". rr is not a percent and has no units.

Properties to remember

PropertyWhy
No units; changing units (hours to minutes) leaves rr the samez-scores have no units
Switching xx and yy leaves rr the samethe formula treats the variables alike
Not resistant: one outlier can change rr a lota far-off point has large z-scores
Measures linear association onlya symmetric curve gives products that cancel

To see the outlier effect: add a ninth student who studied 6 hours but scored 40, and rr falls from 0.95 to about 0.14.

Correlation is not causation

A strong correlation in observational data does not mean one variable causes the other. Across cities, the number of fire trucks sent to a fire is strongly correlated with the damage, because bigger fires bring more trucks and do more damage. A third variable linked to both, here the size of the fire, can create a correlation. Only a randomized experiment supports a claim of cause.

Spot a mistake on this page?