GloNeuro

Learn / Research design

Correlation

Correlation coefficients summarise in a single number how closely two measures rise and fall together. They capture only one kind of relationship and can mislead.

What a correlation is

A correlation is an association between two ordered variables in which one tends to be higher when the other is higher (a positive correlation) or lower (a negative correlation).

A correlation coefficient expresses this tendency as a number between −1 and 1. At 1 or −1 the points lie exactly on a line, or in exactly the same or opposite order; at 0 there is no such tendency.

Pearson’s r
Measures how closely the points follow a straight line (Pearson, 1895).
Spearman’s ρ (rho)
Pearson’s r calculated on the ranks of the values. It measures how consistently one variable increases with the other, whether or not in a straight line (Spearman, 1904).
Kendall’s τ (tau)
Compares every pair of points and asks whether they are in the same order on both variables (Kendall, 1938). It is usually closer to zero than ρ for the same data.

Sampling variation in r

A sample correlation r varies around the population value ρ, and the variation is larger in small samples.

Sample size, n

Simulated pairs of measurements. Below the scatter plot are the correlations of the last 20 samples (dots) with their 95% confidence intervals (lines), and the population value ρ (vertical line). About 95% of the intervals should contain ρ.

What r and r² mean

Pearson’s r is the average product of the two variables after each has been converted to standard units. Its square, r², is the proportion of the variation in one variable that a straight line accounts for. An r of 0.5 gives r² = 0.25, leaving three-quarters of the variation unexplained. Neither r nor r² says whether one variable causes the other.

Pearson and Spearman coefficients: outliers and curves

A single extreme point can change Pearson’s r greatly, and r underestimates relationships that are consistent but curved. Rank coefficients are much less affected, because an outlier can take only the highest or lowest rank.

Data

Simulated data sets. The highlighted point can be dragged or moved with the arrow keys. Very different patterns can share similar coefficients, so data should always be plotted (Anscombe, 1973).

Range restriction

If a study includes only part of the range of a variable, for example only people with high screening scores, the correlation within that range can be much weaker than in the population, although the relationship is unchanged.

Simulated population of 400 people with a moderate correlation between a screening score and a later outcome. Only people inside the window are included in the study.

The ecological fallacy

A correlation between group averages, such as regional averages, can differ greatly from the correlation among individuals. Inferring one from the other is the ecological fallacy (Robinson, 1950).

Show

Simulated data from five regions. Within every region the correlation is negative, yet the region averages are positively correlated.

Regression to the mean

People selected for an unusually high or low score were, on average, partly lucky or unlucky on that occasion, so when measured again they tend to score closer to the average, even if nothing has changed. This is a common reason why an untreated group appears to improve (Barnett et al., 2005). The effect is stronger when a measurement is less reliable, and a control group measured in the same way is the main safeguard.

Simulated test and retest scores for 200 people whose true ability does not change. The people with the highest 10% of first scores (coloured) score closer to the mean at the second test.

Shared trends over time

Two unrelated quantities that both drift upwards over the same years are strongly correlated; Yule called these nonsense correlations (Yule, 1926). Correlating the year-to-year changes instead of the levels removes the shared trend.

Two simulated series generated independently, each with an upward drift plus random variation, over 30 years.

Correlation and individual prediction

A correlation that is reliable for a group can say little about an individual. If hippocampal volume correlates with a memory score at r = 0.3, one person’s volume narrows the likely range of his or her score only slightly.

Simulated data in standard units. The shaded band is the 95% prediction interval for an individual; the outer dashed lines show the interval that ignores the horizontal variable.

Significance test and confidence interval for r

A correlation r from n pairs is tested against zero with a t statistic on n − 2 degrees of freedom:

t = r √(n − 2) / √(1 − r²)

The confidence interval uses Fisher’s z transformation, which makes the sampling distribution close to normal (Fisher, 1915):

z = artanh(r) = ½ ln[(1 + r) / (1 − r)],   SE = 1 / √(n − 3)

The interval z ± 1.96 × SE is converted back with r = tanh(z), so it is not symmetrical around r.

Test and confidence interval for a given correlation and sample size. The results were checked against SciPy’s pearsonr.

References

  1. Anscombe, F. J. (1973). Graphs in statistical analysis. The American Statistician, 27(1), 17–21. https://doi.org/10.1080/00031305.1973.10478966
  2. Barnett, A. G., van der Pols, J. C., & Dobson, A. J. (2005). Regression to the mean: what it is and how to deal with it. International Journal of Epidemiology, 34(1), 215–220. https://doi.org/10.1093/ije/dyh299
  3. Fisher, R. A. (1915). Frequency distribution of the values of the correlation coefficient in samples from an indefinitely large population. Biometrika, 10(4), 507. https://doi.org/10.2307/2331838
  4. Kendall, M. G. (1938). A new measure of rank correlation. Biometrika, 30(1–2), 81–93. https://doi.org/10.1093/biomet/30.1-2.81
  5. Pearson, K. (1895). Note on regression and inheritance in the case of two parents. Proceedings of the Royal Society of London, 58, 240–242. https://doi.org/10.1098/rspl.1895.0041
  6. Robinson, W. S. (1950). Ecological correlations and the behavior of individuals. American Sociological Review, 15(3), 351. https://doi.org/10.2307/2087176
  7. Spearman, C. (1904). The proof and measurement of association between two things. The American Journal of Psychology, 15(1), 72. https://doi.org/10.2307/1412159
  8. Yule, G. U. (1926). Why do we sometimes get nonsense-correlations between time-series? A study in sampling and the nature of time-series. Journal of the Royal Statistical Society, 89(1), 1. https://doi.org/10.2307/2341482

Last updated