MathsFurther Statistics 2 › Correlation coefficients: product moment and Spearman

Correlation coefficients: product moment and Spearman

Two numbers between −1 and 1, measuring two different things. One asks how close the points are to a straight line; the other only asks whether the orders agree.

Year FMEDEXCEL 9FM0 FS2

Builds on Least squares regression and residuals and Correlation and regression.

IN THIS TOPIC

  • Calculate the product moment correlation coefficient from summary statistics.
  • State the conditions for its use and the effect of coding on it.
  • Rank data, handle ties, and calculate Spearman's coefficient.

WHAT YOU PROBABLY THINK

A correlation coefficient near zero means the two variables are unrelated.

Measuring straightness

The product moment correlation coefficient scales the covariance so that it always lies between −1 and 1:

r = SxySxx Syy

It measures linear association only. Points sitting perfectly on a parabola can give r near zero while being completely determined by each other, so the opening claim overreads a small value: it rules out a straight-line relationship, nothing more. A sketch is always worth more than the number alone.

Coding cannot change it. Replacing x by (x − a)/b and y by (y − c)/d leaves r alone when b and d are positive, and flips its sign when exactly one of them is negative, because the shape of the scatter is unchanged by shifting and rescaling the axes.

The product moment correlation coefficient on a scale from −1 to 1, with the five-point data set at 0.853−1010.853perfect negativeperfect positiver = S(xy) / √(S(xx) S(yy)) = 8 / √88
FIG. 1The correlation scale from −1 to 1 with the worked data set marked at 0.853, well into strong positive territory.

WORKED EXAMPLE

The coefficient from summary statistics

For the five points (1, 2), (2, 4), (3, 5), (4, 4), (5, 6), find r.

From before, Sxx = 10 and Sxy = 8, and Syy = 97 − 21²/5 = 8.8.

r = 8/√(10 × 8.8) = 8/√88 = 0.853 to three decimal places.

Strong positive linear correlation, which matches the scatter and the small residual sum of squares found earlier.

When only the order matters

Spearman's rank correlation coefficient replaces each value by its rank and measures how well the two orderings agree. It is the right tool when the data are already ranks, when the relationship is rising or falling but not straight, or when outliers would drag the product moment coefficient about.

rs = 1 - 6 Σ d2n(n2 - 1)

Here d is the difference in ranks for each item. Tied values share the average of the ranks they would have taken, so two items tied for third and fourth both get 3.5. With ties present the formula is an approximation, and the product moment coefficient applied to the ranks is exact; an exam question with ties will usually accept either, but say which you used.

Two judges' rankings of eight competitors, with each pair differing by one place: Σd² = 8 and rs = 0.905judge A rankjudge B rankrs = 1 − 6Σd² / n(n² − 1) = 0.905
FIG. 2Eight competitors ranked by two judges, every pair differing by a single place: the sum of squared differences is 8.

YOUR TURN

Two judges disagree slightly

Judge A ranks eight competitors 1 to 8 in order. Judge B ranks them 2, 1, 4, 3, 6, 5, 8, 7. Calculate Spearman's coefficient and interpret it.

Show the working

The differences are −1, 1, −1, 1, −1, 1, −1, 1, so d² = 1 each time and Σd² = 8.

n(n² − 1) = 8 × 63 = 504, so rs = 1 − 48/504 = 1 − 0.0952.

That is 0.905 to three decimal places: the judges agree very closely, differing only by swapping adjacent pairs.

THE EXAM BIT

  • Quote the formula before substituting; the summary statistics carry method marks on their own.
  • Say what r measures in context, and add that it detects linear association only.
  • For Spearman, set the ranks out in a table with a d and a d² column.
  • State that coding leaves the product moment coefficient unchanged rather than recalculating from coded data.

CHECK YOURSELF

Six items are ranked by two people. The rank differences are 1, −1, 0, 2, −1, −1. Find Spearman's coefficient.

Show a hint

Square, sum, then substitute with n = 6.

Show the answer

Σ

d

²

=

1

+

1

+

0

+

4

+

1

+

1

=

8

.

n

(

n

²

1

)

=

6

×

3

5

=

2

1

0

,

s

o

r

s

=

1

4

8

/

2

1

0

=

1

0

.

2

2

8

6

=

0

.

7

7

1

t

o

t

h

r

e

e

d

e

c

i

m

a

l

p

l

a

c

e

s

.

The product moment coefficient r = S(xy)/√(S(xx)S(yy)) measures linear association only, and coding cannot change it.

Spearman's rs = 1 − 6Σd²/[n(n² − 1)] measures agreement of orderings, with tied values sharing the average rank.

WORKBOOK

Printable practice for this topic: original exam-style questions with room to work, and a fully worked answer book. Free to use; please do not redistribute or sell.

CHECK YOUR PROGRESS

Rate how confident you feel with each objective for this lesson. Ratings are saved in this browser, on this device only.

  • Calculate the product moment correlation coefficient from summary statistics.
  • State the conditions for its use and the effect of coding on it.
  • Rank data, handle ties, and calculate Spearman's coefficient.

Open the full revision checklist to see every objective in the course in one place.

No animated video for this topic yet; these notes stand alone.