Relationships · 7 min read

Correlation, explained: reading r and heatmaps

One number between −1 and +1 that is easy to compute and easy to misread. What r tells you, what it hides, and how to read a whole matrix of them.

Advertisement
Updated November 2026 · Plain English

A correlation coefficient compresses the relationship between two variables into a single number between −1 and +1. That makes it one of the most useful summaries in statistics, and one of the easiest to misread. This guide explains what Pearson's r measures, how its significance depends on sample size, how to read a correlation heatmap, and the four situations in which r will mislead you unless you look at the scatter plot.

What Pearson's r measures

Pearson's r measures how closely the points in a scatter plot follow a straight line. +1 means a perfect rising line, −1 a perfect falling line, and 0 means no linear trend at all.

Two consequences of that definition surprise people:

How strong is "strong"?

Common rules of thumb (from Jacob Cohen) describe |r| ≈ 0.1 as small, 0.3 as medium and 0.5 or above as large. These are only rough guides: in physics or analytical chemistry, r = 0.95 between two instruments might be disappointing, while in psychology or epidemiology r = 0.3 can be an important finding.

Squaring r gives the share of variance the two variables have in common. An r of 0.5 gives r² = 0.25: only a quarter of the variation in one variable is linearly associated with the other. This is a useful reality check: a "strong" correlation of 0.5 still leaves three quarters of the variation unexplained.

Significance depends heavily on sample size

The p-value for a correlation tests whether r differs from zero. It comes from t = r √(n − 2) / √(1 − r²) with n − 2 degrees of freedom. The same r can be convincing or meaningless depending on n:

rnp (two-sided)Interpretation
0.3020≈ 0.20Could easily be chance
0.30100≈ 0.002Very unlikely to be chance, still a modest relationship
0.101,000≈ 0.0015Real, but explains only 1% of the variance
0.608≈ 0.12Looks strong, but eight points are not enough

So always report r together with n (and ideally a confidence interval), and judge the size of r separately from its p-value. More on that distinction in what a p-value really means.

Four ways r misleads: always plot first

The statistician Francis Anscombe made this point famous in 1973 with four small datasets that share the same means, variances, regression line and correlation (r ≈ 0.82) but look completely different when plotted: one is a clean linear trend, one a smooth curve, one a perfect line with a single outlier, and one a vertical stack of points with one far-away value that creates the whole correlation. The lessons:

  1. Curved relationships. r underestimates a strong but non-linear relationship. Look at the scatter plot; if it curves, r is the wrong summary.
  2. Outliers. A single extreme point can create a strong correlation out of nothing, or destroy a real one. Spearman's rank correlation is much less sensitive to this.
  3. Restricted range. If you only sample a narrow slice of X (for example, only students with top grades), the correlation within that slice will be weaker than in the full population.
  4. Mixed groups. Combining two groups that differ in both X and Y can produce a correlation that exists in neither group alone, or even reverses the direction within each group (Simpson's paradox).

In StatFlo, a Scatter Plot of the two columns shows the points together with the fitted line and Pearson r, so you can check all four issues at a glance.

Correlation is not causation

A strong correlation between X and Y is consistent with X causing Y, Y causing X, a third variable causing both (ice-cream sales and drownings both rise in summer), or a coincidence that will not replicate. Establishing causation needs a controlled experiment or careful causal reasoning about confounders, not a stronger correlation.

Pearson or Spearman?

Pearson rSpearman ρ (rho)
MeasuresLinear associationMonotonic association (consistently up or down, not necessarily straight)
Calculated onRaw valuesRanks of the values
OutliersSensitiveRobust
Best forRoughly linear, continuous data without extreme valuesSkewed data, ordinal scales, curved but steadily rising/falling trends

StatFlo currently reports Pearson's r. A quick way to get Spearman's ρ is to convert each column to ranks in a spreadsheet (Excel's RANK.AVG function) and compute Pearson's r on the ranks; that is exactly what Spearman's ρ is.

Reading a correlation heatmap

When you have many variables, a heatmap shows the correlation for every pair at once. StatFlo's Correlation Heatmap colours each cell from red (r = −1) through white (r = 0) to navy (r = +1) and prints the value in each cell.

For a heatmap, your data must be aligned by row: each row should be one subject or sample, with each column a different variable measured on that subject. If the columns have different lengths, StatFlo compares each pair using the first rows, up to the length of the shorter column, so avoid blank cells in the middle of a column: they would shift the remaining values out of alignment.

How to report it

"Sleep duration was moderately correlated with test score (Pearson r = 0.30, n = 100, p = 0.002)." Add a scatter plot whenever space allows.

Make a scatter plot or correlation heatmap.

Upload your variables as columns: StatFlo fits the line, reports r and R², or maps every pair at once.

Open StatFlo