WhatsApp us
IB DP Maths17 Nov 2026

IB Maths AI SL Regression and Spearman's Rank: Pearson's r, the Regression Line and When to Use Each Coefficient

Pearson's r measures how close data is to a straight line; Spearman's rank measures whether one variable consistently rises or falls with the other. How to calculate both on the GDC, handle tied ranks, use the regression line safely and interpret everything in context.

IB Maths AI SL Regression and Spearman's Rank: Pearson's r, the Regression Line and When to Use Each Coefficient

Pearson's r asks one question: how close are these points to a straight line? Spearman's rank correlation asks a different one: when one variable goes up, does the other consistently go up (or down), whatever the shape? Most lost marks in IB Maths AI SL bivariate statistics come from mixing up those two questions, or from using a regression line where it should not be used.

This guide shows how to calculate both coefficients, how to deal with tied ranks, how to read a regression line in context, and how an outlier can change everything, with four worked examples.

Where bivariate statistics sits

Bivariate data is part of Topic 4, Statistics and probability, the largest topic in AI SL. Both papers require a GDC, so you will rarely calculate r by hand. The marks are in choosing the right tool, setting out the calculator work and, above all, interpreting. For one-to-one practice on exactly these question styles, see our IB Maths AI SL tuition.

The hypothesis tests that often follow (chi-squared and the t-test) are covered separately in our AI SL statistics and hypothesis tests guide, so this post stays with correlation and regression.

The vocabulary in one table

TermMeaning
Pearson's rStrength and direction of a linear relationship, from −1 to 1
Spearman's r_sStrength and direction of a monotonic relationship (always increasing or always decreasing), calculated from ranks
Regression line of y on xThe least-squares line y = ax + b, used to predict y from a given x
Mean point (x̄, ȳ)Always lies on the regression line, and should lie on any trend line you draw by eye
InterpolationPredicting inside the range of the data: generally reliable if r is strong
ExtrapolationPredicting outside the range: unreliable

For describing strength, many textbooks use rough bands: |r| above about 0.75 strong, 0.5 to 0.75 moderate, 0.25 to 0.5 weak, below that very weak. Use the words your teacher uses, and always say "linear" and give the direction.

Worked example 1: regression line, prediction and extrapolation

Eight students record hours of revision (x) and their test score out of 100 (y).

x (hours)2356891112
y (score)4148526063707481

(a) Find r and describe the correlation.

GDC (two-variable statistics or linear regression): r = 0.990. This is a strong positive linear correlation.

(b) Find the regression line of y on x. y = 3.73x + 35.0 (3 s.f.).

(c) Interpret the gradient and the intercept.

  • Gradient: each extra hour of revision is associated with about 3.73 more marks.
  • Intercept: the model predicts 35 marks with no revision, but x = 0 is outside the data (2 to 12 hours), so treat this with caution.

(d) Predict the score for 7 hours. 3.73 × 7 + 35.0 ≈ 61.1. This is interpolation with a strong r, so it is reliable. In fact x̄ = 7 and ȳ = 61.125, so this prediction is the mean point itself.

(e) Comment on using the line for 20 hours. It gives 109.6, which is impossible on a test out of 100. Twenty hours is far outside the data, so this is extrapolation and not reliable.

(f) Does revision cause higher scores? Correlation alone does not show this. Students who revise more may also attend more lessons or find the topic easier. Our post on correlation and causation in IB maths explores this point.

Worked example 2: Spearman's rank with tied values

Eight flats are listed with their distance from a metro station (km) and monthly rent (₹ thousand).

FlatABCDEFGH
Distance1.22.53.14.04.05.67.28.5
Rent6255584744404130
Distance rank1234.54.5678
Rent rank86754231

Ranking. Rank each variable separately, in the same direction (here smallest = 1). D and E tie on 4.0 km, sharing ranks 4 and 5, so each gets the average, 4.5.

Calculating r_s. Enter the two rank lists in the GDC and calculate Pearson's r on the ranks: r_s = −0.946 (3 s.f.).

