Study Guide

Correlation and linear regression

IB Mathematics AI SLΒ· 6 min read

1. Correlation and Pearson's $r$β˜…β˜…β˜†β˜†β˜†β± 15 min

βœ“ Calculator OK

πŸ“˜ Definition

Bivariate Data

Data that collects two different quantitative variables from each observation. We analyse bivariate data to identify relationships between the two variables.

Example:

Recording height and mass for 50 adult participants

A scatter diagram plots each pair of data points on a set of axes, allowing us to see if there is an upward (positive) or downward (negative) linear trend. Pearson's product-moment correlation coefficient quantifies this trend.

πŸ“˜ Definition

Pearson's Product-Moment Correlation Coefficient

A standardised measure of the strength and direction of the linear relationship between two variables, with a fixed range of .

  • : perfect positive linear correlation

  • : perfect negative linear correlation

  • : no linear correlation

πŸ“ Worked Example

A study finds between the number of fire fighters sent to a fire and the amount of damage the fire causes. Interpret and explain why more fire fighters do not cause more damage.

  1. 1

    First, interpret the value of :

  2. 2
    r=0.92r = 0.92
  3. 3

    is positive and very close to 1, so there is a very strong positive linear relationship between the number of fire fighters sent and the amount of fire damage.

  4. 4

    The correlation does not mean fire fighters cause more damage. A lurking variable, the size of the fire, causes both: larger fires require more fire fighters and cause more damage.

Exam tip:

Always interpret in the context of the given variables, not just state the number. 1 mark is usually allocated for context in exams.

2. Least Squares Regression Lineβ˜…β˜…β˜…β˜†β˜†β± 20 min

βœ“ Calculator OK

If there is a linear relationship between two variables, we can model the relationship with a straight line called the least squares regression line, which we use to predict values of one variable from the other.

πŸ“˜ Definition

Least Squares Regression Line ($y$ on $x$)

y^=a+bx\hat{y} = a + bx

The straight line that minimises the sum of the squares of the vertical distances (residuals) between the observed -values and the line. is the response (predicted) variable, and is the explanatory (independent) variable.

πŸ“ Worked Example

The table below shows the daily temperature (, ) and the number of ice creams sold at a beach shop () for 7 days. Find the equation of the regression line of on , to 3 significant figures.

  1. 1
    1. Enter the and data into your GDC's statistics mode.
  2. 2
    1. Run a linear regression to calculate the intercept and gradient .
  3. 3
    1. Round the coefficients to 3 significant figures: and .
  4. 4
    1. Write the equation in context:
  5. 5
    y^=βˆ’111+12.2x\hat{y} = -111 + 12.2x
  6. 6

    Where is the predicted number of ice creams sold and is daily temperature in .

Exam tip:

IB expects regression coefficients rounded to 3 significant figures, unless stated otherwise. Avoid rounding too early in your working.

3. Prediction: Interpolation vs Extrapolationβ˜…β˜…β˜†β˜†β˜†β± 15 min

βœ“ Calculator OK

We use regression lines to predict unknown values of for a given . The reliability of the prediction depends on whether the -value falls inside or outside the range of the original data used to create the line.

πŸ“˜ Definition

Interpolation

Predicting a value of for an -value that lies within the range of the original data. Interpolation is generally reliable, as we know the linear relationship holds in this range.

πŸ“˜ Definition

Extrapolation

Predicting a value of for an -value that lies outside the range of the original data. Extrapolation is unreliable, because we have no evidence the linear relationship continues outside the observed range.

πŸ“ Worked Example

Use the ice cream regression line from the previous example, where original values range from to . State whether each prediction is interpolation or extrapolation, and comment on reliability: (a) Predict ice cream sales at , (b) Predict ice cream sales at .

  1. 1

    (a) lies between 18 and 30, so this prediction is interpolation. The prediction is expected to be reliable.

  2. 2

    (b) is less than the minimum original -value of , so this is extrapolation. The prediction is unreliable, because we do not know if the linear relationship holds at this lower temperature. For example, the shop may sell zero ice creams at , but the line would predict a positive value.

Exam tip:

Always reference the original data range when justifying your comment on reliability.

4. Common Pitfalls

Wrong move:

Claiming that a strong correlation proves one variable causes the other.

Why:

Examiners specifically test understanding of the difference between correlation and causation, and will deduct marks for incorrect causal claims.

Correct move:

State that correlation only indicates association, not causation, unless the relationship is confirmed by a controlled experiment.

Wrong move:

Swapping and when calculating the regression line, using the wrong variable as the response.

Why:

The on regression line changes depending on which variable you predict, so swapping gives an incorrect equation.

Correct move:

Always confirm which variable you need to predict, set it as before running regression on your GDC.

Wrong move:

Claiming means there is no relationship at all between the two variables.

Why:

only measures linear relationships, so does not rule out a strong non-linear relationship.

Correct move:

State that means there is no linear relationship between the variables.

Wrong move:

Forgetting to comment on the reliability of a prediction after calculating it.

Why:

Most exam questions allocate 1 mark explicitly for this comment, which is easy to miss.

Correct move:

Always compare the prediction -value to the original data range, state if it is interpolation (reliable) or extrapolation (unreliable).

5. Quick Reference Cheatsheet

Concept

Key Meaning

Exam Note

Perfect positive linear correlation

All points on upward straight line

Perfect negative linear correlation

All points on downward straight line

Strong linear correlation

Moderate linear correlation

Weak linear correlation

= no linear correlation

Regression line

= variable to predict

Interpolation

inside original range

Prediction is reliable

Extrapolation

outside original range

Prediction is unreliable

Correlation Causation

Association does not prove causation

Always watch for this question

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.

  • 2023 Β· 1

    Interpret correlation, find regression line

  • 2022 Β· 2

    Predict value, comment on reliability

  • 2021 Β· 1

    Correlation vs causation question

What's Next

Correlation and linear regression is a foundational concept for all further statistical analysis of relationships between variables in IB AI SL. It forms the basis for understanding residual analysis, goodness of fit, and non-linear transformation of data to fit linear models. Mastering the key distinctions between correlation and causation, and interpolation and extrapolation, will help you avoid common mistakes in exam questions and build a strong base for more advanced statistical topics.