Statistics · Eqora guide

Correlation in math: a link is not a cause

Calculate a small Pearson example, inspect the paired observations and distinguish a linear association from a causal explanation.

Adult man in a blue vest observing pale-blue wind ribbons beside an open notebook at a whitewashed desert bird station

Two columns of numbers seem to rise together, so someone announces that changing the first will change the second. The calculation may be right while that conclusion is unsupported. Correlation in math summarizes a particular pattern in paired numerical observations. It does not identify a mechanism or tell you what an intervention would do. To interpret the number, you need the original pairs, a picture of their pattern and a clear distinction between description and explanation.

This guide develops the descriptive Pearson correlation coefficient from a small original example. You will calculate it, identify cases where it is undefined and examine a curved relationship and an influential unusual point. You can work through the method for free with paper and a calculator; no app is required. All datasets and causal scenarios below are invented teaching examples, not scientific findings or observations measured from the accompanying photographs.

Eqora publishes this independent learning guide. Eqora is a study aid, not a replacement for exam work or a guarantee of correctness or grades. Follow your course rules and check notation, assumptions and results. The observation-station photographs are conceptual illustrations: a ribbon, cord or filter does not encode a correlation coefficient. Never treat a convincing image or a polished numerical answer as evidence for a causal claim.

Correlation in math describes paired variation

A scatterplot places one point (x_i, y_i) for each observed pair. The descriptive Pearson coefficient r lies between −1 and +1 when it is defined. Positive values indicate a positive linear association; negative values indicate a negative linear association. The magnitude describes the strength of that linear pattern in the data, not whether the relationship is useful, important or causal. A negative coefficient can describe a stronger linear pattern than a smaller positive coefficient.

Berkeley’s discussion of correlation and association distinguishes linear association from nonlinear patterns and causation. Keep those distinctions when reporting a coefficient. With varying values in both variables, r = +1 corresponds to an exact increasing straight-line relationship and r = −1 to an exact decreasing one. A curved pattern can be strong yet poorly summarized by r. Start by plotting or inspecting the pairs rather than selecting a universal label such as strong from one numerical cutoff.

Keep each pair together when centering the data

Let x̄ and ȳ be the two arithmetic means, and write dx_i = x_i − x̄ and dy_i = y_i − ȳ. Define Sxx as the sum of dx_i², Syy as the sum of dy_i², and Sxy as the sum of dx_i dy_i. Then r = Sxy / √(Sxx Syy). This formula requires at least two pairs and Sxx > 0 and Syy > 0. The denominator scales the signed joint variation by the separate variation in each variable.

The row pairing matters throughout. Sorting the x values and y values independently invents new pairs and can manufacture a different association. Keep each original observation’s two values together, even when rearranging the rows for clarity. Missing entries require an explicit rule for which paired observations enter the calculation. Do not quietly use one set of rows for one mean and another set for the paired products; that would no longer be the stated calculation.

Calculate one complete small example

Use pairs (1, 2), (2, 4) and (3, 3). The means are x̄ = 2 and ȳ = 3. The centered x values are −1, 0, 1; the centered y values are −1, 1, 0, in that same row order. Their paired products are 1, 0, 0, giving Sxy = 1. The squared deviations sum to Sxx = 2 and Syy = 2. Consequently r = 1/√4 = 0.5.

There is a positive linear association in this tiny table, but the last pair does not continue an exact upward straight line. The coefficient does not say that half the y values are caused by x, that y rises by half a unit, or that the conclusion describes every future observation. Three constructed pairs provide a calculation exercise, not strong empirical evidence. Report the data size and inspect the actual values alongside the coefficient rather than making the decimal carry more meaning than it has.

Adult hand holding an open notebook beside pale-blue ribbons on two white observation posts overlooking a desert
Keep the two values belonging to one observation together; the photo is not a measured dataset.

Separate correlation from slope and measurement units

For varying x values, both y = 2x + 5 and y = 1000x + 7 have r = +1, although their slopes are very different. Correlation is unitless and does not measure units of y per unit of x. In our three-pair table, converting x into a unit sixty times smaller multiplies its numerical values by 60. The positive scaling multiplies Sxy and the denominator by the same factor, leaving r = 0.5.

Adding 10 to every y value also leaves the centered deviations unchanged. Multiplying every y value by −1 reverses the sign, producing r = −0.5, because it reverses the vertical direction. These statements concern translations and nonzero rescalings; a nonlinear transformation can change correlation in a more complicated way. Our guide to standard deviation explains why spread and units must be interpreted carefully. Do not confuse a unitless coefficient with a physical rate or a percentage effect.

Zero correlation can hide a perfectly predictable curve

