Paper ZeroSign in

IB Maths Analysis and Approaches SL

Correlation and regression: question types and practice

Correlation and regression carried 2% of the marks in the 20 recent exams, through 3 kinds of question. The one worth the most marks is Regression on the GDC.

Syllabus: AA SL 4.4 and 4.10. SL 4.4 is linear correlation of bivariate data: scatter diagrams, lines of best fit by eye through the mean point, Pearson's product-moment correlation coefficient rr, the equation of the regression line of yy on xx, its use for prediction, and the meaning of the parameters aa and bb in y=ax+by = ax + b. SL 4.10 adds the regression line of xx on yy and its use for prediction. Both lines and rr come from technology. The means and the one-variable statistics this guide uses are in Descriptive statistics.
Papers: Almost always Paper 2: 46 of the 48 logged parts. Regression appears in 16 of the 20 exam versions (15 of them on Paper 2), usually as question 1, 2 or 3 of Section A, worth 4–7 marks. Paper 1 has set it once, with both regression lines given and whole-number answers. On Paper 2 the lines and rr come from the GDC, unless the question gives a line in its stem.
Scope: AA SL only.

  • rr and both lines always come from technology: no hand calculation of rr or of the coefficients is asked.
  • Critical values of rr are given in the question when they are needed (SL 4.4). None was needed 2021–26.
  • Spearman's rank correlation and the χ2\chi^2 test are AI SL, and R2R^2 (the coefficient of determination) is AI HL: none of them is in AA.
  • Only linear regression is fitted to a data set in AA statistics questions. Exponential and power regression are AI, not AA: in AA such a model is given, or its constants are found from facts stated in the question (Exponential and log models). A GDC can fit a sine curve, but no 2021–26 question has asked for one (Sine curves fitted by technology).

Formula booklet: nothing for SL 4.4 or 4.10: no formula for rr or for either line. The mean of a set of data, xˉ=∑i=1kfixin\bar{x} = \frac{\sum_{i=1}^{k} f_i x_i}{n} where n=∑i=1kfin = \sum_{i=1}^{k} f_i (SL 4.3), is given.

  • Not given: that every regression line passes through the mean point (xˉ,yˉ)(\bar{x}, \bar{y}); that xx is predicted from yy with the line of xx on yy, not with the line of yy on xx rearranged; −1≤r≤1-1 \le r \le 1; what aa and bb mean; that a prediction outside the range of the data is unreliable.

Try one now

A Correlation and regression question of the type "Regression on the GDC". Work it out on paper, then type your answer here.

Calculator[1]

The length xx cm and the width yy cm of eight leaves from one plant are shown.

xx (cm)yy (cm)
4.24.22.12.1
5.15.12.62.6
5.85.82.72.7
6.56.53.33.3
7.37.33.43.4
8.08.03.93.9
9.49.44.34.3
10.610.65.05.0

Write down the value of rr.

Free, with no account. You see where each mark went.

The 3 question types

  1. Regression on the GDC

    The line, r, a prediction and what they mean

    • In 12 of 20 recent exams
    • 2% of the marks

    Paper 2 (calculator) only, 1–3 marks a part (usually 2), in a Section A question of 4–7 marks; once inside a Section B question. Very common (12 of 20 exam versions, 32 logged parts). A question usually runs line → rr → prediction, sometimes with an interpretation or a reliability mark at the end.

  2. The mean point

    Every regression line passes through (x̄, ȳ)

    • In 6 of 20 recent exams

    Paper 2 (calculator) mostly (8 of 9 logged parts), 1–3 marks a part; once on Paper 1 (no calculator) with both lines given. Common (6 of 20 exam versions). It is often a small part inside a longer regression question, and twice it led into a missing data value.

  3. Predict x from y

    Choose the right regression line

    • In 4 of 20 recent exams

    Paper 2 (calculator) mostly (6 of 7 logged parts), 1–3 marks a part; once on Paper 1 (no calculator) with both lines given. Typical (4 of 20 exam versions). It sits inside a longer regression question, next to parts that predict yy or find the means, so the whole point is to notice which variable is being estimated.

The ideas you need

