Historical Context & Motivation
Humans have always tried to spot patterns in data — farmers tracked rainfall and crop yields, astronomers logged star positions over centuries. But for most of history, these observations remained informal. The question "How strong is the link between two measurements?" had no precise mathematical answer. It wasn't until the 19th century that statisticians developed the tools we now call correlation and regression, giving us a way to quantify relationships and make predictions from data.
The central question this topic addresses is: when you collect two measurements for each individual (for example, hours studied and exam score), how can you describe the relationship mathematically, measure how strong it is, and use it to make predictions? That is the purpose of correlation and linear regression.
Core Principles & Definitions
Before diving into calculations, you need to understand several foundational ideas. In any bivariate data set you have pairs of values — one for the independent variable (x) and one for the dependent variable (y). We want to know whether these variables move together and, if so, how closely.
Bivariate Data
Scatter Diagram
Correlation
Linear Regression
Interpolation vs. Extrapolation
Scatter Diagrams & Correlation Patterns
The most important first step in any correlation/regression problem is to draw (or inspect) a scatter diagram. The visual shape of the point cloud tells you immediately whether a linear model is appropriate, what direction the relationship goes, and roughly how strong it is. The diagram below shows three classic patterns side by side.
Notice how the tightness of the point cloud around the dashed line varies. In the strong positive case (left), points hug the line closely, meaning the value of r is near 1. In the strong negative case (centre), the points also hug the line closely, but it slopes downward, giving r near −1. In the no-correlation case (right), the points form a shapeless cloud, so r is near 0 and the line is essentially flat and useless for prediction.
Mathematical Framework
The IB syllabus requires you to know and use several formulas. Your GDC (graphing calculator) will do the heavy computation, but understanding what each formula means is essential for interpreting results and answering exam questions.
Pearson's Correlation Coefficient (r)
The value of r always satisfies −1 ≤ r ≤ 1. When r = 1, all points lie perfectly on a line with positive slope; when r = −1, they lie on a line with negative slope. In practice, you will enter your data lists into your GDC and read off r directly.
Equation of the Regression Line (y on x)
Interpreting the Correlation Coefficient
Knowing the value of r is only useful if you can interpret it in context. The IB expects you to describe correlation using specific language: strong, moderate, or weak combined with positive or negative. The table below gives commonly accepted thresholds, though in the IB exam, the boundary values may be slightly flexible.
The diagram above illustrates a key fact: the regression line of y on x always passes through (x̄, ȳ), the point formed by the means of both variables. The residuals (the vertical red dashes) show the errors — the differences between the actual y-values and the predicted ŷ-values. The least squares method finds the line that makes the sum of the squares of these residuals as small as possible.
Worked Example
A teacher records the number of hours 8 students spent on revision (x) and their percentage marks on a test (y). The data is shown below.
| Student | Hours (x) | Mark (y) |
|---|---|---|
| A | 2 | 40 |
| B | 3 | 50 |
| C | 5 | 55 |
| D | 4 | 52 |
| E | 6 | 65 |
| F | 7 | 68 |
| G | 8 | 72 |
| H | 9 | 80 |
Strengths, Limitations & Common Pitfalls
Linear regression is a powerful tool, but it has important limitations. Understanding these will help you avoid common mistakes in IB exams and in real-world data analysis.
| Strengths | Limitations |
|---|---|
| Provides a clear, objective measure of linear association (r) | Only detects linear relationships — a perfect curve would give r ≈ 0 |
| The regression line allows quantitative predictions | Extrapolation beyond the data range is unreliable |
| Easy to compute with a GDC — entering lists gives a, b, r instantly | Outliers can drastically skew the regression line and the r-value |
| r² gives the percentage of variation explained — easy to interpret | Correlation does not imply causation — a lurking variable may be the true cause |
| The regression line always passes through (x̄, ȳ) — useful for checking | Small sample sizes make r unreliable — a few points can show a strong r by chance |
Connection to Advanced Topics
The linear regression you learn in SL 4.2 is the starting point for a family of far more powerful techniques used across science, economics, and machine learning. Here is how the SL content connects to what comes next.
| SL 4.2 (This Topic) | HL / Further Study |
|---|---|
| One independent variable (x), one dependent variable (y) | Multiple regression: many independent variables predict y (e.g., y = a₁x₁ + a₂x₂ + ... + b) |
| Pearson's r measures linear correlation | Spearman's rank correlation (rs) handles non-linear monotonic relationships and ranked data |
| Fit a straight line only | Non-linear regression fits curves (quadratic, exponential, logarithmic models) |
| Coefficient of determination r² interpreted informally | Hypothesis testing on r — is the correlation statistically significant? |
| Use GDC for computations | Matrix algebra and software (Python, R, SPSS) for large data sets |
If you continue to HL, you will encounter Spearman's rank correlation and formal hypothesis testing for correlation. In university statistics or data science courses, you will use multiple regression models that extend the same least-squares principle to handle dozens of variables simultaneously. The logic you build now — scatter diagrams, residuals, r-values — forms the foundation for all of it.
Practice Problems
Lesson Summary
In this lesson you learned that bivariate data consists of paired observations (x, y), and we visualise them with a scatter diagram. The Pearson correlation coefficient (r) quantifies the strength and direction of a linear relationship, ranging from −1 (perfect negative) through 0 (no linear relationship) to 1 (perfect positive). We describe correlations as strong, moderate, or weak combined with positive or negative. The regression line of y on x (ŷ = ax + b) is found using least squares and always passes through the mean point (x̄, ȳ).
Use the regression equation for interpolation (predictions within the data range) but be cautious about extrapolation (predictions outside the range). The coefficient of determination (r²) tells you the proportion of variation in y explained by x. Above all, remember that correlation does not imply causation — always consider lurking variables and always check the scatter diagram for non-linear patterns before relying on r.