Updated · By Pete Bromfield, IB examiner

IA statistics, step by step · Spearman's rank

Spearman's rank correlation coefficient, step by step

AI SLAI HL

When the relationship is consistent but curved, or the data are only an order, Spearman's rank does what Pearson's r cannot. Here it is worked from the ranks, side by side with Pearson's r on the same data.

Example data, invented for this guide. The context is realistic, but the numbers were made up to show the method. Use your own collected or sourced data in your IA.

When to use it

  • The scatter graph shows a consistent rise or fall that is not a straight line.
  • One or both variables are rankings (league positions, judges' scores).
  • There are outliers you want a statistic to resist.

Course fit: AI SL and HL: Spearman's rank correlation coefficient rₛ, and when to use it rather than Pearson's r, are in the AI SL core. It is not in the AA courses — AA students can use it if they explain it.

The example data

Ten students reported how many hours they revised in the week before a mock exam, and their score.

Example data: mock exam score
ix: Hours of revision (h)y: Mock exam score (%)
1138
2252
3349
4463
5570
6668
7874
81079
91281
101580

Spearman's rank from the ranks

Rank each variable, find the differences in rank, and use the formula.

Step 1 · Rank each variable separately

Give the smallest value rank 1 (or the largest — but do the same for both variables). Tied values share the mean of the ranks they would take.

Ranks and differences
ixyrank of xrank of ydd²
11381100
225223−11
33493211
44634400
557056−11
66686511
78747700
810798800
91281910−11
10158010911
Σ6

n = 10; no ties.

Step 2 · Spearman's rank correlation coefficient

rs = 1 − 6Σd² / [n(n² − 1)] = 1 − 6 × 6 / (10 × 99) = 0.9636

With no ties this equals Pearson's r calculated on the ranks — the way a GDC does it.

Scatter graph of mock exam score against hours of revision
The points rise consistently but level off: not a straight line.

In the full worked analysis

  • The rest of the working: steps 3 to 3
  • For comparison: Pearson's r on the same data
  • What the example shows, in context
  • On a GDC: TI-84 Plus CE, TI-Nspire CX and Casio fx-CG50
  • What examiners look for
  • Common mistakes
  • Limitations to discuss

How this maps to the IA criteria

These are the current criteria A–E, for exams up to November 2028. For the new courses (first assessment May 2029) the IB has confirmed one set of four criteria for SL and HL: A Problem specification (4 marks), B Abstraction (6), C Computation (4) and D Interpretation (6), still 20 marks and 20% of the grade at both levels — see the IB's new AA and AI subject briefs. The detailed descriptors come with the new guide; check with your teacher which criteria apply to you. The advice is our summary, not the IB's wording.

Get feedback on your write-up Self-check your draft

Frequently asked questions

When should I use Spearman's rank instead of Pearson's r?

When the relationship is monotonic but not linear, when your data are ranks, or when outliers would distort r. Look at the scatter graph first.

How do I deal with ties in Spearman's rank?

Give tied values the mean of the ranks they share, then calculate Pearson's r on the ranks (the formula with Σd² is only exact without ties).

Can I test whether rₛ is significant?

Testing rₛ uses tables of critical values and goes beyond the IB syllabus. You may do it if you explain it; otherwise interpret rₛ and discuss the sample size.

Next steps

Related: Pearson's correlation and regression · Choosing the right test. Or analyse your own data, find a data set in the IA data bank, and see what the IA package adds.

Free: the IA checklist an examiner uses

Every check for Criteria A–E in a 4-page PDF, the mistakes that cost the most marks and a self-assessment grid. We'll email it with a short IA tip every few days, timed to your deadline if you give it. Free — no account, no payment.