Rank Correlation: Testing for Association Using Ranks | OCR B (MEI) A Level Maths notes
Free preview: Rank Correlation: Testing for Association Using Ranks
Correlation of Ranks and Association
Year 2 (A level only)
Let's start with what you know. The product moment correlation coefficient (pmcc, r) measures how close points are to a straight line. But that is not always the question we want to ask. Two judges at a baking contest put 8 cakes in order. There are no measurements at all, just two orders. How can we measure whether the judges agree?
- Sometimes we only care whether one variable tends to go up when the other goes up, whatever the shape.
- Or the data may only be ranks (1st, 2nd, 3rd...), such as two judges placing contestants in order.
The new idea
- A rank correlation coefficient measures the correlation between the ranks of the data rather than the actual values.
- The usual one is Spearman's rank correlation coefficient, .
- Like r, it lies between โ1 and +1: +1 means the rankings agree exactly, โ1 means they are exactly reversed.

Following the graph
- As x increases, y always increases, but along a curve, not a straight line.
- The points do not lie on a straight line, so the pmcc is about 0.89, not 1.
- In rank order, the smallest x goes with the smallest y, the second smallest with the second smallest, and so on. The ranks agree perfectly, so .
- So measures association: a tendency for one variable to increase (or decrease) as the other increases, not necessarily in a straight line.
๐ก In plain words
- pmcc: how straight is the pattern?
- : do the two orders agree? A pattern that always goes up (or always down) is called monotonic.
| Use the pmcc when | Use rank correlation when |
|---|---|
| You are interested in a linear relationship | You are interested in any increasing or decreasing relationship (association) |
| The data are measurements, ideally roughly bivariate Normal (an elliptical scatter) | The data are ranks, or the scatter is clearly non-linear, or there are outliers |
โ๏ธ YOUR TURN 1
Try this first:
For each situation, would you use the pmcc or rank correlation? Give a reason.
- Two wine tasters each put 10 wines in order of preference.
- Heights and arm spans of 30 adults; the scatter diagram is an elliptical cloud.
- A scatter diagram that rises steeply, then levels off, but always increases.
Answer:
- Rank correlation: the data are ranks.
- pmcc: measurements with a roughly linear, elliptical scatter.
- Rank correlation: the pattern is monotonic but not linear.
Finding Spearman's Coefficient
The recipe
- Rank each variable separately: 1 for the largest, or 1 for the smallest, but the same way for both. Why: we compare orders, not sizes.
- For each item find d, the difference between its two ranks. Why: small differences mean the orders agree.
- Square each d (this removes the minus signs) and add them up to get .
- If there are no tied ranks, use the formula:
- is the number of pairs and is the sum of the squared rank differences.
- is exactly the pmcc of the ranks, so a calculator can also find it from the ranks.
๐ก In plain words
- Rankings that agree give small d's, so is small and is close to 1.
- If every d is 0, .
๐ Watch me do it: two judges rank 8 contestants
| Contestant | A | B | C | D | E | F | G | H |
|---|---|---|---|---|---|---|---|---|
| Judge 1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| Judge 2 | 2 | 1 | 4 | 3 | 6 | 5 | 8 | 7 |
| d | โ1 | 1 | โ1 | 1 | โ1 | 1 | โ1 | 1 |
| dยฒ | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| What I write | Why I do it |
|---|---|
| d = Judge 1 rank โ Judge 2 rank: โ1, 1, โ1, 1, ... | Steps 1 and 2: already ranked, so just subtract. |
| , n = 8 | Step 3. |
| Work out the bottom separately to avoid slips. | |
| Step 4. | |
| Strong positive association: the judges largely agree. | Interpret in context. |
Unlock the full note: start 7 days free.
Log in or subscribe to read the rest of this note. Members also get the AI tutor, practice quizzes, mock exams and flashcards for this topic.
Log in ยท Subscribe ยท Start free trial
All notes in Hypothesis Testing
- The Language of Hypothesis Testing
- Rank Correlation: Testing for Association Using Ranks
- Testing a Mean with a Large Sample When the Variance Is Unknown
- One-Tailed Hypothesis Tests for a Binomial Proportion
- Two-Tailed Binomial Tests and Critical Regions
- Testing for Correlation with the Product Moment Correlation Coefficient
- The Distribution of the Sample Mean
- Hypothesis Tests for the Mean of a Normal Distribution
- Move Up a Grade: A Level Maths Hypothesis Testing
- Tricky Bits: A Level Maths Hypothesis Testing
What's inside for this topic
10 teacher notes, 171 practice questions, 58 flashcards, 7 quizzes.
Get the full notes, every practice question, flashcards, quizzes and mock papers.
Previous note: The Language of Hypothesis Testing Next note: Testing a Mean with a Large Sample When the Variance Is Unknown