Bivariate Statistics (AA HL)

Bivariate statistics looks at the relationship between two variables measured on the same subjects - how closely they move together, and how to model that relationship with a straight line. This topic covers scatter diagrams, Pearson's correlation coefficient rr, the regression line of yy on xx, and how to interpret rr and r2r^2 without falling into the trap of confusing correlation with causation.

What the syllabus says

This topic maps onto two points in the official IB Analysis & Approaches syllabus.

CodeSyllabus content
SL4.4Linear correlation of bivariate data; Pearson's product-moment correlation coefficient rr, found using technology. Scatter diagrams; lines of best fit by eye, through the mean point. Distinction between correlation and causation. Equation of the regression line of yy on xx, and use for prediction, including the dangers of extrapolation. Interpreting the parameters aa and bb in y=ax+by=ax+b.
SL4.10Equation of the regression line of xx on yy, and its use for prediction. Awareness that a prediction of yy from xx cannot always reliably be made using an xx on yy line.

Official IB source: Mathematics: analysis and approaches subject brief (PDF, ibo.org).

These are core AA SL syllabus points that are also examinable at AA HL.

Key terms

Five words worth knowing cold before you touch the formulas below - each with a worked example showing exactly what it means.

What is bivariate data?

Bivariate data is a set of paired measurements taken on the same subjects, such as each person's height and weight. It's studied using a scatter diagram, which plots each pair as a point to reveal whether a pattern or relationship exists.

e.g. Recording each day's temperature xx alongside that day's ice-cream sales yy produces a set of paired (x,y)(x,y) points.

What is Pearson's correlation coefficient, r?

rr measures the strength and direction of a linear relationship between two variables, always between −1-1 and 11. Values near ±1\pm1 mean a strong linear relationship; values near 00 mean little to no linear relationship. It's only meaningful when the underlying relationship is roughly linear.

e.g. r=−0.92r=-0.92 between hours of screen time and hours of sleep indicates a strong negative linear relationship.

What is the regression line of y on x?

The regression line of yy on xx, y=ax+by=ax+b, is the line of best fit that minimises vertical distances from the data points, always passing through the mean point (x¯,y¯)(\bar x,\bar y). It's used to predict yy from a given xx.

e.g. If y=2.5x+8y=2.5x+8, then at x=4x=4: y=2.5(4)+8=10+8=18y=2.5(4)+8=10+8=18.

What is r² (coefficient of determination)?

r2r^2 is the square of the correlation coefficient, giving the proportion of the variation in yy that's explained by the linear relationship with xx. It's usually expressed as a percentage, and it's always between 0 and 1.

e.g. r=0.7⇒r2=0.49r=0.7 \Rightarrow r^2 = 0.49, so 49% of the variation in yy is explained by the linear relationship.

What's the difference between interpolation and extrapolation?

Interpolation is predicting a value within the range of the collected data, which is generally reliable. Extrapolation is predicting outside that range, which is risky because there's no evidence the linear pattern continues beyond where data was actually gathered.

e.g. For data with xx between 55 and 2020, predicting at x=12x=12 is interpolation; predicting at x=50x=50 is extrapolation.

Key formulas

A handful of formulas cover this whole topic - the tables below summarise them, and the sections underneath explain each in more depth.

Formula reference

The correlation and regression formulas are on the official formula booklet; r2r^2 itself is simply the square of rr and isn't listed as a separate formula.

FormulaUsed forBooklet?
Sxy=∑xyn−x¯y¯S_{xy}=\dfrac{\sum xy}{n}-\bar x\bar yCovariance-style sum used in rr and bbYes
Sxx=∑x2n−x¯2S_{xx}=\dfrac{\sum x^2}{n}-\bar x^2Spread of xx, used in rr and bbYes
r=SxySxxSyyr=\dfrac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}Pearson's correlation coefficientYes
y=ax+b, a=SxySxx, b=y¯−ax¯y=ax+b,\ a=\dfrac{S_{xy}}{S_{xx}},\ b=\bar y-a\bar xRegression line of yy on xxYes
r2r^2Coefficient of determinationNot in booklet - simply rr squared

Regression line of y on x vs x on y

There are two different regression lines for the same data, and using the wrong one gives an unreliable prediction.

Featurey on x linex on y line
MinimisesVertical distances from the pointsHorizontal distances from the points
Gradienta=SxySxxa=\dfrac{S_{xy}}{S_{xx}}Uses SxyS_{xy} and SyyS_{yy} instead of SxxS_{xx}
Use it to predictyy, given a value of xxxx, given a value of yy
Passes throughBoth lines pass through the mean point (x¯,y¯)(\bar x,\bar y) - and coincide only when r=±1r=\pm1.

Correlation

Correlation describes how closely two variables move together in a straight-line pattern - nothing more.

Pearson's r

r=SxySxxSyyr=\dfrac{S_{xy}}{\sqrt{S_{xx}S_{yy}}}

Ranges from −1-1 (perfect negative) to 11 (perfect positive); only meaningful for linear relationships.

In the formula booklet

Interpreting r

The sign gives the direction (positive/negative); the size gives the strength - close to ±1\pm1 is strong, close to 00 is weak or absent.

Correlation vs causation

A strong rr never proves one variable causes the other - a third factor could be driving both, or the link could be coincidental.

The regression line

The regression line summarises the linear trend and lets you predict one variable from the other, within limits.

Equation & parameters

y=ax+by=ax+b

aa is the gradient - the change in yy per unit increase in xx. bb is the yy-intercept - the predicted yy when x=0x=0.

In the formula booklet

Interpolation vs extrapolation

Predicting within the data range (interpolation) is generally safe; predicting outside it (extrapolation) is unreliable, since the pattern might not continue.

Worked examples

