Skip to content

Search Broadly Epi

Understanding Correlation

Why correlation matters in public health

Public-health datasets often contain variables that move together: temperature and heat illness, age and blood pressure, vaccination coverage and disease incidence, or deprivation and access to care. Correlation gives analysts a compact way to describe one aspect of that pattern. It is often a useful beginning for exploration—but it is not a study design, a causal estimate, or an explanation by itself.

Read the scatterplot before the coefficient

A coefficient compresses many paired observations into one number. Before calculating it, plot the data. A scatterplot can reveal whether the relationship is roughly linear, whether one observation dominates the result, whether groups differ, or whether a curved pattern would be hidden by a coefficient near zero.

Maximum summer temperature and heat-related emergency visits in six example neighborhoods A scatterplot with six points rising from lower left to upper right. Maximum temperature increases from 78 to 94 degrees Fahrenheit while heat-related emergency visits increase from 3 to 10 per 10,000 residents. 788285889194 357911 Maximum temperature (°F) Heat-related ED visits per 10,000
Example data show a strong positive linear association. The dashed line summarizes the pattern; it does not prove what caused the differences among neighborhoods.

Worked example: heat and emergency visits

Suppose an analyst compares the maximum summer temperature with heat-related emergency-department visits across six fictional neighborhoods. Each row is one paired observation.

NeighborhoodMaximum temperature (°F)Heat-related ED visits per 10,000
A783
B824
C855
D887
E918
F9410
Small fictional dataset used consistently through the worked example.

For these six pairs, Pearson’s r is approximately 0.987. That is a very strong positive linear association in this small dataset: neighborhoods with higher maximum temperatures also had higher rates of heat-related emergency visits.

A correct interpretation stops there. The calculation alone does not show how much of the difference was caused by temperature. Tree canopy, housing quality, air conditioning, age distribution, occupational exposure, measurement differences, and other factors may influence both the observed temperatures and emergency visits. Because the rows describe neighborhoods, the result also cannot establish that the individuals with greater heat exposure were the individuals who visited an emergency department.

What Pearson’s r measures

Pearson correlation coefficient

r=∑(xi−x¯)(yi−y¯)∑(xi−x¯)2∑(yi−y¯)2

What every symbol means

r
The correlation coefficient you are calculating. It will be between −1 and +1.
x
The first variable. Here, x is maximum temperature.
y
The second variable. Here, y is heat-related emergency visits.
i
The row you are working on. For example, row 1 is neighborhood A.
x̄ and ȳ
The mean, or ordinary average, of all the x values and all the y values.
∑
Capital sigma means “add all of these up.” It is an instruction, not another variable.
²
Square the number: multiply it by itself. For example, 3² = 3 × 3 = 9.
√
Find the square root: the number that, multiplied by itself, gives the value inside the symbol.

The basic idea: first ask whether each pair is above or below its two averages. Then combine those movements and scale the result so different datasets can be compared on the same −1-to-+1 range.

Calculate it yourself

Use the formula with the six neighborhoods

You can follow these steps with paper and a basic calculator. Keep two decimal places while you work; the tiny rounding difference at the end is expected.

Step 1: Find the two averages

Add the six temperatures and divide by 6. Then do the same for the six visit rates.

x̄ = (78 + 82 + 85 + 88 + 91 + 94) ÷ 6 = 86.33
ȳ = (3 + 4 + 5 + 7 + 8 + 10) ÷ 6 = 6.17

Step 2: Work across each row

Subtract the appropriate average from each value. For neighborhood A, the temperature difference is 78 − 86.33 = −8.33 and the visit-rate difference is 3 − 6.17 = −3.17. Multiply those differences, then square each difference. Repeat for every row.

Areax − x̄y − ȳMultiply the differencesSquare the x differenceSquare the y difference
A−8.33−3.1726.3969.4410.03
B−4.33−2.179.3918.784.69
C−1.33−1.171.561.781.36
D1.670.831.392.780.69
E4.671.838.5621.783.36
F7.673.8329.3958.7814.69
Add each column0.000.0076.67173.3334.83

