Is a correlation real?
A Pearson correlation coefficient r measures the strength of a linear relationship between two variables, from −1 to +1. In a sample, even unrelated variables show some correlation by chance, especially with few data points. The significance test checks whether r is large enough, given the sample size, to conclude that the population correlation ρ is not zero.
The formula
t = r × √(n − 2) ÷ √(1 − r²), with n − 2 degrees of freedom
The p-value comes from Student’s t distribution.
Example
r = 0.45 from 30 pairs:
- t = 0.45 × √28 ÷ √(1 − 0.2025) ≈ 2.67;
- two-tailed p ≈ 0.013: significant at α = 0.05;
- r² ≈ 20%: x explains about a fifth of the variance of y;
- the smallest significant |r| with 30 pairs is about 0.361.
Confidence interval with Fisher’s z
The sampling distribution of r is skewed, so the confidence interval uses Fisher’s transformation:
z = ½ ln((1 + r) ÷ (1 − r)), with standard error 1 ÷ √(n − 3)
The interval z ± z* × SE is then converted back to r. For the example, the 95% interval runs from about 0.11 to 0.70: the correlation is clearly positive but could be weak or fairly strong.
How many pairs do you need?
The smallest r that reaches significance at α = 0.05 (two-tailed) shrinks with the sample size:
| n | Smallest significant r |
|---|---|
| 10 | 0.632 |
| 20 | 0.444 |
| 30 | 0.361 |
| 50 | 0.279 |
| 100 | 0.197 |
| 1,000 | 0.062 |
With large samples, very weak correlations become significant. Significance says a relationship is unlikely to be zero, not that it is strong or useful.
Cautions
- Correlation is not causation: a third variable may drive both.
- Pearson’s r only captures linear relationships; always look at a scatter plot.
- Outliers can create or hide a correlation.
- Restricted ranges weaken correlations.
- For ranked data or non-linear but monotonic relationships, use Spearman’s rank correlation.
Use the linear regression calculator to get the slope and intercept of the best-fit line.