Skip to content
Scintria
ToolsGrant writerFunding
HomeLiteratureClinical trialsEvidence LabProtocol packData analysisLearnProjectsLibraryReferencesApplications
Start free
ScintriaStart free

Learn / Biostatistics / Correlation and linear regression

Correlation: strength of a straight-line relationship

12 minute read · 6-question quiz

Download this lesson as a colour Word or PDF study guide with the figures and answers. Included in paid plans; reading and quizzes stay free.Sign in

What you will learn

  • Interpret a scatter plot and the Pearson correlation coefficient

  • Choose between Pearson and Spearman correlation

  • Explain why correlation is not causation and name the usual traps

Before computing anything with two continuous variables, draw the scatter plot. Each point is a person; the horizontal position is one variable and the vertical is the other. The cloud's shape tells you whether the relationship is rising, falling, curved, or absent, and shows outliers.

The Pearson correlation coefficient r summarises the strength and direction of a straight-line relationship on a scale from −1 to +1.

  • r = +1: perfect rising line; r = -1: perfect falling line; r = 0: no linear relationship.
  • Rough guide (varies by field): |r| below 0.3 weak, 0.3 to 0.7 moderate, above 0.7 strong.
1201401603040506070Age (years)Systolic BP (mmHg)y = 88.24 + 0.96xr = 0.98, R² = 0.95r = 0.98
Age and systolic blood pressure in 16 adults: a strong positive linear relationship.

The coefficient

r = (Σ (x_i - x)(y_i - y))/(sqrt(Σ (x_i - x)^2 Σ (y_i - y)^2))

Equivalently, r is the average product of the z-scores of x and y. For the 16 adults above, r = 0.977, 95% CI 0.93 to 0.99 (Fisher's z method), p < 0.0001.

What r does and does not tell you

  • r² is the share of variation shared: 0.977² = 0.955, so about 96% of the variation in SBP in this sample is associated with age (in a straight-line sense).
  • r measures linear association only. A perfect U-shaped relationship can have r ≈ 0.
  • r is sensitive to outliers and to restricted ranges. A single extreme point can create or destroy a correlation.
  • r is unit-free and symmetric: the correlation of age with SBP equals that of SBP with age.
  • r says nothing about the slope: two data sets can have identical r but very different steepness. Regression (next lesson) gives the slope.

Spearman rank correlation

When data are skewed, ordinal or contain outliers, convert each variable to ranks and compute the correlation of the ranks: Spearman's ρ (rho). It detects any consistently rising or falling (monotone) relationship, curved or straight. For the example above, ρ = 0.979. Use Spearman for pain scales, CD4 against viral load (log it first or use Spearman), and any strongly non-normal data.

Pearson rSpearman ρContinuous, roughly normal dataStraight-line relationshipsSensitive to outliersReport with 95% CIOrdinal or skewed dataAny monotone relationshipRobust to outliersUses ranks
Pick by the type and distribution of the variables.

Correlation is not causation

Three common reasons for correlation without causation:

  1. Confounding: ice-cream sales and drownings both rise in hot weather. A third variable drives both.
  2. Reverse causation: depression and poor sleep are correlated, but which causes which?
  3. Chance and data dredging: compute enough correlations and some will be 'significant'. Spurious correlations abound (cheese consumption and deaths by bed-sheet tangling).

A further trap is the ecological fallacy: a correlation across districts (countries with more cell-phone use have lower child mortality) need not hold for individuals.

Agreement is not correlation

If you want to know whether two methods of measuring the same thing agree (a point-of-care haemoglobin meter against the laboratory analyser), correlation is the wrong tool: two instruments can be perfectly correlated while one reads 20 g/L too high. Use a Bland-Altman plot (difference against mean, with limits of agreement) or the concordance correlation coefficient.

Reading a published sentence

"Child stunting prevalence was strongly correlated with district poverty (Spearman ρ = 0.71, 95% CI 0.52 to 0.83, n = 52 districts)." This tells you the districts' ranks on the two measures move together. It does not show that poverty causes stunting, nor that poor households have stunted children (ecological).

Summary

  • Always plot first; r only measures straight-line association.

  • r ranges from −1 to +1; r² is the proportion of variation shared.

  • Use Spearman's ρ for skewed, ordinal or outlier-prone data.

  • Correlation is not causation: confounding, reverse causation, chance and ecological fallacies.

  • Agreement between measurement methods needs Bland-Altman analysis, not r.

Check your understanding

Question 1
1

A correlation of r = −0.8 between hours of exercise and resting heart rate means:

Question 2
2

r = 0.6 means r² =

Question 3
3

Which is the best choice for skewed viral load against CD4 count?

Question 4
4

A U-shaped relationship can have r near 0 because:

Question 5
5

To assess whether two haemoglobin meters agree, use:

Question 6
6

District-level correlation between rainfall and malaria cannot be used to say individuals with more rain exposure get more malaria because of:

Draft study guide. Spotted an error or something unclear? Tell us at hello@scintria.com. This is educational material, not clinical or regulatory advice.

Confounding, stratification and the Mantel-Haenszel estimateSimple linear regression