Spearman's rank correlation
Studying this course? Keep your progress in one place.
Revised this already? Try an exam question and get it marked free
Key facts
- Spearman's rank is an inferential test of correlation. It needs paired scores that are at least ordinal.
- Rank each set of scores, find d for each pair, square it, add to get Σd², then use rs = 1 - 6Σd² / n(n² - 1).
- rs runs from -1 to +1. The sign gives the direction and the size gives the strength.
- Compare rs, ignoring the sign, with the critical value. The result is significant if it is equal to or greater than the critical value.
When to use Spearman's rank
Use Spearman's rank when you are testing for a relationship between two co-variables, each participant gives a pair of scores, and the data are at least ordinal.
Spearman's rank is a non-parametric test. It only needs the scores to be put in order, so it can be used with ordinal data, such as a 1 to 10 rating, as well as with interval data.
It tests a correlation, so the hypothesis predicts a relationship, for example: there is a relationship between hours of sleep and aggression score. A directional hypothesis names the direction (negative or positive). A non-directional hypothesis only predicts a relationship.
The null hypothesis says there is no relationship and that any pattern is due to chance.
- 1
Testing for a relationship?
a correlation between two co-variables, not a difference
- 2
Paired scores?
each participant gives one score on each co-variable
- 3
At least ordinal data?
the scores can be put in order of size
- 4
Use Spearman's rank
rank, calculate rs and compare with the critical value
Which hypothesis is suitable for a Spearman's rank test?
Calculating rs step by step
Rank each set of scores separately, find the difference between each pair of ranks, square the differences, add them up and put the total into the formula.
The formula is rs = 1 - (6 × Σd²) / (n(n² - 1)), where n is the number of pairs and d is the difference between the two ranks for one participant.
Rank from the lowest score as 1. If two scores tie, give each the mean of the ranks they would have taken. Check your working: the differences d should add up to zero.
The answer always lies between -1 and +1. If your answer is outside this range, you have made a mistake.
- 1
Rank the first set
lowest score = rank 1; tied scores share the mean rank
- 2
Rank the second set
in the same way, separately
- 3
Find d
rank of the first score minus rank of the second
- 4
Square d
d² removes the minus signs
- 5
Add to get Σd²
the sum of all the d² values
- 6
Use the formula
rs = 1 - 6Σd² / n(n² - 1)
For n = 10 and Σd² = 66, what is n(n² - 1)?
A worked example with a tie
In this example five students give hours of screen time and hours of sleep. Two students tie on screen time, so they share the mean rank, and rs works out as -0.925.
Example data (made up). Screen hours: 3, 5, 5, 8, 9. Sleep hours: 9, 8.5, 7.5, 6, 5.
Screen ranks: 1, 2.5, 2.5, 4, 5. Sleep ranks: 5, 4, 3, 2, 1.
d: -4, -1.5, -0.5, 2, 4. d²: 16, 2.25, 0.25, 4, 16. Σd² = 38.5.
n(n² - 1) = 5 × 24 = 120. 6 × 38.5 = 231. 231 / 120 = 1.925. rs = 1 - 1.925 = -0.925, a strong negative correlation.
- 1
Rank screen hours
3, 5, 5, 8, 9 gives 1, 2.5, 2.5, 4, 5
- 2
Rank sleep hours
9, 8.5, 7.5, 6, 5 gives 5, 4, 3, 2, 1
- 3
Find d
-4, -1.5, -0.5, 2, 4 (these add to 0)
- 4
Square d
16, 2.25, 0.25, 4, 16 gives Σd² = 38.5
- 5
Use the formula
rs = 1 - 231 / 120 = 1 - 1.925 = -0.925
Two scores tie for ranks 2 and 3. What rank does each get?
Critical values and significance
Compare rs, ignoring its sign, with the critical value for n at the chosen significance level. If rs is equal to or greater than the critical value, the result is significant.
Psychologists usually use p ≤ 0.05: the probability that the result is due to chance is 5% or less. Use the critical values table given in the exam, and choose the column for a one-tailed (directional) or two-tailed (non-directional) hypothesis.
If rs is significant, reject the null hypothesis and accept the alternative. If not, retain the null.
A Type I error is rejecting a true null hypothesis. A Type II error is retaining a false one.
- 1
Find n and the level
n is the number of pairs; usually p ≤ 0.05
- 2
Pick one- or two-tailed
directional or non-directional hypothesis
- 3
Read the critical value
from the table for that n and level
- 4
Compare, ignoring the sign
is rs equal to or greater than the critical value?
- 5
State the conclusion
significant: reject the null; not significant: retain it
Type I error
- Reject a true null hypothesis
- A false positive
- More likely if the level is too lenient
Type II error
- Retain a false null hypothesis
- A missed effect
- More likely if the level is too strict
rs = -0.80 and the critical value is 0.65. What is the conclusion?
Strengths and limits of the test
Spearman's rank suits ordinal data, ignores outliers and gives strength and direction, but it loses detail through ranking and cannot show cause and effect.
Strengths: it works with ordinal data, such as ratings, so it suits many psychology measures; extreme scores have less effect because only ranks are used; and rs gives both strength and direction.
Limitations: ranking loses information about the size of differences; many ties reduce accuracy; small samples may not generalise; and a significant result shows an association only, so third variables and directionality still apply.
- 1
Is the data ordinal?
ranking suits ratings and scores
- 2
Are there many ties?
ties reduce accuracy
- 3
How big is the sample?
small samples limit generalisability
- 4
Is it only a correlation?
no cause and effect
Strengths
- Works with ordinal data
- Less affected by outliers
- Gives strength and direction
Limitations
- Ranking loses detail
- Ties reduce accuracy
- No cause and effect
Why can a significant Spearman's rank result not show that one variable causes the other?
Try an exam question
Explain how a researcher would use Spearman's rank test to decide whether a correlation is significant.
[4 marks]
- [1]Ranks each set of scores separately, from lowest to highest.
- [1]Finds the difference between each pair of ranks, squares it and adds them to get Σd².
- [1]Calculates rs using the formula and finds the critical value for n at p ≤ 0.05.
- [1]Compares rs, ignoring the sign, with the critical value: significant if it is equal to or greater, so reject the null hypothesis.
That's the notes covered.
Carry on to the next subtopic.
Try a question
Identify one reason why Spearman's rank test is suitable for analysing these data.
1 mark, marked against the mark scheme
Identify one reason why Spearman's rank test is suitable for analysing these data.
1 mark, marked against the mark scheme
