Skip to content
IB Diploma ProgrammeSL & HL

Spearman's rank correlation

Mathematics: Applications and Interpretation SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Spearman's rank correlation notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Spearman's rank correlation notes as text: skim, search, and jump between subtopics.

~13 min read

1. Ranking data and finding the coefficient

Spearman's rank correlation coefficient, r_s, measures how well two sets of data agree in rank order. To rank a set, give the smallest value rank 1, the next smallest rank 2, and so on. Rank each variable separately.

If data items are equal, ranks should be averaged. Two values tied for places 3 and 4 both get rank 3.5. The next value is then rank 5.

In examinations r_s should be found using technology. r_s is the Pearson coefficient of the two lists of ranks. So enter the ranks, not the raw data, as two lists on the GDC and find their correlation coefficient. The command term *calculate* needs the ranks and the value, with the method shown.

-1 ≤ r_s ≤ 1

tied ranks: 3, 4 → 3.5, 3.5

Worked example 14 marks

Six dancers are scored out of 60 by two judges. The scores are in the table.

Calculate Spearman's rank correlation coefficient, r_s. Show the ranks you use.

DancerABCDEF
Judge 112151592018
Judge 2304138255247
  1. 1

    M1: rank each judge's scores separately, smallest as rank 1 [1]

  2. 2

    A1: Judge 1 ranks 2, 3.5, 3.5, 1, 6, 5, with the tied 15s given the average rank (3+4)/2 = 3.5 [1]

  3. 3

    A1: Judge 2 ranks 2, 4, 3, 1, 6, 5 [1]

  4. 4

    A1: GDC with the two lists of ranks: r_s = 0.986 (3 s.f.) [1]

2. Reading the value of the coefficient

The sign of r_s gives the direction. A positive value means that as one variable increases, the other tends to increase. A negative value means that as one increases, the other tends to decrease.

A value close to 1 or -1 means the ranks agree closely. A value close to 0 means the ranks show little agreement.

An interpretation answers in the context of the question. The command term *interpret* needs the meaning in words, using the names of the two variables. r_s compares rank order only, so it says nothing about how big the values are.

Worked example 13 marks

Ten students record the hours they spend gaming each week and their test score. Spearman's rank correlation coefficient is found to be r_s = -0.92.

Interpret this value in context.

  1. 1

    A1: the value is negative, so students who game for more hours tend to have lower test scores [1]

  2. 2

    A1: it is close to -1, so the ranks are in close agreement in reverse order: a strong relationship [1]

  3. 3

    R1: r_s compares ranks, so it describes the order of the data and not how much the scores change per hour [1]

3. Pearson's or Spearman's coefficient

Pearson's product moment correlation coefficient, r, is useful when testing for only linearity. It measures how close the points lie to a straight line.

Spearman's coefficient is useful for any monotonic relationship. A relationship is monotonic when one variable always increases, or always decreases, as the other increases. It need not be a straight line.

So a curve that always rises can give r_s = 1 and r < 1. A value of r below 1 does not mean the relationship is weak. It means the points do not lie exactly on a straight line. Students are not asked to derive or prove either coefficient.

Worked example 14 marks

The table shows eight pairs of values.

(a) Find Pearson's r and Spearman's r_s.

(b) Explain why r_s is greater than r.

x12345678
y235916305295
  1. 1

    M1: enter both lists on the GDC and use the correlation tools [1]

  2. 2

    A1: r = 0.878 and r_s = 1 (3 s.f.) [1]

  3. 3

    R1: y increases every time x increases, so the relationship is monotonic and the ranks agree exactly [1]

  4. 4

    R1: the points follow a curve and not a straight line, so r is below 1 [1]

4. The effect of outliers

An outlier is a value far from the rest of the data. Pearson's r uses the actual values, so one outlier can change r a lot.

Spearman's correlation coefficient is less sensitive to outliers. However extreme a value is, its rank can be no larger than the number of data pairs. So one extreme value cannot pull r_s far.

When one extreme value stays in the same rank position, r_s does not change at all. Say this in terms of rank. Do not say that an outlier "has no effect" on r_s in every case.

Worked example 14 marks

Eight pairs of values have x = 1, 2, 3, 4, 5, 6, 7, 8 and y = 3, 5, 6, 8, 9, 12, 13, 14. For these data r = 0.994 and r_s = 1.

The last value of y is then changed from 14 to 40.

(a) Find the new values of r and r_s.

(b) Comment on the change.

  1. 1

    M1: enter the new list 3, 5, 6, 8, 9, 12, 13, 40 on the GDC [1]

  2. 2

    A1: r = 0.785 and r_s = 1 (3 s.f.) [1]

  3. 3

    R1: r falls because the value 40 is far from the pattern of the rest, so the points are further from a straight line [1]

  4. 4

    R1: 40 is still the largest y, so its rank is still 8 and r_s is unchanged: it is less sensitive to the outlier [1]