Scatter diagrams and correlation

Bivariate data are pairs of values measured on the same thing: the height and the trunk diameter of each tree, the altitude and the temperature of each weather station. A scatter diagram plots each pair as a point (x,y)(x, y). Usually the variable you predict from goes on the horizontal axis (xx) and the variable you predict on the vertical axis (yy). The question fixes which variable is xx: keep its letters even when a later part predicts xx from yy (The regression line of x on y).

Correlation describes the pattern of the points, in three words:

  • direction
    Choose from
    positive / negative / none
    What you see
    positive: yy tends to increase as xx increases; negative: yy tends to decrease as xx increases
  • strength
    Choose from
    strong / moderate / weak
    What you see
    strong: the points lie close to a straight line; weak: they are loosely scattered around one
  • form
    Choose from
    linear / non-linear
    What you see
    the points follow a straight line, or a curve
  • A line of best fit by eye passes through the mean point (xˉ,yˉ)(\bar{x}, \bar{y}), with roughly as many points above it as below it (SL 4.4). The regression line on the GDC is the exact version of this line (The regression line of y on x).
  • Describing a correlation and drawing a line by eye are syllabus content, but neither has been set on its own since 2021: the questions go straight to the GDC.

Mini-example: the points (2,5)(2, 5), (4,9)(4, 9), (6,10)(6, 10) and (8,14)(8, 14) rise from left to right, close to a straight line: a strong positive linear correlation. Their mean point is (2+4+6+84,5+9+10+144)=(5,9.5)\left(\frac{2 + 4 + 6 + 8}{4}, \frac{5 + 9 + 10 + 14}{4}\right) = (5, 9.5), so a line of best fit by eye must go through (5,9.5)(5, 9.5).

The points rise from left to right, close to a straight line: a strong positive linear correlation. Their mean point is (5,9.5)(5, 9.5), and a line of best fit by eye must pass through it, with about as many points above as below.

Pearson's product-moment correlation coefficient, r

rr measures how close the points are to a straight line. It comes from the GDC (linear regression), always with the line.

  • −1≤r≤1-1 \le r \le 1. The sign gives the direction; the size gives the strength. r=1r = 1 or r=−1r = -1 only when every point lies exactly on a line; rr near 00 means no linear correlation.
  • Keep the sign. r=−0.992r = -0.992 is a strong negative correlation; writing 0.9920.992 loses the mark.
  • Words for sizes. The IB has no official cut-offs. A common rough guide: ∣r∣\lvert r \rvert above 0.750.75 is strong, 0.50.5 to 0.750.75 moderate, 0.250.25 to 0.50.5 weak, and below 0.250.25 very weak or none.
  • rr is the same for both regression lines, and it has no units: swapping xx and yy, or changing the units (metres to centimetres), leaves it unchanged.
  • Linear only. A strong curved pattern can have rr close to 00 (mini-example below). Look at the scatter diagram, not just at rr.
  • Correlation is not causation. A strong rr does not show that xx causes yy: both may depend on a third variable. Know this, but write it only when it is asked about: markschemes give R0 when it is offered as the answer to a different question.
  • Critical values of rr are given in the question when they are needed (SL 4.4): if ∣r∣\lvert r \rvert is bigger than the critical value, the correlation is significant. This has not been set since 2021.

Mini-example: the five points (−2,4)(-2, 4), (−1,1)(-1, 1), (0,0)(0, 0), (1,1)(1, 1) and (2,4)(2, 4) all lie on y=x2y = x^2, yet r=0r = 0: there is a perfect relationship, but no linear one.

  • y=x2y = x^2

All five points lie on the parabola y=x2y = x^2, yet r=0r = 0: as xx increases, yy falls and then rises, so no straight line fits. rr measures closeness to a line, so look at the scatter diagram, not only at rr.

The regression line of y on x

The regression line of yy on xx is the line the GDC fits to the data to predict yy from xx. It makes the sum of the squares of the vertical distances from the points to the line as small as possible (the least-squares line), which is why it is the line for predicting yy. The IB writes it as

y=ax+by = ax + b