Take x = (−2, −1, 0, 1, 2) and y = (4, 1, 0, 1, 4), so y = x² for every pair. Here x̄ = 0 and ȳ = 2. The centered cross-products sum to zero: the contributions from negative and positive x cancel. Sxx = 10 and Syy = 14 are both positive, so r = 0. The calculation is defined and correct, yet y is completely determined by x in this constructed table.

Plotting the five pairs shows a U-shaped pattern instead of a straight tilt. Therefore r = 0 does not mean no relationship, and it does not generally establish statistical independence. Nor does r near zero prove that an intervention would have no effect. The coefficient answers a limited descriptive question about linear association. When a pattern curves, describe that pattern and consider an appropriate model rather than trying to rescue an unsuitable linear summary with a stronger adjective.

Sky-blue cord bending in a broad U beside closed binoculars on a whitewashed ledge overlooking pale desert dunes
A curved pattern can be meaningful even when its linear correlation is zero.

A constant variable makes the coefficient undefined

If y = (5, 5, 5), every centered y value is zero, so Syy = 0. The denominator √(Sxx Syy) is zero and Pearson r is undefined. It is not a special case of r = 0. A horizontal or vertical scatterplot line with no variation in one coordinate therefore does not have a defined Pearson coefficient. Software may return a warning or a missing value; investigate the data rather than replacing it automatically with zero.

With just two pairs and different values in each coordinate, the two points always lie on a nonhorizontal straight line, yielding +1 or −1. That mathematical fact is not convincing evidence of a reliable population pattern. Calculating the descriptive coefficient itself does not require normally distributed data, but inference, intervals and particular tests need additional assumptions. This guide does not infer a population effect from a small table or promise a causal result from a significance test.

Inspect an unusual point without deleting it to improve r

Consider x = (1, 2, 3, 4) and y = (4, 1, 3, 2). Both means are 2.5, both centered squared sums are 5, and the centered cross-product sum is −2. Thus r = −0.4. Now add the pair (20, 20). Both means become 6; Sxx and Syy each become 250, and Sxy becomes 243. The new coefficient is 243/250 = 0.972. One distant pair has changed the summary dramatically.

These invented numbers demonstrate sensitivity, not permission to discard inconvenient observations. Check whether the unusual pair is a recording error, a different population or a genuine value within the study definition. Correct an error with evidence. If a value is genuine, report its influence transparently and justify any exclusion using the study rules, not the desired coefficient. Showing the analysis with and without a point can reveal sensitivity, but hiding the choice would misrepresent the dataset.

Adult hand examining an amber lens filter separately from blue filters on a white table in a desert observation station
Investigate an unusual observation and explain its influence instead of silently removing it.

A common cause can produce a convincing association

Imagine recording visitors to a community garden and refreshments sold there on several days. A positive association would not, by itself, show that buying a refreshment causes more people to arrive. Sunny weather might influence both quantities; visitors might also create demand for refreshments. This is a hypothetical scenario, not a report of a measured correlation. The same paired numbers can be compatible with different mechanisms, so the coefficient alone cannot choose the explanation.

Causal reasoning needs a stated question, attention to timing, possible common causes, selection and a suitable study design. Randomized experiments can address some of these problems when appropriate, but the justification comes from the design and assumptions, not from the size of r. Likewise, an apparently small coefficient cannot settle every causal question. Keep your conclusion proportional to the evidence: describe the observed association and separately state what would be needed to argue for a causal effect.

Check the calculation and then check the sentence

Recompute the original three-pair example without looking back: preserve the pairs, find the means, form the centered products and recover r = 0.5. Next reverse the sign of each y value and predict r = −0.5 before calculating. Finally replace y by a constant and explain why the formula stops being defined. These changes test the definition more effectively than memorizing the first decimal or assigning a strength label without a context.

Our guide to checking answers without a key encourages a second representation. For correlation, combine arithmetic with a scatterplot and a careful verbal conclusion. Ask whether the variables vary, whether a curve or unusual point dominates, and whether each claimed cause is actually supported by the study design. Write what r describes in the table and what it leaves unresolved. That final sentence is part of mathematical correctness, not an optional warning added after the calculation.

Young adult woman in a coral shirt writing independently in a notebook at a shaded whitewashed desert observation desk
Verify both the coefficient and the meaning of the statement you make from it.

Good to know

Questions about this guide

Does r = 0 mean that the variables are independent?

No. It describes zero linear correlation when the coefficient is defined. A nonlinear relationship can still be strong or even deterministic.

Is the coefficient zero when one variable is constant?

No. Its denominator is zero, so Pearson correlation is undefined. Do not replace an undefined value with a measured zero.