Recap

  • Rank each variable separately, smallest as rank 1. Equal values get the average of the ranks they share.
  • Find r_s using technology. -1 ≤ r_s ≤ 1.
  • The sign of r_s gives the direction: positive, as one rises the other tends to rise. A value near ± 1 shows close agreement of ranks.
  • Pearson's r tests for linearity only. Spearman's r_s suits any monotonic relationship.
  • A monotonic curve can have r_s = 1 and r < 1.
  • Spearman's coefficient is less sensitive to outliers than Pearson's.
  • Show the ranks and the GDC step. A bare value may earn no marks.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. State the smallest and largest values that Spearman's rank correlation coefficient can take.1 mark
    Answer
    1. The smallest value is -1 and the largest value is 1.

    Trap: Giving 0 and 1, which loses the negative values for relationships that go in opposite directions.

  2. Do not use a GDC. Write down the ranks of the values 14, 9, 21, 17, giving the smallest value rank 1.2 marks
    Answer
    1. Sorted: 9, 14, 17, 21.
    2. Ranks in the order given: 2, 1, 4, 3.

    Trap: Writing the sorted values, or ranks 1, 2, 3, 4 in the order given, instead of the rank of each value in its own position.

  3. Do not use a GDC. Write down the ranks of the values 9, 6, 9, 15, 9, 12, giving the smallest value rank 1.2 marks
    Answer
    1. Sorted: 6, 9, 9, 9, 12, 15. The three 9s share places 2, 3, 4, so each has rank (2+3+4)/3 = 3.
    2. Ranks in the order given: 3, 1, 3, 6, 3, 5.

    Trap: Giving the tied values the ranks 2, 3, 4 in turn, or all rank 2, instead of their average.

  4. In a set of data, y always increases as x increases, along a curve that gets steeper. Spearman's coefficient and Pearson's coefficient are found for the data. State which coefficient is equal to 1, and give a reason.2 marks
    Answer
    1. Spearman's r_s = 1.
    2. The relationship is monotonic, so the ranks agree exactly, but it is not linear so r < 1.

    Trap: Choosing Pearson's r because the relationship looks strong, when r tests for linearity only.

  5. A teacher finds r_s = -0.85 for the ranks of students' hours of sleep and the number of lessons they are late for. Interpret this value.2 marks
    Answer
    1. It is negative, so students who sleep more hours tend to be late for fewer lessons.
    2. It is close to -1, so the ranks agree closely in reverse order.

    Trap: Reading a negative value as a weak or poor relationship, when only the closeness to 0 shows weakness.

  6. Five pairs of values are x = 4, 7, 1, 9, 6 and y = 3, 8, 2, 10, 5. Use a GDC to find Spearman's r_s. Pearson's r for the same data is 0.946 (3 s.f.). Explain why the two values are different.3 marks
    Answer
    1. Ranks of x: 2, 4, 1, 5, 3. Ranks of y: 2, 4, 1, 5, 3.
    2. The ranks are identical, so r_s = 1.
    3. The relationship is monotonic but the points do not lie exactly on a straight line, so r < 1.

    Trap: Quoting Pearson's r = 0.946 as the answer, when r_s is found from the ranks.

  7. A school compares a student's mock score and final score. The values for six students are x = 2, 5, 5, 8, 9, 11 and y = 10, 14, 12, 20, 19, 25. Calculate r_s.4 marks
    Answer
    1. Ranks of x: 1, 2.5, 2.5, 4, 5, 6, as the two 5s share places 2 and 3.
    2. Ranks of y: 1, 3, 2, 5, 4, 6.
    3. GDC with the ranks as two lists: r_s = 0.928 (3 s.f.).

    Trap: Not averaging the tied ranks, which gives a different and incorrect value of r_s.

  8. The table shows the time x in hours since a culture of bacteria was started and the number y of bacteria in thousands. For these data r = 0.878 and r_s = 1. (a) State which coefficient describes the relationship better, and why. (b) Hence explain why the value r = 0.878 does not show a weak relationship. | x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | | --- | --- | --- | --- | --- | --- | --- | --- | | y | 1 | 2 | 4 | 8 | 16 | 32 | 64 |4 marks
    Answer
    1. (a)
    2. r_s describes it better. y increases every time x increases, so the relationship is monotonic.
    3. (b)
    4. r tests only for linearity. The number doubles each hour, so the points follow a curve and r is below 1 even though the ranks agree exactly.

    Trap: Reading 0.878 as a weaker relationship than 1, when the two coefficients answer different questions.

  9. A gardener records, for eight sunflowers, the hours of sunlight per day x and the height y in cm. x = 4, 5, 5, 6, 7, 8, 9, 10 and y = 62, 70, 66, 75, 81, 80, 88, 210. The last plant was grown in a greenhouse. (a) Calculate r_s. Show the ranks you use. (b) Find r. (c) The greenhouse plant is removed. Find the new values of r_s and r, and comment on the effect of the outlier on each coefficient.7 marks
    Answer
    1. (a)
    2. Ranks of x: 1, 2.5, 2.5, 4, 5, 6, 7, 8, as the two 5s share places 2 and 3.
    3. Ranks of y: 1, 3, 2, 4, 6, 5, 7, 8.
    4. GDC with the two lists of ranks: r_s = 0.970 (3 s.f.).
    5. (b)
    6. GDC with the raw data: r = 0.742 (3 s.f.).
    7. (c)
    8. Seven plants. Ranks of x: 1, 2.5, 2.5, 4, 5, 6, 7. Ranks of y: 1, 3, 2, 4, 6, 5, 7. GDC: r_s = 0.955 and r = 0.969 (3 s.f.).
    9. r rises from 0.742 to 0.969: the height 210 cm was far from the straight-line pattern and pulled r down a lot.
    10. r_s moves only from 0.970 to 0.955, because 210 cm was ranked 8, no further from the rest than the next rank. So r_s is less sensitive to the outlier than r.

    Trap: Assuming r_s is exactly unchanged when the outlier is removed, or using ranks 2 and 3 for the tied 5s, instead of re-ranking the seven plants and averaging the tied ranks.

  10. A scientist measures the dose x in mg of a drug given to six patients and the change y in a blood reading. x = 10, 20, 30, 40, 50, 60 and y = 4, 9, 15, 3, 2, 1. (a) Use your GDC to find r_s and r. (b) For the four doses from 30 mg to 60 mg only, find r_s and r. (c) The scientist says that the large negative r_s in part (a) shows that a larger dose always lowers the blood reading. Evaluate this statement.7 marks
    Answer
    1. (a)
    2. Ranks of x: 1, 2, 3, 4, 5, 6. Ranks of y in the order given: 4, 5, 6, 3, 2, 1.
    3. GDC with the ranks: r_s = -0.771. GDC with the raw data: r = -0.479 (3 s.f.).
    4. (b)
    5. Ranks of x: 1, 2, 3, 4. Ranks of y = 15, 3, 2, 1: 4, 3, 2, 1, exactly reversed, so r_s = -1.
    6. GDC with the raw data: r = -0.847 (3 s.f.).
    7. (c)
    8. Against the statement: from 10 mg to 30 mg the reading rises, so over all six doses the relationship is not monotonic and r_s = -0.771 cannot show that a larger dose always lowers it.
    9. For it: from 30 mg to 60 mg the reading always falls, so r_s = -1 there. That decrease is monotonic but not linear, so r = -0.847.
    10. Judgement: the statement holds only for doses from 30 mg to 60 mg, not for every dose.

    Trap: Trusting a value of r_s near -0.8 without checking that the data are monotonic, and giving a one-sided evaluation with no judgement.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