with aa the gradient and bb the yy-intercept. Some calculator screens use the letters the other way round: copy the numbers by their meaning, not by their letters (linear regression).

  • It passes through the mean point (xˉ,yˉ)(\bar{x}, \bar{y}). That fact is The mean point.
  • Write it with the question's variables and 3 s.f. coefficients: T=−0.00583h+24.5T = -0.00583h + 24.5, not y=−0.00583x+24.5y = -0.00583x + 24.5. Predict with the unrounded coefficients (keep full-accuracy values).
  • aa in context: the change in yy for each one-unit increase in xx, on average, with units and a direction: "for each additional km, the time decreases by 0.176 minutes, on average". A change in xx changes the predicted yy by aa times that change: the bb cancels (gradient).
  • bb in context: the predicted yy when x=0x = 0. It is often meaningless, because x=0x = 0 is far outside the data.

Mini-example: for 12 flats in one town, the regression line of the monthly rent RR dollars on the floor area AA m² is R=14.6A+210R = 14.6A + 210, for 35≤A≤12035 \le A \le 120.

  • a=14.6a = 14.6: each additional square metre adds about 14.6014.60 dollars to the monthly rent. A flat 1010 m² larger is predicted to cost 14.6×10=14614.6 \times 10 = 146 dollars more.
  • b=210b = 210: the predicted rent of a flat with no floor area. Meaningless: A=0A = 0 is far outside the data.
  • An 8080 m² flat: R=14.6×80+210=1378R = 14.6 \times 80 + 210 = 1378 dollars.
  • R=14.6A+210R = 14.6A + 210

The gradient 14.614.6 is the extra rent for each extra square metre, so a flat 1010 m² larger costs about 146146 dollars more, and an 8080 m² flat is predicted at 13781378 dollars. The intercept 210210, the rent of a flat with no floor area, lies far outside the data, in the dashed stretch.

The regression line of x on y

To predict xx from yy, swap the roles: the regression line of xx on yy, x=cy+dx = cy + d, makes the sum of the squares of the horizontal distances as small as possible. On the GDC, swap the two lists (linear regression).

  • It is a different line. Rearranging y=ax+by = ax + b to make xx the subject does not give it, unless r=±1r = \pm 1. The weaker the correlation, the further apart the two lines are.
  • Both lines pass through (xˉ,yˉ)(\bar{x}, \bar{y}), so they cross there: near the mean point they give almost the same estimates, and far from it they differ most.
  • The rule: the variable you want to predict must be the subject of the line. yy from xx: the line of yy on xx. xx from yy: the line of xx on yy.
  • "Of … on …": in "the regression line of TT on hh", the variable after "of" (TT) is the one predicted, and the one after "on" (hh) is used to predict it.

Mini-example: for the five points (1,2)(1, 2), (2,5)(2, 5), (3,4)(3, 4), (4,7)(4, 7), (5,7)(5, 7):

  • yy on xx: y=1.2x+1.4y = 1.2x + 1.4. \quad xx on yy: x=23y−13x = \frac{2}{3}y - \frac{1}{3}, that is, x=0.667y−0.333x = 0.667y - 0.333.
  • To estimate xx when y=6y = 6: the line of xx on yy gives 23(6)−13=113=3.67\frac{2}{3}(6) - \frac{1}{3} = \frac{11}{3} = 3.67. Rearranging the yy-on-xx line would give 6−1.41.2=3.83\frac{6 - 1.4}{1.2} = 3.83: a different number, and the wrong method.
  • Check: both lines pass through the mean point (3,5)(3, 5): 1.2(3)+1.4=51.2(3) + 1.4 = 5 and 23(5)−13=3\frac{2}{3}(5) - \frac{1}{3} = 3 ✓
  • yy on xx
  • xx on yy

Two different lines through the same points, both through the mean point (3,5)(3, 5): the line of yy on xx makes the vertical gaps smallest, the line of xx on yy the horizontal ones. To estimate xx when y=6y = 6, read the second line: x=3.67x = 3.67.

How far to trust a prediction

