☰ IB Maths AI HL · course menu
Topics
IB Maths AI HL · free cheatsheet
Bivariate Statistics cheatsheet (IB Maths AI HL)
Scatter diagrams, Pearson's r, the coefficient of determination R², the least-squares regression line and Spearman's rank correlation for IB Mathematics Applications & Interpretation HL — fit the line on the GDC, predict with confidence, and separate correlation from causation. Written by an IB-certified teacher.
What this cheatsheet covers
Bivariate statistics is the modelling heart of the Statistics & Probability strand in IB Mathematics Applications & Interpretation HL. Instead of one list of numbers you are handed two variables measured on the same individuals — hours and marks, temperature and sales, dose and response — and asked whether they move together, how strongly, and what one lets you predict about the other. A calculator is always allowed, so the mechanical work — correlation coefficients, the line of best fit — takes a few keystrokes on the GDC. The marks live in choosing the right tool (Pearson versus Spearman, $y$ on $x$ versus $x$ on $y$), reading the value correctly, and interpreting it in context — above all, never mistaking correlation for causation.
This cheatsheet condenses SL 4.4 onto one page — scatter diagrams, Pearson's product–moment correlation coefficient $r$, the coefficient of determination $R^2$, the least-squares regression line and how to predict with it, outliers, and Spearman's rank correlation — and flags the traps that quietly cost marks (extrapolation, swapping the variables, confusing $r$ with $R^2$).
Scatter diagrams: direction, form & strength
SL 4.4Bivariate data:Two variables recorded on each individual, displayed as points on the scatter diagram.Direction:Positive (points rise to the right), negative (fall to the right), or none.Form:Linear (points hug a straight line) or non-linear (they follow a curve).Strength:How tightly the points cluster about that trend — weak, moderate or strong.
A scatter diagram plots each pair $(x,y)$ as a point. Before any calculation, describe what you see in three words: direction, form and strength.
Pearson's correlation coefficient $r$
SL 4.4Range:$-1\le r\le 1$.Sign = direction:$r>0$ positive association, $r<0$ negative.Size = strength:$|r|$ near $1$ is a strong linear fit; near $0$ is weak or none.On the GDC:Enter the two lists, run 2-variable statistics / LinReg, and read $r$ directly.
Pearson's product–moment correlation coefficient $r$ puts a single number on the strength and direction of the linear association.
| $|r|$ (roughly) | Interpretation |
|---|---|
| $0$ | no linear correlation |
| $\approx 0.25$ | weak |
| $\approx 0.50$ | moderate |
| $\approx 0.75$ | strong |
| $1$ | perfect (all points exactly collinear) |
The coefficient of determination $R^2$
SL 4.4Definition:$R^2=r^2$.Meaning:The proportion (or percentage) of the variation in $y$ that the model explains.Range:$0\le R^2\le 1$.
Square the correlation coefficient and you get the coefficient of determination — the single most useful "how good is the model?" number.
Correlation is not causation
SL 4.4Lurking variable:A hidden third (confounding) variable can drive both $x$ and $y$, manufacturing a correlation with no direct link between them.Classic example:Ice-cream sales and drowning deaths correlate strongly — but both are driven by a lurking variable, summer temperature; ice cream does not cause drowning.
This is the interpretation mark examiners love. A strong $r$ shows that two variables move together — it does not prove that one causes the other.
The least-squares regression line of $y$ on $x$
SL 4.4Equation:$\hat y=ax+b$ — $a$ is the gradient, $b$ the $y$-intercept (GDC LinReg returns both).Mean point:The line always passes through $(\bar x,\bar y)$, so equivalently $\hat y=\bar y+a(x-\bar x)$.Gradient (from sums):$a=\dfrac{n\sum xy-\sum x\sum y}{n\sum x^2-(\sum x)^2}$.Gradient (from spread):$a=r\,\dfrac{s_y}{s_x}$ — connects the line back to the correlation.Intercept:$b=\bar y-a\bar x$ (follows from the line passing through the mean point).
When the association is linear and reasonably strong, the least-squares regression line of $y$ on $x$ summarises the trend. It is the straight line that minimises the sum of the squared vertical distances from the points.
Interpreting the gradient & intercept
SL 4.4Gradient $a$:The estimated change in $y$ for each one-unit increase in $x$ — a rate, carrying units of $y$ per unit of $x$.A change:A change $\Delta x$ produces $\Delta y=a\,\Delta x$; the intercept plays no part in a change.Intercept $b$:The predicted value of $y$ when $x=0$.
Once you have $\hat y=ax+b$, an exam often asks you to interpret the numbers in context — a pure AI reading-the-answer skill.
Predicting: interpolation vs extrapolation
SL 4.4Interpolation:Predicting for an $x$ inside the data range — reliable.Extrapolation:Predicting for an $x$ outside the range — unreliable; the pattern may not continue.Precondition:Only trust a prediction when $|r|$ (equivalently $R^2$) shows a strong linear fit.
The whole point of the line is prediction: substitute a value of $x$ into $\hat y=ax+b$. Whether you can trust the answer depends on where that $x$ sits.
Outliers & prediction error
SL 4.4Outlier effect:One outlier can drag the least-squares line and distort $r$; removing a justified outlier and recomputing changes the gradient.A prediction is an estimate:$\hat y=\bar y+a(x-\bar x)$ gives an approximate value $v_A$, rarely exactly the actual value $v_E$.Percentage error:$\varepsilon=\left|\dfrac{v_A-v_E}{v_E}\right|\times100\%$.
Two things temper the tidy line: a single stray point can distort it, and even a good line only estimates.
Spearman's rank correlation $r_s$
SL 4.4Idea:Rank each variable separately, then correlate the ranks rather than the raw values.Coefficient:$r_s=1-\dfrac{6\sum d^2}{n(n^2-1)}$, where $d$ is the difference in ranks for each individual.Range:$-1\le r_s\le 1$, read exactly like Pearson's $r$ (sign = direction, size = strength).Quick example:With $n=5$ and $\sum d^2=2$: $\;r_s=1-\dfrac{6(2)}{5(25-1)}=1-0.1=0.9$ — a strong positive rank correlation.
When the relationship is monotonic (steadily increasing or decreasing) but perhaps curved, or when an outlier would distort Pearson's $r$, switch to Spearman's rank correlation.
Exam attack plan
All sections
| Question cue | What to do | Watch for |
|---|---|---|
| "Describe the correlation" | State direction + form + strength from the scatter | Give all three words; "correlation" means linear only |
| "Find the correlation coefficient" | GDC 2-var stats / LinReg → read $r$ | Quote the sign; $r$ measures linear association |
| "What does $R^2$ tell you?" | $R^2=r^2$ = fraction of the variation in $y$ explained | $R^2$ has no sign; recover $r$ as $\pm\sqrt{R^2}$ |
| "Does $x$ cause $y$?" | No — correlation $\neq$ causation; name a lurking variable | Never infer cause from observational data |
| "Find the regression line" | GDC LinReg → $\hat y=ax+b$ | Use $y$ on $x$ to predict $y$; it passes through $(\bar x,\bar y)$ |
| "Interpret the gradient" | $a=$ change in $y$ per $1$-unit rise in $x$ (with units) | Intercept doesn't affect a change: $\Delta y=a\,\Delta x$ |
| "Predict $y$ for a given $x$" | Substitute into the stored full-accuracy line | Interpolation is safe; extrapolation is unreliable |
| "Curved data or outliers" | Use Spearman's $r_s$ (ranks) or a non-linear model | Rank both the same way; divide by $n(n^2-1)$ |
Worked Example — Correlation, Regression & Prediction
Question (AI HL Paper 2 style — 8 marks)
A tutor records the weekly revision time $x$ (hours) and the test score $y$ (%) of eight students:
$x$: 3, 5, 6, 8, 10, 12, 14, 15 $y$: 45, 52, 54, 63, 68, 74, 80, 85.
(a) Use your GDC to find Pearson's correlation coefficient $r$.
(b) Describe the correlation.
(c) State the coefficient of determination $R^2$ and interpret it.
(d) Find the equation of the regression line of $y$ on $x$.
(e) Estimate the score of a student who revises for 13 hours, and comment on whether the model should be used to predict the score for 25 hours.
Solution
- (a) Enter the eight pairs and run 2-Var Stats / LinReg on the GDC. (M1) This gives $r=0.998$ (3 s.f.). (A1)
- (b) Since $r$ is very close to $+1$, the correlation is strong, positive and linear. (A1)
- (c) $R^2=r^2=0.996$, so about $99.6\%$ of the variation in test score is explained by revision time. (A1)
- (d) From LinReg, $a=3.25$ and $b=35.5$ (3 s.f.), so the line of $y$ on $x$ is $\hat y=3.25x+35.5$. (M1)(A1) (It passes through the mean point $(\bar x,\bar y)=(9.13,\,65.1)$ — a quick sanity check.)
- (e) At $x=13$: $\hat y=3.25(13)+35.5=77.75\approx 77.8\%$. (M1)(A1) Since $13$ h lies inside the data range ($3$–$15$ h), this is interpolation and is reliable. Predicting at $x=25$ h gives $\hat y=3.25(25)+35.5=116.75\approx 117\%$ — an impossible score above $100\%$. This is extrapolation far beyond the data, so the model should not be used there.
Examiner's note: keep the units ($\%$) and round to 3 s.f. unless told otherwise. Two marks are routinely lost here — by fitting $x$ on $y$ when the question predicts $y$, and by trusting the extrapolated $117\%$ instead of rejecting it. Remember the line gives an estimate: the actual score of a real 13-hour student will sit a little either side of $77.8\%$.
Common Student Questions
- What's the difference between $r$ and $R^2$?
- Should I use the $y$-on-$x$ line or the $x$-on-$y$ line?
- When do I use Spearman's rank instead of Pearson's $r$?
- Why can't I trust a prediction far outside the data (extrapolation)?
- Does a strong correlation prove that one variable causes the other?
What's the difference between $r$ and $R^2$?
Should I use the $y$-on-$x$ line or the $x$-on-$y$ line?
When do I use Spearman's rank instead of Pearson's $r$?
Why can't I trust a prediction far outside the data (extrapolation)?
Does a strong correlation prove that one variable causes the other?
Your next step




