IB Maths AI HL Correlation & Regression Paper 1 & 2 ~8 min read

Linear Regression

Once you’ve confirmed strong linear correlation, you can do better than a line of best fit drawn by eye — you can find the exact best line. The least-squares regression line of y on x is the line that minimises the total squared vertical distance to all the data points, written y = ax + b. Your GDC produces a and b in seconds. The two skills the IB tests: interpret the gradient a in context, and use the line to predict — while knowing that predicting inside the data (interpolation) is reliable but predicting outside it (extrapolation) is not.

📘 What you need to know

The least-squares regression line

“Least squares” means the line is positioned so that the total of the squared vertical distances from the points to the line is as small as possible. That’s why it beats a line drawn by eye — it’s mathematically optimal.

what “least squares” minimises
x (independent) y (dependent) y = ax + b dashed = vertical gap (residual) from each point to the line
The regression line is placed so the sum of the squares of these vertical gaps is the smallest possible — no other straight line fits the points better in this sense.
Regression line of y on x y = ax + b a = gradient, b = y-intercept; find both on the GDC ✓

🧭 Recipe — finding the regression line on a GDC

  1. Enter the bivariate data into two lists (x and y).
  2. Choose the linear regression model “ax + b in statistics mode.
  3. Read off a (gradient) and b (intercept) from the output.
  4. Write the equation y = ax + b (round to 3 sf unless told otherwise).
  5. Store the full values of a and b on the GDC for any predictions, to avoid rounding errors.

Interpreting a and b

The gradient and intercept aren’t just numbers — each has a meaning in the context of the question, and the IB regularly asks you to state it.

a — the gradient
rate of change
y changes by a for every 1-unit increase in x. “Score rises by 5.57% per extra hour of practice.”
b — the intercept
value at x = 0
The predicted y when x = 0. Sometimes meaningful, sometimes not realistic in context.

🧠 Memory aid — “a per one”

To interpret the gradient, say “y changes by a for every one extra x“, filling in the real units. If a = 5.57 and x is hours of practice and y is test score, that’s “the score increases by 5.57% for each extra hour of practice”. Always attach the context — a bare number won’t earn the interpretation mark.

Predictions: interpolation vs extrapolation

You can substitute an x-value into the equation to predict y. How much you trust that prediction depends on where the x-value sits relative to your data.

inside the data is safe, outside is risky
x DATA RANGE extrapolation unreliable interpolation reliable extrapolation unreliable
Inside the data range = interpolation (reliable). Beyond either end = extrapolation (unreliable) — the linear pattern may not continue out there.
Interpolation
inside ✓
Predicting for an x within the data range. Usually reliable — more so with strong correlation and a big sample.
Extrapolation
outside ✗
Predicting for an x beyond the data range. Much less reliable — the trend may not hold outside the data.

🤔 Why is extrapolation unreliable?

The regression line is only evidence for the pattern within the range of x-values you actually collected. Outside that range you have no data, so you’re assuming the straight-line trend keeps going — but it might bend, flatten, or hit a natural limit (a test score can’t exceed 100%, for instance). The further beyond the data you go, the shakier the assumption. So when you extrapolate, always flag the prediction as unreliable and say why (the x-value is outside the data range).

Only predict y from x. The y-on-x line is built to minimise vertical errors, so using it backwards (to predict x from y) is not always reliable.

Worked examples

WE 1

Find the regression equation

For 7 students, the time spent practising per week (x hours) and test score (y %) are recorded. Write down the regression line of y on x in the form y = ax + b.

time x2567101112
score y11495575636882
enter data into GDC, choose “ax + b” a = 5.5680… b = 15.4136… y = 5.57x + 15.4 (3 sf) a is the coefficient of x; b is the constant term.
WE 2

Interpret the gradient

Give an interpretation of the value of a = 5.57 from WE 1.

“y changes by a for every one extra x” a = 5.57, x = hours, y = score (%) the model predicts the score increases by 5.57% for each extra hour of practice always interpret the gradient in context with units.
WE 3

Make a prediction (interpolation)

Using y = 5.5680x + 15.4136, estimate the score of a student who practises 8 hours a week.

substitute x = 8 (within data range 2–12) y = 5.5680(8) + 15.4136 = 44.544 + 15.4136 = 59.96… score ≈ 60% x = 8 is inside the data → interpolation → reliable.
WE 4

Predict & judge validity (extrapolation)

Another student practises 15 hours a week. Estimate their score and comment on the validity of the prediction.

substitute x = 15 y = 5.5680(15) + 15.4136 = 83.52 + 15.4136 = 98.93… judge validity x = 15 is OUTSIDE the data range (2–12), so this is extrapolation. ≈ 98.9%, but unreliable (extrapolation) name it: “x = 15 is outside the data range, so extrapolation is being used.”
WE 5

Correlation type from the equation

A regression line is found to be y = −2.4x + 80. Without a scatter diagram, state the type of correlation and interpret the gradient.

sign of a a = −2.4 is negative → negative correlation interpret gradient y decreases by 2.4 for every 1-unit increase in x. negative correlation; y falls by 2.4 per unit x a positive a means positive correlation; a negative a means negative.

💡 Top tips

⚠ Common mistakes

That completes the Correlation & Regression unit! You can now draw scatter diagrams, measure correlation with Pearson’s r and Spearman’s rs, choose between them, and fit and use a regression line. These skills feed directly into modelling, where you’ll fit non-linear functions, and into the IA, where bivariate analysis is a popular approach.

Need help with Correlation & Regression?

Get 1-on-1 help from an IB examiner who knows exactly what Paper 1 & 2 are looking for.

Book Free Session →