The first two columns add to zero because differences above and below an average balance one another. The last three totals are the numbers the formula needs.

Step 3: Put the totals into the formula

r = 76.67 ÷ √(173.33 × 34.83)
r = 76.67 ÷ √6037.78
r = 76.67 ÷ 77.70

r ≈ 0.987

The positive sign tells us the two variables tend to rise together. The value is close to +1, so the six points follow a strong straight-line pattern. It still does not tell us that temperature alone caused the differences.

Try changing one value

Replace neighborhood F’s visit rate of 10 with a much lower number, such as 4. Recalculate the y average and the affected columns. The coefficient will become smaller because the last point no longer follows the upward pattern as closely. This is a useful way to see how one observation can change a correlation.

Pearson’s r ranges from −1 to +1. The sign gives the direction of the linear association. The absolute value summarizes how closely the points follow a straight-line pattern. A value near +1 indicates a strong positive linear association; a value near −1 indicates a strong negative linear association; and a value near 0 indicates little linear association.

Near zero does not mean “no relationship.” A strong U-shaped or other nonlinear pattern can produce a Pearson correlation close to zero. A large coefficient also does not guarantee that a straight line is the most useful summary. Always interpret the coefficient beside a plot and the study context.

How strong is strong?

There is no universal threshold that turns a coefficient into “weak,” “moderate,” or “strong” for every field. The practical meaning depends on measurement reliability, expected biological or social variation, sample size, the range of values studied, and the decision the analysis must support. Report the coefficient, show the data, and explain the context instead of relying on a label alone.

When Spearman rank correlation is useful

Spearman’s rank correlation describes a monotonic relationship: as one variable increases, the other tends consistently to increase or decrease, even when the pattern is not a straight line. It operates on ranks and can be useful for ordinal data or monotonic relationships that do not meet Pearson’s linear framing. Tied ranks require the standard tie-aware calculation used by statistical software; the familiar shortcut formula without a correction is not generally exact when ties are present.

Four common interpretation mistakes

  1. Calling association causation. Confounding, reverse causation, selection, and measurement can all produce or distort correlation.
  2. Skipping the plot. Outliers, clusters, curved patterns, and data errors can disappear inside one number.
  3. Assuming zero means unrelated. Pearson’s r can miss strong nonlinear relationships.
  4. Comparing coefficients without context. Restricting the observed range or changing how variables are measured can change the coefficient.

Knowledge check

Across several counties, vaccination coverage and disease incidence have a Pearson correlation of −0.72. Which conclusion is best supported?

  1. Vaccination caused incidence to fall by 72%.
  2. Higher coverage was associated with lower incidence in a fairly strong linear pattern.
  3. Seventy-two percent of disease cases occurred in unvaccinated people.
  4. No other county-level factor could explain the pattern.
Show the answer and reasoning

B is the supported interpretation. The sign indicates that higher coverage tended to occur with lower incidence, and the magnitude describes a fairly strong linear association in these data. The coefficient is not a percentage, does not estimate an individual vaccine effect, and does not rule out confounding or ecological bias.

A brief history—and an ethical boundary

Francis Galton and Karl Pearson helped develop correlation while studying heredity, and both were central advocates of eugenics. University College London’s institutional history documents how early biometry and eugenics developed together. That history is not a decorative footnote: it shaped institutions, human classifications, and the questions the methods were built to answer. Using correlation today does not endorse eugenics, but responsible analysis requires scrutiny of how variables are defined, whose data are collected, and which decisions a result may support.

Humanities Moment

Johann Carl Loth

German painter · 1632–1698

Loth was a seventeenth-century painter whose Diogenes shows the ancient philosopher raising a lamp while searching for an honest person. The work is the article’s featured image and was sourced from Artvee by Broadly Epi.

Why this work: the lamp offers a modest visual metaphor for careful inquiry. A correlation can illuminate a pattern, but an honest analysis keeps searching for alternative explanations, limitations, and what the calculation cannot establish. The painting provides context; it is not statistical evidence.

Sources and further reading