Interpretation. Strong negative association: flats further from the station tend to be cheaper, and the pattern is consistent.

About the shortcut formula. Some books give r_s = 1 − 6Σd² ÷ (n(n² − 1)). Here Σd² = 162.5, giving −0.935. That differs from −0.946 because of the tie: the shortcut is exact only when there are no tied ranks. Calculating r on the ranks works in every case.

Worked example 3: when Pearson's r understates a relationship

A bacteria count is recorded each hour.

Hour t12345678
Count359173365129257

GDC: r = 0.850, but r_s = 1.

The count rises every single hour, so the ranks match perfectly and Spearman's coefficient is 1. Pearson's r is lower only because the points curve upwards rather than lying on a line. A straight-line model would be the wrong choice here; the data calls for an exponential model, the kind of choice covered in our AI SL modelling post.

Worked example 4: one outlier

Return to the revision data from example 1 and add a ninth student: 4 hours of revision and a score of 95.

Without the new studentWith the new student
Pearson's r0.9900.524
Spearman's r_s10.65

One unusual point roughly halves Pearson's r. Spearman's falls too, but less, because a rank cannot be more than "highest"; the 95 counts as rank 9 however large it is. When a question asks about "the effect of the outlier", say which coefficient changes more and why. Then check the context: is 95 a recording error, or a real student who should stay in the data?

Choosing the coefficient

