Study Guide

Bivariate data: correlation and regression

IB Mathematics AA HLΒ· 45 min read

1. Correlation and scatter diagramsβ˜…β˜…β˜†β˜†β˜†β± 15 min

When we collect two measurements for the same individual or case, we plot the pairs of values on a scatter diagram to visually inspect the relationship between the variables.

πŸ“˜ Definition

Bivariate data

A dataset consisting of pairs of observations of two different variables collected on the same sampling unit.

Example:

Height and weight measured for 50 high school students

Positive correlation means that as one variable increases, the other tends to increase. Negative correlation means as one variable increases, the other tends to decrease. No correlation means there is no observable linear trend.

πŸ“ Worked Example

A researcher finds a strong positive correlation between number of ice cream sales and number of drowning deaths per month. Explain why this does not mean ice cream sales cause drownings.

  1. 1

    The positive correlation tells us that when ice cream sales are higher, drowning deaths also tend to increase following a linear trend.

  2. 2

    This correlation is explained by the confounding variable of temperature. Higher temperatures lead to more people buying ice cream and more people swimming, which leads to more drownings.

  3. 3

    There is no direct causal link between ice cream sales and drownings, the correlation is spurious.

2. Pearson's product-moment correlation coefficientβ˜…β˜…β˜…β˜†β˜†β± 20 min

Pearson's is a numerical measure of the strength and direction of the linear relationship between two quantitative variables. It is calculated with the formula:

r=βˆ‘(xβˆ’xΛ‰)(yβˆ’yΛ‰)βˆ‘(xβˆ’xΛ‰)2βˆ‘(yβˆ’yΛ‰)2r = \frac{\sum (x-\bar{x})(y-\bar{y})}{\sqrt{\sum (x-\bar{x})^2 \sum (y-\bar{y})^2}}

The value of always lies between and . Values close to mean strong positive linear correlation, values close to mean strong negative linear correlation, and values close to mean weak or no linear correlation. Critically, only measures linear relationships: a strong non-linear relationship can have close to .

πŸ“ Worked Example

For the 4 data pairs , calculate Pearson's and interpret the result.

  1. 1

    Calculate the means of and :

  2. 2
    xˉ=1+2+3+44=2.5,yˉ=2+3+5+64=4\bar{x} = \frac{1+2+3+4}{4} = 2.5, \quad \bar{y} = \frac{2+3+5+6}{4} = 4
  3. 3

    Calculate the required sums of products and squared deviations: , ,

  4. 4

    Substitute into the formula for :

  5. 5
    r=75Γ—10=750β‰ˆ0.99r = \frac{7}{\sqrt{5 \times 10}} = \frac{7}{\sqrt{50}} \approx 0.99
  6. 6

    Interpretation: There is a very strong positive linear correlation between and .

βœ“ Quick check
  1. Pearson's means there is no relationship between the two variables. True or false?

    • True

    • False

    Reveal answer
    False β€”

    only means there is no linear relationship. A strong non-linear relationship (e.g. ) can still exist even if .

3. Least squares regression lineβ˜…β˜…β˜…β˜†β˜†β± 20 min

When we have an explanatory variable and a response variable , we can fit a straight line to model the relationship, which we use to predict values of for given values of .

πŸ“˜ Definition

Least squares regression line of $y$ on $x$

The line that minimizes the sum of the squared vertical deviations between observed values and predicted values. This is the standard line of best fit for predicting from .

The gradient is the predicted change in for a 1-unit increase in . The intercept is the predicted value of when . Always interpret these values in context of the problem in the exam.

πŸ“ Worked Example

For the data , find the equation of the least squares regression line of on and interpret the gradient.

  1. 1

    We already know , , ,

  2. 2

    Calculate the gradient :

  3. 3
    b=βˆ‘(xβˆ’xΛ‰)(yβˆ’yΛ‰)βˆ‘(xβˆ’xΛ‰)2=75=1.4b = \frac{\sum (x-\bar{x})(y-\bar{y})}{\sum (x-\bar{x})^2} = \frac{7}{5} = 1.4
  4. 4

    Calculate the intercept using :

  5. 5
    a=4βˆ’(1.4Γ—2.5)=0.5a = 4 - (1.4 \times 2.5) = 0.5
  6. 6

    Equation: . For every 1-unit increase in , the predicted value of increases by 1.4 units on average.

4. Interpolation and extrapolationβ˜…β˜…β˜†β˜†β˜†β± 10 min

When using a regression line for prediction, the range of the original data is critical for assessing the reliability of the result.

πŸ“˜ Definition

Interpolation vs extrapolation

Interpolation predicts a value within the range of the original data and is generally reliable. Extrapolation predicts a value outside the range of the original data and is unreliable, because we cannot assume the linear trend continues outside observed values.

πŸ“ Worked Example

A regression line for child height (y, cm) against age (x, years) for children aged 2 to 10 is . Predict the height of a 15-year-old and comment on reliability.

  1. 1

    Substitute into the equation: cm.

  2. 2

    The original data covers ages 2 to 10, so 15 is outside the range. This prediction is extrapolation.

  3. 3

    The prediction is unreliable: growth rate slows after age 10, so the linear trend observed for younger children does not extend to teenagers.

5. Common Pitfalls

Wrong move:

Claiming a strong correlation proves causation

Why:

Correlation only measures association, not causal relationship, which requires experimental evidence

Correct move:

Never state causation unless the question explicitly justifies it, only describe the association

Wrong move:

Saying means no relationship between variables

Why:

Pearson's only measures linear correlation, strong non-linear relationships can still exist

Correct move:

Always specify that means no linear relationship between the variables

Wrong move:

Swapping and and using a on line to predict

Why:

The least squares line minimizes error in the response variable, swapping variables gives a different line

Correct move:

Always confirm which variable you need to predict before fitting the regression line

Wrong move:

Treating extrapolated predictions as equally reliable as interpolated ones

Why:

The linear trend may not hold outside the range of observed data

Correct move:

Always identify extrapolation and state that the prediction is unreliable

Wrong move:

Ignoring outliers when calculating correlation and regression

Why:

Outliers can drastically change the value of and the slope of the regression line

Correct move:

Identify outliers on a scatter diagram and assess their impact on your results

6. Quick Reference Cheatsheet

Concept

Key Purpose

Key Notes

Pearson's

Measure strength/direction of linear correlation

, = strong +ve, = strong -ve, = no linear correlation

Least squares on

Predict from known

Minimizes sum of squared vertical deviations from the line

Correlation

Describe association between two variables

Correlation β‰  causation

Interpolation

Predict inside original range

Generally reliable

Extrapolation

Predict outside original range

Generally unreliable

When this came up on past exams

AI-estimated based on syllabus patterns β€” cross-check with official past papers for accuracy. Use only as revision-focus signals.

  • 2021 Β· 1

    Interpret correlation, find regression line

  • 2022 Β· 2

    Extended problem on prediction and extrapolation

  • 2023 Β· 1

    Calculate Pearson r, comment on causation

Going deeper

What's Next

Correlation and regression are core statistical skills that are regularly tested in IB AA HL, often appearing in extended multi-part questions that combine with other topics like descriptive statistics, hypothesis testing, and chi-squared tests. This sub-topic is the foundation for more advanced statistical modeling, including significance testing for regression coefficients, residual analysis to check model fit, and non-linear regression. Mastering the key concepts here will help you avoid common exam traps and earn full marks on both short and long response questions. Next, you can explore related statistical topics to build on your understanding.