Correlation &
Regression
Discover how to measure the strength of relationships between variables and find the line of best fit using least-squares regression.
What Is Correlation?
Correlation describes the strength and direction of a linear relationship between two quantitative variables. When one variable increases and the other tends to increase too, we say there is a positive correlation. When one increases while the other decreases, the correlation is negative.
Visualising Data with Scatter Diagrams
A scatter diagram plots paired data as points on the \(xy\)-plane. The pattern of points reveals the type and strength of correlation. A line of best fit summarises the overall trend.
Types of Correlation
The Correlation Coefficient \(r\)
$$r = \frac{S_{xy}}{\sqrt{S_{xx} \cdot S_{yy}}}$$
Interpreting \(r\) Values
The Regression Line \(y = ax + b\)
The least-squares regression line of \(y\) on \(x\) minimises the sum of squared vertical distances from each point to the line:
$$a = \frac{S_{xy}}{S_{xx}}, \qquad b = \bar{y} - a\bar{x}$$
Correlation vs Regression
| Correlation | Regression | |
|---|---|---|
| Purpose | Measures strength of linear relationship | Finds the equation of the best-fit line |
| Output | A number: \(r \in [-1, 1]\) | An equation: \(y = ax + b\) |
| Symmetric? | Yes: \(r_{xy} = r_{yx}\) | No: \(y\) on \(x\) differs from \(x\) on \(y\) |
| Used for | Describing association | Making predictions |
How to Find \(r\) and \(y = ax + b\)
Example 1: Computing \(r\)
Five students' study hours (\(x\)) and test scores (\(y\)) are recorded:
| \(x\) | 2 | 4 | 5 | 7 | 8 |
|---|---|---|---|---|---|
| \(y\) | 50 | 58 | 63 | 72 | 77 |
Example 2: Finding the Regression Line
Using the same data from Example 1, find the equation of the regression line \(y\) on \(x\).
Example 3: Making a Prediction
A student studies for 6 hours. Using the regression line \(y = 4.52x + 40.5\), estimate their test score.
Interpolation vs Extrapolation
Coefficient of Determination \(r^2\)
\(r^2\) tells us the proportion of variation in \(y\) that is explained by the linear relationship with \(x\).
Common Mistakes
Key Formulas Summary
| Quantity | Formula | Interpretation |
|---|---|---|
| \(r\) | \(\dfrac{S_{xy}}{\sqrt{S_{xx} \cdot S_{yy}}}\) | Strength and direction |
| \(r^2\) | \(\left(\dfrac{S_{xy}}{\sqrt{S_{xx} \cdot S_{yy}}}\right)^2\) | % of variation explained |
| Gradient \(a\) | \(\dfrac{S_{xy}}{S_{xx}}\) | Change in \(y\) per unit \(x\) |
| Intercept \(b\) | \(\bar{y} - a\bar{x}\) | Value of \(y\) when \(x = 0\) |
| Mean point | \((\bar{x}, \bar{y})\) | Line always passes through it |
Question 1 of 5
A data set has \(r = -0.92\). Which statement is most accurate?
Question 2 of 5
The regression line of \(y\) on \(x\) is \(y = 3x + 5\) and \(\bar{x} = 4\). What is \(\bar{y}\)?
Question 3 of 5
If \(r = 0.8\), what percentage of the variation in \(y\) is not explained by \(x\)?
Question 4 of 5
Data were collected for \(x\) values between \(10\) and \(40\). Using the regression line to predict \(y\) when \(x = 25\) is an example of:
Question 5 of 5
Given \(S_{xy} = 150\), \(S_{xx} = 50\), \(\bar{x} = 6\), and \(\bar{y} = 25\), what is the equation of the regression line \(y\) on \(x\)?