Two full exam-style questions, marked exactly like the real thing. Try each one yourself before checking the worked solution.

1
Easy
No calc
[4 marks]

A regression of yield yy on rainfall xx gives r=−0.6.r=-0.6.

(a) Find r2.r^2.

(b) Interpret r2r^2 in context.

(c) State the percentage of variation NOT explained by the linear relationship.

Worked solution

(a) r2=(−0.6)2r^2=(-0.6)^2 M1
=0.36.=0.36. A1

(b) About 36%36\% of the variation in yield is explained by the linear relationship with rainfall. A1

(c) 100%−36%=64%.100\%-36\%=64\%. A1

M1 Attempting to square the given value of rr A1 Correct value r2=0.36r^2=0.36 A1 Correctly interpreting r2r^2 as the percentage of variation explained A1 Correct complementary percentage 64%64\% not explained
2
Hard
No calc
[4 marks]

Data (x,y)(x,y) have r=−0.8.r=-0.8. New variables are u=3xu=3x and v=−2y.v=-2y.

(a) State the value of the correlation coefficient between uu and v.v.

(b) Explain the effect of the negative scale factor.

(c) State the correlation coefficient if instead u=−3xu=-3x (both variables now negatively scaled).

Worked solution

(a) Scaling by a positive factor leaves rr unchanged; multiplying yy by a negative factor reverses the sign. M1
So ruv=+0.8.r_{uv}=+0.8. A1

(b) v=−2yv=-2y reflects the relationship, turning a negative correlation into a positive one of the same strength. R1

(c) Two sign reversals cancel, so ruv=−0.8r_{uv}=-0.8 (the original sign is restored). A1

M1 Identifying that scaling by a positive factor preserves rr while a negative factor reverses its sign A1 Correct value ruv=+0.8r_{uv}=+0.8 R1 Reasoning that the negative scale factor reflects the relationship, reversing the sign of the correlation A1 Correctly concluding the two sign reversals cancel, restoring ruv=−0.8r_{uv}=-0.8

Common mistakes

The four slip-ups that account for most of the marks lost on this topic - worth reading before you start practising, not just after you get one wrong.

  • Treating correlation as causation. A strong rr shows two variables move together, not that one causes the other - a third factor, or coincidence, could explain the pattern.
  • Extrapolating beyond the data range. Using the regression line to predict far outside the xx-values that were actually collected is unreliable, since there's no evidence the linear trend continues.
  • Using the y on x line to predict x from y. The two regression lines are generally different - predicting xx from a given yy needs the xx on yy line, not a rearrangement of the yy on xx line.
  • Reporting r when the question asks for r². rr measures strength and direction; r2r^2 is the percentage of variation explained. Mixing these up is a common way to lose an accuracy mark.

Using your GDC

Every step below is a real button sequence, not a vague "use your calculator" hint - covering the TI-84 Plus, TI-Nspire, and Casio fx-9860/fx-CG50. Pick your model to filter down to just the steps that apply to you.

Show steps for:
Linear regression (line of best fit) and r

Gives the regression line and the correlation coefficient in one step - the core skill for this whole topic.

  1. Enter x-values in one list and y-values in another.
  2. Turn on DiagnosticOn once (2nd → CATALOG) so rr appears; then STAT → CALC → 4:LinReg(ax+b), set Xlist and Ylist, Calculate.TI-84
  3. Calculator page → menu → Statistics → Stat Calculations → Linear Regression (mx+b).Nspire
  4. Statistics menu → CALC (F2) → REG (F3) → X (linear); rr shows automatically.Casio
  5. Read aa (gradient), bb (intercept), rr (correlation) and r2r^2 (coefficient of determination).
  6. Use the equation to predict - but only within the data range (interpolation).

Tip: rr near ±1\pm1 means a strong linear fit; near 00 means weak. r2r^2 is the proportion of variation explained.

Build and manipulate lists

Lists let you store paired data sets without re-entering values - essential for setting up xx and yy columns before running a regression.

  1. Enter data manually: go to the list editor and type xx-values and yy-values into two separate lists.
  2. 2nd → STAT (LIST) → OPS lets you sort or clear a list. Use L1 for xx, L2 for yy, and reference both together in LinReg.TI-84
  3. In a Lists & Spreadsheet page, use two named columns for xx and yy so both are available together for regression.Nspire
  4. In Statistics list editor, enter xx-values in List 1 and yy-values in List 2 before running REG.Casio
  5. Keep the xx and yy lists the same length and in matching pairs - a mismatched row shifts every pair after it.

Tip: Double-check the lists are paired correctly before running a regression - a single mistyped value can shift rr noticeably.

See the full GDC guide for more calculator models and topics.

Quick questions

The questions students on this topic ask most often.

Does a strong correlation mean one variable causes the other?

No. Correlation only measures how closely two variables move together in a straight-line pattern - it says nothing about cause and effect. A third, unmeasured variable could be driving both, or the relationship could be coincidental.

Can I use the regression line to predict outside the data range?

Predicting within the range of the collected data (interpolation) is generally reliable. Predicting outside that range (extrapolation) is risky, because there's no evidence the same linear pattern continues beyond where you actually have data.

What's the difference between the regression line of y on x and of x on y?

The yy on xx line minimises vertical distances and should be used to predict yy from a given xx. The xx on yy line minimises horizontal distances and should be used to predict xx from a given yy. The two lines are different (unless r=±1r=\pm1) and shouldn't be used in the wrong direction.

Do I need to calculate r by hand?

No. Technology should be used to calculate rr and the regression line equation, although a hand calculation can help you understand what the value represents. Critical values of rr, where needed, are given to you in the exam.

Ready to practise properly?

Bivariate statistics questions, marked instantly like the real exam.