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.
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.
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
The positive correlation tells us that when ice cream sales are higher, drowning deaths also tend to increase following a linear trend.
- 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
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:
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 .
For the 4 data pairs , calculate Pearson's and interpret the result.
- 1
Calculate the means of and :
- 2
- 3
Calculate the required sums of products and squared deviations: , ,
- 4
Substitute into the formula for :
- 5
- 6
Interpretation: There is a very strong positive linear correlation between and .
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 .
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.
For the data , find the equation of the least squares regression line of on and interpret the gradient.
- 1
We already know , , ,
- 2
Calculate the gradient :
- 3
- 4
Calculate the intercept using :
- 5
- 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.
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.
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
Substitute into the equation: cm.
- 2
The original data covers ages 2 to 10, so 15 is outside the range. This prediction is extrapolation.
- 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.
