Correlation and Regression
On this page
Direct answer
Correlation measures the strength and direction of a linear association between two continuous variables, expressed by the Pearson coefficient r, which ranges from minus 1 to plus 1. Regression goes further by fitting a line, y equals a plus bx, that predicts one variable from another. Correlation does not establish causation, so r should always be read alongside a scatter diagram.
What you must remember
- Pearson coefficient r: ranges from minus 1 (perfect negative) through 0 (no linear relation) to plus 1 (perfect positive).
- Coefficient of determination: r squared, the proportion of the variation in one variable associated with the other.
- Scatter diagram: plots each pair of values and shows form, direction and outliers before r is calculated.
- Regression line: y = a + bx, where a is the intercept and b the slope, fitted by the method of least squares.
- Regression coefficient b: the change in y for one unit change in x; unlike r, it carries the units of the data.
- Spearman rank correlation: used for ordinal data or a monotonic relationship that is not linear.
- Causation: a correlation may arise from confounding or chance, so causal claims need support from the study design.
Worked calculation: r from five pairs
A five-pair example shows how r is built from deviations about the two means, and each step is short enough to check by hand. Take x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 5.
- Plot the scatter: check for a roughly linear pattern before calculating anything, since r is unreliable otherwise.
- Find the means: the mean of x is 3 and the mean of y is 4.
- Take the deviations: dx = minus 2, minus 1, 0, 1, 2 and dy = minus 2, 0, 1, 0, 1; the sum of dx times dy is 6.
- Compute the sums of squares: the sum of dx squared is 10 and the sum of dy squared is 6.
- Calculate r: r = 6 divided by the square root of (10 times 6), which is about 0.77.
- Interpret: r of about 0.77 shows a strong positive linear association, and r squared of about 0.6 means about 60 per cent of the variation in y is associated with x in this sample.
The same method scales to any number of pairs, and software reports the identical value.
Where the exam tries to catch you
Examiners test whether you can interpret r without overreaching.
- Trap: saying a correlation of 0.8 proves that x causes y Correct: correlation shows association only, and confounding or reverse causation must be addressed by design.
- Trap: believing r equal to 0 means there is no relationship Correct: r measures linear association only, so a strong curved relationship can give r near 0.
- Trap: using Pearson correlation for ordinal scores Correct: use Spearman rank correlation for ordinal data or a monotonic, non-linear trend.
- Trap: judging strength by the size of the regression coefficient b Correct: b depends on the units, whereas r is unitless and describes strength.
Frequently asked questions
What does a Pearson correlation coefficient of minus 0.8 mean?
A Pearson coefficient of minus 0.8 indicates a strong negative linear association, in which one variable tends to fall as the other rises. Its square, 0.64, shows that about 64 per cent of the variation is associated with the other variable.
What is the difference between correlation and regression?
Correlation measures the strength and direction of association between two variables without treating either as the cause. Regression fits an equation that predicts a dependent variable from an independent variable.
Why is a scatter diagram drawn before calculating r?
A scatter diagram reveals whether the relationship is linear, whether outliers are present and whether the spread is uniform. Pearson r can mislead when these features are not met.
When is Spearman rank correlation used instead?
Spearman rank correlation is used for ordinal data or when the relationship is monotonic but not linear. It ranks the values in each variable and calculates the correlation between the ranks.