SituationUse
Scatter looks roughly like a straight linePearson's r, then the regression line if you need predictions
Steadily rising or falling but curvedSpearman's r_s
Data is already ranks (judges' positions, league places)Spearman's r_s
Clear outliers you cannot removeSpearman's r_s is less affected

Mistakes our tutors see

  1. "Strong correlation" with no direction or "linear". Write "strong positive linear correlation".
  2. Predicting x from the y on x line. AI SL questions use the y on x line to predict y from x.
  3. Extrapolating without comment. If x is outside the data range, say the prediction is unreliable.
  4. Ranking in opposite directions. Both variables must be ranked the same way.
  5. Ignoring ties, or giving tied values consecutive ranks.
  6. r_s = 1 read as "linear". It means perfectly monotonic, not a straight line.
  7. Causation claims. A strong r never proves that x causes y.

Exam technique

  • Write what the GDC computed: "from GDC, r = 0.990" and "y = 3.73x + 35.0".
  • Use the variables' names when interpreting the gradient: "per hour of revision", not "per x".
  • Keep three significant figures for coefficients, but use unrounded line values when predicting.
  • For "is the prediction reliable?", give two reasons: strength of r and whether x is in range.
  • Bivariate data is also a common area for the exploration. Our walk-through of the IA criteria shows how the mathematics is judged there; the analysis and writing stay the student's own.

Self-check

  1. Describe r = −0.12. Answer: very weak negative linear correlation.
  2. Rank the values 5, 8, 8, 10 from smallest. Answer: 1, 2.5, 2.5, 4.
  3. A regression line is y = 2.4x + 11, from data with x between 5 and 20. Predict y when x = 12, and comment on using x = 40. Answer: 39.8; x = 40 is extrapolation, so unreliable.
  4. A regression line has gradient 4 and the mean point is (6, 30). Find its equation. Answer: y = 4x + 6.
  5. Data rises every time but curves sharply. Which coefficient describes the relationship better? Answer: Spearman's r_s.

Where this leads next

The same data skills support the AI SL normal distribution and descriptive statistics guide, and the AI SL topics overview shows the rest of Topic 4. At HL, curved data is straightened with logarithms before regression; our AI HL linearising data post shows how.

How Maths Bodhi helps

In the free demo our tutor gives a short scatter-plot question and listens to how the student interprets it, because that is where AI SL statistics marks are won or lost. Each student is matched to a tutor who teaches AI SL, works on their own GDC model, and practises past-paper style questions with written feedback on interpretation. For focused practice before mocks or finals, see our IB exam maths support.

Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.

Written and checked by the Maths Bodhi team. Facts checked against official IB sources, November 2026.

Frequently asked questions

What is the difference between Pearson's and Spearman's correlation?
Pearson's r measures how close data is to a straight line. Spearman's r_s uses ranks and measures whether one variable consistently increases or decreases as the other increases, whatever the shape.
How do you calculate Spearman's rank on the GDC?
Rank each variable in the same direction, give tied values the average of their ranks, enter the two rank lists and calculate Pearson's r on them. That value is r_s.
How do you deal with tied ranks in Spearman's rank?
Give each tied value the mean of the ranks they would share. Two values tied for 4th and 5th each get rank 4.5.
When is a regression line prediction reliable?
When the correlation is strong and the x-value is inside the range of the data. Predictions outside the range are extrapolation and are unreliable.
Can I use the regression line of y on x to predict x?
No. The y on x line is designed to predict y from a given x. In AI SL, use it only in that direction.
Does a strong correlation mean one variable causes the other?
No. Correlation shows an association. Another factor may drive both variables, so causation needs other evidence.
IB maths AI SL regressionSpearman's rank correlationPearson's correlation coefficientIB maths AI SL bivariate dataIB maths tutor Gurgaon

Related guides

Keep exploring this maths topic

IB DP Maths18 Oct 2026

IB Maths AI SL Statistics: Regression, Chi-Squared and t-Tests Made Clear

Statistics and probability is the biggest topic in IB Maths Applications and Interpretation SL. How regression, correlation, chi-squared and t-tests work, how to write conclusions that earn full marks, and a study plan for AI SL students.

IB maths AI SL statisticsIB maths statisticschi-squared test IBIB maths AI SL

By Ajay Vatsyayan

Read guide

IB DP Maths17 Nov 2026

IB Maths AI SL Topics and Syllabus: Every Topic Through the Calculator Skills It Needs, With Hours and a Checklist

The IB Maths Applications and Interpretation SL syllabus organised by the GDC skills each topic needs: teaching hours, both papers, a tick-off checklist, two short worked examples and the changes for students starting DP in August 2027.

IB maths AI SL topicsIB maths AI SL syllabusIB maths GDC skillsAI SL checklist

By Maths Bodhi Team

Read guide

IB DP Maths17 Nov 2026

IB Maths AI SL Normal Distribution and Descriptive Statistics: Quartiles, Outliers, Standard Deviation and Normal Probabilities

How to summarise a data set the way AI SL markschemes expect, then move on to normal distribution probabilities and inverse normal questions on the GDC. Four worked examples, the usual traps and a self-check.

IB maths AI SL normal distributionIB maths AI SL descriptive statisticsinverse normalbox plots and outliers

By Maths Bodhi Team

Read guide

IB DP Maths17 Nov 2026

IB Maths AA SL Statistics: Outliers, Standard Deviation, Correlation and the Two Regression Lines

AA SL statistics mixes quick summary-statistics marks with longer bivariate questions on Pearson's r and regression. What the topic covers, four worked examples (IQR outliers, scaling data, y on x and x on y), the interpretation marks students drop, and a self-check set.

IB maths AA SL statisticsregression and correlation IBPearson's rIB maths GDC statistics

By Maths Bodhi Team

Read guide

IB DP Maths17 Nov 2026

IB Maths AI SL Sequences, Approximation and Percentage Error: Bounds, Standard Form and Real-Life Sequence Models

The first AI SL topic mixes rounding, bounds, percentage error and standard form with arithmetic and geometric sequences used as models. Four original worked examples, the "find n" trap and a self-check.

IB maths AI SL sequencespercentage errorupper and lower boundsarithmetic and geometric sequences

By Maths Bodhi Team

Read guide

IB DP Maths17 Nov 2026

Does IB Maths AI SL Have Calculus? Derivatives, Optimisation, Integration and the Trapezoidal Rule

Yes, AI SL has a full calculus topic, but a narrower one than AA. What it includes, four original worked examples (tangents and normals, optimisation, integration with a boundary condition and the trapezoidal rule) and the mistakes that cost marks.

IB maths AI SL calculustrapezoidal ruleIB maths AI SL differentiationIB maths optimisation

By Maths Bodhi Team

Read guide