A regression prediction is only as good as the data behind it. Four reasons to distrust one:

  • extrapolation
    What it means
    the value you substitute is outside the range of the data
    How to say it
    "x=…x = \ldots is outside the range of the data (… to …), so this is extrapolation: the trend may not continue"
  • weak correlation
    What it means
    ∣r∣\lvert r \rvert is small, so the points are far from the line
    How to say it
    "r=…r = \ldots is close to 00: the line does not fit the data well"
  • the wrong line
    What it means
    xx predicted with the line of yy on xx
    How to say it
    "the line of yy on xx is for predicting yy; to predict xx, use the line of xx on yy"
  • a different population
    What it means
    the data came from a different group, place or time
    How to say it
    "the data only describe …"
  • Interpolation (a value inside the data range) with a strong rr is reliable. That is the usual case in a first prediction.
  • The mark is for the reason, in context. Markschemes give the mark for naming extrapolation with the value that is outside the data (a year beyond the last one recorded); "the estimate is not accurate" names nothing.

Mini-example: for the rent line above (35≤A≤12035 \le A \le 120), an estimate for A=60A = 60 is an interpolation, and reliable if rr is close to 11. An estimate for A=200A = 200 is an extrapolation and unreliable. If rr were 0.210.21, even the estimate for A=60A = 60 would be unreliable.

Line, x from y, or means: which type?

  • paired data in a table, or the line of yy on xx itself
    Asked for
    the line, rr, an estimate of yy, the change in yy for a change in xx, what aa and bb mean, or how far to trust an estimate
    First move
    linear regression of yy on xx on the GDC (or use the given line)
  • paired data, or both regression lines
    Asked for
    an estimate of xx from a value of yy (or any estimate, when both lines are given)
    First move
    the line whose subject is the variable you estimate
  • both lines, or one line and one mean, or a scatter diagram
    Asked for
    xˉ\bar{x} and yˉ\bar{y}, where the lines meet, or the line drawn
    First move
    the mean point lies on every regression line
  • a data table with one value missing, and the regression line
    Asked for
    the missing value
    First move
    yˉ\bar{y} (or xˉ\bar{x}) from the line, then total =n×= n \times mean
  • two exact points, or a gradient and a point, and no data set
    Asked for
    the equation of a line
    First move
    m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1} from two points, then y−y1=m(x−x1)y - y_1 = m(x - x_1)
  • a model given in full, as a formula or in words (a percentage growth, an exponential)
    Asked for
    a value of the model
    First move
    substitute: no regression

Where regression hides in other topics

Regression turns up next to other models, usually as the part that is fitted to data while the other model is given as a formula. The first move is to notice which model came from the data and which was given.

  • A percentage-growth prediction next to recorded data (Arithmetic or geometric in context, SL 1.3)
    It becomes
    a geometric term (the first term times the common ratio to the power n−1n - 1) for the given model and a regression prediction for the data, then a comparison (Regression on the GDC, Example 1.4)
    Watch for
    count the steps the same way in both: nine years after 2019 is u10u_{10} and t=9t = 9
  • A "linear model" for yearly data (Arithmetic sequences, SL 1.2)
    It becomes
    the regression line's values at t=0,1,2,…t = 0, 1, 2, \ldots form an arithmetic sequence with common difference aa
    Watch for
    the line need not pass through the first recorded value, so u1u_1 is the line's value, not the data's
  • A line with a known gradient through a known point (Equation of a straight line)
    It becomes
    a regression line through the mean point: gradient 0.80.8 through (xˉ,yˉ)=(15,20)(\bar{x}, \bar{y}) = (15, 20) gives y=0.8x+8y = 0.8x + 8
    Watch for
    the mean point is the only point certain to be on a regression line
  • A value missing from a data table (Work backwards from the mean or median)
    It becomes
    total =n×= n \times mean, with the mean taken from the regression line (The mean point, Example 3.2)
    Watch for
    the line need not pass through any data point: only the mean point is certain to be on it
  • A given model whose value is used later (Values of f, f∘g and f⁻¹, Exponential and log models)
    It becomes
    the model's value is the input of a regression estimate (Predict x from y, Example 2.2)
    Watch for
    keep the value unrounded; fitting an exponential curve to data is AI, not AA

More in Statistics and probability

Every topic of the course

Guides