Scatter Plots & Pearson's Correlation Coefficient ($r$)
Pearson's product-moment correlation coefficient $r$ quantifies the strength and direction of a linear relationship between two quantitative variables:
Pearson's Limitation: $r$ only measures linear association. If the data follows a non-linear curve (e.g. exponential or quadratic), $r$ may be close to 0 even though a perfect relationship exists!
Spearman's Rank Correlation Coefficient ($r_s$)
Spearman's rank correlation coefficient $r_s$ assesses how well the relationship between two variables can be described using a monotonic function (consistently increasing or consistently decreasing):
- Convert raw values into ranks (from 1 to $n$).
- If ties occur, assign the mean rank to tied observations (e.g., if two values share 3rd and 4th place, both receive rank $\frac{3+4}{2} = 3.5$).
- Calculate Pearson's $r$ between the two columns of ranks using your GDC (or Spearman's formula if no ties: $r_s = 1 - \frac{6 \sum d^2}{n(n^2 - 1)}$).
Comparing $r$ and $r_s$:
- If $r \approx r_s \approx 1 \implies$ strong positive linear relationship.
- If $r_s \approx 1$ but $r$ is substantially lower $\implies$ non-linear monotonic relationship.
- Spearman's $r_s$ is also less sensitive to extreme outliers than Pearson's $r$.
Line of Best Fit & Linear Regression ($y$ on $x$)
The least-squares regression line of $y$ on $x$ has the equation:
IB exam focus:
- Mean point $(\bar{x}, \bar{y})$: The regression line always passes through the mean point $(\bar{x}, \bar{y})$.
- Directionality of prediction: The line of $y$ on $x$ must ONLY be used to predict $y$ from a known $x$ value. Do not rearrange the equation to predict $x$ from $y$!
- Interpolation vs Extrapolation: Estimating within the range $[x_{\min}, x_{\max}]$ is reliable (interpolation). Predicting outside the range of observed data is unreliable (extrapolation).
Tied ranks and reliable predictions
- Rank both variables in the same direction and preserve paired rows. For ties use average occupied ranks, then calculate Pearson correlation of the rank columns; the no-ties shortcut is not exact with ties.
- Example x=1,2,2,4 and y=10,20,30,40: ranks x=1,2.5,2.5,4, y=1,2,3,4. Centred dot product4.5, sums of squares4.5and5, so $r_s=4.5/\sqrt{22.5}\approx0.948683$.
- Strong correlation is evidence of association, not causation. Compare scatter plot, residuals, context, sample design and outliers. Interpolation is usually safer than extrapolation, not guaranteed accurate.
A study of 8 students records their study hours $x$ and test scores $y$. A GDC yields $r = 0.942$. Interpret the value of $r$ in the context of the study.
Solution:
There is a strong [A1]
positive [A1]
linear correlation between study hours and test scores. [A1]
Given the data values for variable $x$: $14, 22, 19, 22, 35, 19, 41$. Assign ranks from 1 (lowest) to 7 (highest), showing how ties are resolved.
Solution:
Ordered list: $14$ (1st), $19$ (2nd & 3rd), $22$ (4th & 5th), $35$ (6th), $41$ (7th). [M1]
Rank for $14 = 1$.
Tied value $19$ occupies ranks 2 and 3: mean rank $= \frac{2 + 3}{2} = 2.5$. [A1]
Tied value $22$ occupies ranks 4 and 5: mean rank $= \frac{4 + 5}{2} = 4.5$. [A1]
Rank for $35 = 6$; Rank for $41 = 7$. [A1]
For a bivariate dataset, a student finds $r = 0.52$ but Spearman's rank correlation $r_s = 0.98$. Explain what this indicates about the nature of the relationship between the two variables.
Solution:
$r_s \approx 1$ indicates an almost perfect monotonic increasing relationship. [R1]
However, the moderate value of $r = 0.52$ indicates that the relationship is non-linear. [R1]
Conclusion: The variables have a strong non-linear monotonic relationship (such as exponential growth). [A1]
The linear regression equation of $y$ on $x$ is $y = 3.25x + 14.8$. The mean value of $x$ is $\bar{x} = 12.0$.
- Find the mean value of $y$, $\bar{y}$.
- State the geometric property used in your calculation.
Solution:
(a) Substitute $\bar{x} = 12.0$ into the regression equation: $\bar{y} = 3.25(12.0) + 14.8$ [M1]
$\bar{y} = 39.0 + 14.8 = 53.8$ [A1]
(b) The regression line of $y$ on $x$ must pass through the mean point $(\bar{x}, \bar{y})$. [R2]
The heights $x$ (in cm, with $150 \le x \le 195$) and weights $y$ (in kg) of 20 athletes yield the regression line $y = 0.82x - 55.4$.
- Predict the weight of an athlete whose height is 172 cm.
- Explain whether using the model to predict the weight of a person with height 225 cm is reliable.
Solution:
(a) $y = 0.82(172) - 55.4 = 141.04 - 55.4 = 85.64 \approx 85.6\text{ kg}$ [M1][A1]
(b) Unreliable, because $225\text{ cm}$ lies far outside the range of observed data ($150 \le x \le 195$). [R1]
This is an extrapolation and the linear trend may not hold. [A1]
Explain why the regression line of $y$ on $x$ cannot be rearranged algebraically to predict $x$ when given $y$.
Solution:
The regression line of $y$ on $x$ minimizes the sum of vertical squared errors ($\sum (y - \hat{y})^2$), treating $x$ as the independent variable. [R2]
To predict $x$ from $y$, one must minimize horizontal errors using the separate regression line of $x$ on $y$. [A1]
Two judges rank 5 competitors with rankings: Judge A: [1, 2, 3, 4, 5]; Judge B: [5, 4, 3, 2, 1]. Without calculation, state the value of Spearman's rank correlation $r_s$ and justify your answer.
Solution:
$r_s = -1$ [A1]
The ranks are in exact reverse order (perfect inverse monotonic agreement). As Judge A's rank increases, Judge B's rank decreases strictly monotonically. [R2]
In a regression model $y = -1.45x + 82.0$, what is the physical meaning of the gradient $-1.45$ in context, if $x$ represents ambient temperature in $^\circ\text{C}$ and $y$ represents daily energy consumption in kWh?
Solution:
The gradient represents the rate of change of daily energy consumption with respect to ambient temperature. [M1]
For each $1^\circ\text{C}$ increase in temperature, daily energy consumption decreases on average by $1.45\text{ kWh}$. [A2][R1]
Explain the difference between causation and correlation using an illustrative bivariate example.
Solution:
Correlation indicates a statistical association between two variables, while causation means changes in one variable directly cause changes in the other. [R1]
For example, ice cream sales and swimming pool drownings are strongly positively correlated, but neither causes the other; both are driven by a confounding variable (hot summer weather). [A2]
Given the summary statistics: $\bar{x} = 25$, $\bar{y} = 110$, gradient $m = 2.4$.
- Find the $y$-intercept $c$ of the regression line $y = mx + c$.
- Write down the complete equation of the regression line.
Solution:
(a) Since $(\bar{x}, \bar{y})$ satisfies $y = mx + c$: $110 = 2.4(25) + c$ [M1]
$110 = 60 + c \implies c = 50$ [A1]
(b) Regression line: $y = 2.4x + 50$ [A2]
Calculate Spearman correlation for the tied dataset above and compare the no-ties shortcut.
Pearson on ranks gives0.948683. Σd²=0.5makes the shortcut0.95; it differs because xhas ties. Enter rank lists in the calculator, not raw values.
A nearly perfect decreasing nonlinear relationship is observed. Describe Pearson versus Spearman and one causal caution.
Spearman can be near−1because the ranking is consistently reversed; Pearson may have smaller magnitude because the pattern curves. A confounder or selection bias could explain association.
Core Formulas (Topic 4.4 & 4.5)
| Pearson's Correlation Coefficient | $$-1 \le r \le 1$$ (Computed via GDC 2-Var Stats) |
| Spearman's Rank Correlation | $$r_s = 1 - \frac{6 \sum d^2}{n(n^2 - 1)}$$ (Without ties) |
| Mean Point | $$(\bar{x}, \bar{y}) = \left(\frac{\sum x}{n}, \frac{\sum y}{n}\right)$$ |
| Regression Line of $y$ on $x$ | $$y = mx + c \quad \text{where } \bar{y} = m\bar{x} + c$$ |
Top 5 IB Exam Traps to Avoid
- Trap 1: Rearranging $y$ on $x$ to predict $x$: Never do this! IB penalizes this with zero marks. The line of $y$ on $x$ only predicts $y$.
- Trap 2: Extrapolating beyond range: Predictions outside $[x_{\min}, x_{\max}]$ are unreliable regardless of how high $r$ is.
- Trap 3: Forgetting to rank both variables: When calculating $r_s$, both $x$ and $y$ must be ranked independently.
- Trap 4: Incorrect tie handling: If values tie for ranks 4 and 5, assign $4.5$ to each, and the next rank is 6 (never 5!).
- Trap 5: Confusing $r = 0$ with no relationship: $r = 0$ means no linear relationship; a curved relationship might still exist.
5-Question Concept Check
Score: - / 51. Which point is ALWAYS guaranteed to lie on the linear regression line of $y$ on $x$?
2. If two observations tie for the 5th and 6th positions in an ordered dataset, what rank should each receive?
3. A dataset has $r = 0.40$ and $r_s = 0.99$. What best describes the relationship?
4. What is the process of predicting a value outside the range of observed domain data called?
5. Which value of $r$ indicates the strongest linear relationship?