Durgical
EN
Open the app

Correlation

  • Measure

It measures how closely two numerical variables rise or fall together, from −1 to +1. It does not say that one causes the other.

Updated

What it is

A correlation coefficient sums up the strength and direction of the relation between two numerical variables. Pearson’s r measures the linear relation and assumes roughly normal data; Spearman’s ρ uses ranks and measures any monotonic relation, so it suits ordinal or skewed data. A strong correlation may come from confounding, reverse causation or chance: it is not proof of causation.

Formula and reading

  • r = Σ[(x − mean x)(y − mean y)] / √[Σ(x − mean x)² × Σ(y − mean y)²].
  • Rough reading of the absolute value: < 0.3 weak, 0.3 to 0.7 moderate, > 0.7 strong (cut-offs vary by field).
  • r² = r × r; with r = 0.5, r² = 0.25: 25% of the variation is explained.

Worked example

  1. Data: 5 adults; hours of exercise per week (x): 1, 2, 3, 4, 5; systolic pressure (y): 138, 137, 135, 128, 127 mmHg.
  2. Means: x = 3 hours; y = 665 / 5 = 133 mmHg.
  3. Deviations of x: −2, −1, 0, 1, 2. Deviations of y: 5, 4, 2, −5, −6.
  4. Sum of products = −10 − 4 + 0 − 5 − 12 = −31. Σ squared deviations of x = 10; of y = 25 + 16 + 4 + 25 + 36 = 106.
  5. r = −31 / √(10 × 106) = −31 / 32.6 = −0.95. r² = 0.91 (rounded).
  6. Spearman: the order of y is exactly the reverse of the order of x, so ρ = −1.
  7. Reading: a strong negative relation; it does not prove that exercise lowers pressure (5 people, no control of confounding).

Markers

  • r
  • r²
  • ρ

Common pitfalls

  • Inferring causation from a correlation.
  • Using Pearson with curved relations, very skewed data or outliers without checking the plot.
  • Confusing a significant correlation with a strong one: with many people, an r of 0.1 can give p < 0.05.

Test yourself

Think of the answer, then tap the question to see it.

What does r = −0.8 mean?

A strong negative linear relation: as one variable rises, the other tends to fall.

If r = 0.6, what share of the variation is explained?

r² = 0.36: 36% of the variation in one variable is explained linearly by the other.

When is Spearman’s correlation preferred to Pearson’s?

With ordinal data, skewed distributions or outliers, or when the relation is monotonic but not linear.

A study finds a strong correlation between ice-cream sales and drownings. What explains it?

A confounder, hot weather, raises both. The correlation does not mean one causes the other.

Add to my cards (4)

Connections

← All of epidemiology

Educational content on epidemiological and statistical methods; the examples use made-up numbers to teach the calculation. Not a clinical or legal guide: current Colombian rules are in the official sources.

Sources: Scatter Plot (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012); Linear Least Squares Regression (NIST/SEMATECH e-Handbook of Statistical Methods, National Institute of Standards and Technology, 2012).

Spotted a mistake?We are always improving for the community. Tell us what is wrong and our team will review it.Report a mistake

Representative model, for educational purposes only.