Pearson's r is always the best coefficient to use.Pearson's r tests for linearity. Spearman's r_s suits any monotonic relationship.
r = 0.878 for a curve that always rises, so y is not closely related to x.r_s = 1, so the relationship is monotonic. r < 1 shows only that it is not exactly linear.
Two equal values take the next two ranks, 3 and 4.Equal values get the average rank, 3.5 and 3.5.
An outlier does not matter to either coefficient.Spearman's coefficient is less sensitive to outliers than Pearson's.

Frequently asked questions

What is the difference between Pearson's r and Spearman's rank correlation coefficient?
Pearson's r tests for linearity, while Spearman's r_s suits any monotonic relationship, where y always increases as x increases. Spearman's r_s measures how well two sets of data agree in rank order. For a curve that always rises, r_s = 1 but r = 0.878, because the points are not exactly linear.
How do you rank data for Spearman's rank correlation coefficient when values are equal?
Rank each variable separately, giving the smallest value rank 1. Equal values get the average of the ranks they share. For 9, 6, 9, 15, 9, 12, the three 9s share places 2, 3 and 4, so each has rank (2+3+4)/3 = 3. Show the ranks and the GDC step.
Why is Spearman's rank correlation less affected by an outlier than Pearson's r?
Spearman's coefficient is less sensitive to outliers than Pearson's, because it uses ranks rather than the actual values. When the last y-value changes from 14 to 40, r falls from 0.994 to 0.785, but r_s stays at 1. The value 40 is still the largest y, so its rank is still 8.
How do you interpret a value of Spearman's rank correlation coefficient in context?
The sign of r_s gives the direction, and a value close to 1 or -1 shows that the ranks agree closely. For r_s = -0.92 between hours spent gaming and test scores, students who game for more hours tend to have lower test scores. Say that r_s compares ranks, so it does not show how much the scores change per hour.
Is Pearson's r always the best correlation coefficient to use?
No. Pearson's r tests for linearity, while Spearman's r_s suits any monotonic relationship. A curve where y always increases as x increases can have r_s = 1 and r below 1. A value of r = 0.878 for such a curve does not mean that y is not closely related to x.
What must you show when calculating Spearman's rank correlation coefficient in an exam?
Show the ranks you use and the GDC step, because a bare value may earn no marks. Rank each judge's scores separately, with the smallest as rank 1, and give tied values the average rank. Enter the two lists of ranks on the GDC to find r_s. The answer is r_s = 0.986 to three significant figures.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters