Correlation
Two things vary together: taller people tend to weigh more, more study hours tend to mean higher grades. Correlation puts a single number on that co-movement: the correlation coefficient r, which runs from −1 to +1 and captures both the direction and the strength of a straight-line relationship.
Reading the number
- Sign = direction. Positive r: as one goes up, so does the other. Negative r: as one goes up, the other goes down.
- Size = strength. Near ±1 the points hug a straight line; near 0 they're a shapeless blob with no linear trend.
What to look at in the picture
Before the number comes the scatterplot, and four things are worth saying out loud about every one you meet, in this order. The form: straight, curved, or broken into clumps. The direction: up to the right or down to the right. The strength: a tight band around that form, or a loose haze. Then, last, the deviations from the pattern, meaning the points that refuse to join in. Only the first three describe the crowd. The fourth is where most of the interesting questions live, and giving it a name of its own stops it being waved away.
The drawing itself needs some care as well. Stretch a plot tall and a limp relationship starts to look convincing; flatten it and a real one turns into a smear. Keep the plotting area roughly square, let each axis cover about the range its variable actually occupies, and leave no wide bands of empty paper at the edges. Then what you are reacting to is the relationship rather than the aspect ratio.
Numbers are abstract, though. The fastest way to build intuition is to see what an r of 0.3 versus 0.9 actually looks like, and to break a tidy relationship by dragging a single point.
🎮 Correlation Explorer
Set a target strength to generate a cloud, then drag any point. The coefficient r is computed live from whatever is on screen.
Computing r by hand
The coefficient is not a black box, and on a small table it is a five-minute job with a basic calculator. The definition says: turn every value into a z-score, multiply each pair of them together, and average the results.
r = 1 / (n − 1) · Σ [(x − x̄) / sx] · [(y − ȳ) / sy]
Standardizing is what makes the two columns comparable: after it, both are measured in standard deviations from their own mean, so a person above average on both contributes a positive product, as does a person below average on both, while a person high on one and low on the other contributes a negative one. Add the products up and the sign of the total tells you which kind of person dominates. Divide by n − 1, the same divisor the standard deviation uses, and the answer can never leave the range −1 to +1.
Five music students below, with the hours each spent practicing in a week and the mark their teacher gave the piece. Step through the four buttons and the table fills in column by column.
📏 Correlation, Step by Step
Five students, their practice hours and their marks. Step 1 measures how far each student sits from the two means, step 2 puts those distances in standard deviations, step 3 multiplies each pair, and step 4 averages the products into r.
The arithmetic runs: x̄ = 3.0 hours and ȳ = 66.0 marks, sx = 1.58 and sy = 9.62, and the five products come out as 1.447, −0.263, 0.000, −0.066 and 1.841. Their total is 2.959, and 2.959 divided by 4 gives r = 0.740. Look at where that total comes from. The two students at the ends of the practice range contribute 3.288 between them, which is more than the whole total, because the two in the middle pull against the trend and take some of it back. One of those two practiced an hour above average and scored a mark just below it. And the student who practiced exactly the average three hours contributes a flat zero however well or badly they did, because their standardized x is zero and zero times anything is zero. Distance from the mean is what buys influence here, which is the arithmetic underneath the outlier warning below.
Facts about r
Several useful properties fall straight out of that formula. Because it is built from standardized values, r carries no units and does not move if you change them: measure practice in minutes instead of hours, or marks out of 20 instead of 100, and the coefficient is identical. Because x and y enter the product symmetrically, correlating y with x gives exactly the same number as correlating x with y, which is the first sign that r is a description rather than a prediction. The mean of standardized products cannot escape −1 to +1, and it reaches an endpoint only when every point lies on one straight line. Both columns have to be quantitative: there is no correlation between eye color and blood type, however the software behaves when you feed it numbered categories.
Two more facts matter enough to have earned the next section. The formula sees straight lines and nothing else, and a single unusual point can move the answer a long way.
Three things people get wrong
1. Correlation only sees straight lines. A perfect U-shape (y = x²) can have r ≈ 0 even though the variables are perfectly related. Low r means "no linear trend," not "no relationship." Always look at the scatter.
2. Correlation is not causation. Ice-cream sales and drowning deaths rise together (both driven by hot weather). A strong r tells you two things move together, never why. If you can measure the lurking variable, a partial correlation asks the question again with that variable held constant, which is the same "holding the others constant" idea that multiple regression generalizes. Hold temperature constant and the ice-cream link collapses; the ones that survive are the interesting ones.
3. A single outlier can fake a correlation, or hide one. Drag one point far away in the playground and watch r lurch. Real analyses always check whether one stray point is doing all the work.
All three warnings collapse into one habit: plot your data. The classic proof is Anscombe's quartet: four datasets that share almost every summary number yet look nothing alike. (For two numeric variables the scatterplot is nearly always right; when one of them turns out to be categorical, the chart chooser hands you the display that fits instead.)
🎮 Same r, Four Different Stories
Four datasets with identical means, correlation (r = 0.82), and best-fit line. The statistics can't tell them apart — but your eyes can. Flip between them.
Every dataset above reports r = 0.82 and the exact same line, yet only the first is the tidy linear relationship that number implies. The second is a smooth curve, the third is a perfect line derailed by one outlier, and the fourth has no trend at all until a single far-flung point invents one. Summary statistics are a compression; the scatter is the truth.
Which raises the obvious question in the other direction: how good is your eye? Reading a strength off a cloud is a skill, it is trained by feedback rather than by reading about it, and almost everybody starts out guessing too high. The ten plots below are fixed, so a whole class gets the same ten in the same order and can compare notes afterwards.
🎮 Guess the r
Ten scatterplots, the same ten every visit. Type the correlation you think you are looking at, press Enter to check, then press Enter again for the next one.
The running score is a mean absolute error: for each plot you have checked, the distance between your guess and the true value, with the sign thrown away, averaged over the plots so far. It answers "how far off am I, typically?" rather than "am I too high or too low?", and because the misses never cancel, a run of overestimates cannot hide inside it. Under about .10 by the end of the ten is a genuinely good eye. Most people land nearer .15 on their first pass and improve quickly, which is the point of doing it rather than reading about it.
Two habits come out of this exercise. A cloud that looks like a clear relationship is often around .5 rather than the .8 it feels like, and the visual difference between .0 and .3 is much smaller than the difference between .6 and .9. Both are reasons to report the number instead of describing the picture in words.
Two reasons r comes out too small
A weak correlation sometimes means the relationship is weak. Two duller explanations come first, and both make an honest relationship look smaller than it is.
Restriction of range. Correlation feeds on spread, so looking at only part of the range starves it. Suppose an admissions test correlates .60 with later grades across all applicants. Compute that correlation inside the students you actually admitted, the top quarter of the test distribution, and .60 shows up as roughly .35; in the top 10% it falls to about .30. Nothing about the underlying relationship changed. You removed the variation that made it visible. This is why selective samples (admitted students, hired employees, patients sick enough to be referred) return correlations that look disappointing, and why a validity study run inside the selected group understates the very test that did the selecting.
Unreliable measures. Every measurement carries noise, and noise correlates with nothing. The shrinkage this causes has a name, attenuation. If your two variables have reliabilities rxx and ryy, the correlation you observe is the true one shrunk by a factor of √(rxx · ryy). Two questionnaires at a respectable α = .70 apiece turn a true correlation of .60 into an observed .42. The same arithmetic sets a ceiling: with those instruments, even a perfect underlying relationship could not report above .70.
Before writing "the variables were only weakly related," check both. Did you compute r inside a selected slice of the range, and how reliable were the measures? A .30 from a restricted sample with noisy instruments is compatible with a substantial relationship in the population.
Undoing attenuation, and why it bites
Attenuation has an obvious-looking inverse. If unreliability shrinks r by a factor of √(rxx · ryy), dividing that factor back out should recover the correlation between the true scores:
rcorrected = robserved ⁄ √(rxx · ryy)
That is the correction for attenuation, and on the example above it works exactly: .42 divided by .70 returns the .60 the noise was hiding. What the formula does not show is that the divisor is itself an estimate from the same modest sample, and dividing by an uncertain number below 1 magnifies everything, sampling error included.
Simulating the whole procedure puts a size on that. Two 8-item scales at α ≈ .70, 100 respondents, a true correlation of .60, with both alphas estimated from the same sample: the corrected estimate averages .60, so the correction is unbiased enough, but 90% of its values land between .41 and .78, a spread about a third wider than the raw r's. Raise the true correlation to .90 and the same procedure returns a corrected value above 1.0 in roughly one sample in ten.
So report the correction as a supplement, never as a replacement: the observed r, the reliabilities you used, and the corrected value labeled as corrected. A reader can then judge whether "stronger than it looks" rests on the data or on dividing by .70. And if the corrected value comes out above 1, say so. It means the reliability estimates are too low for the correlation you observed, which is evidence about your instruments rather than about the constructs.
The interval around r
An r of .42 from 60 people is one sample's answer, and the fair next question is how far it would move if you ran the study again. The usual add-and-subtract formula cannot answer it. A correlation cannot pass 1, so as the true value climbs, the sampling distribution of r piles up against that ceiling and grows a long tail on the low side only. Symmetric limits would run off the end of the scale.
Fisher's transformation moves the problem somewhere the ceiling does not exist. Writing z = ½ · ln[(1 + r) / (1 − r)] stretches the correlation scale until it runs from minus infinity to plus infinity, and on that scale the sampling distribution is close to normal with a standard error of 1/√(n − 3), which depends on the sample size and nothing else. Add and subtract 1.96 standard errors there, then map both limits back with r = tanh z.
On this lesson's own numbers: r = .42 with n = 60 gives z = .448 and a standard error of 1/√57 = .132, so the interval on the transformed scale is .448 ± .260, or [.188, .707]. Mapped back, that is 95% CI [.19, .61]. The estimate sits .23 above its lower limit and .19 below its upper one, and that lopsidedness is what the transformation exists to handle. It is the number the Correlation & Regression Calculator prints beside r under the label "Fisher z", and the one the APA Results Formatter writes into the sentence.
Two things follow. The interval is wide: .19 to .61 covers everything from below Cohen's "medium" to above his "large", so an r reported bare invites a reader to take .42 far more literally than 60 people can support, and getting the half-width down to .10 around this estimate would take n = 263. And the transformation is more than a reporting device. Correlations are averaged on the z scale rather than the r scale for the same reason, which is one of the conversions behind pooling results across studies.
Why it matters: correlation is the first measure of "do these two move together?" And it's the direct stepping stone to regression, which turns that relationship into a predictive line.
Got two columns of your own? Paste them into the Correlation & Regression Calculator for a live scatterplot, r with its p-value and 95% CI, Spearman's ρ, and an outlier-robustness check.
Want a real cloud to try this on? screen-time.csv holds 60 people, one influential point, and the worked answer for what r does when you drop it.
Problem 20 of the practice problems computes r from six pairs of numbers by hand, then asks what besides causation could have produced it.
Problem 23 runs the standardized-product table above on five hospital wards, ending on a negative r and the ward that contributes nothing to it.
Common questions
What counts as a strong correlation?
Common benchmarks: |r| ≈ .10 small, .30 medium, .50+ large. Psychology rarely sees field correlations above .5, while physics laughs at anything below .95. Context is everything: r = .3 between a cheap screening question and job performance is valuable; r = .8 between two versions of the same questionnaire is unremarkable. Always interpret r against what's typical for your domain.
What is the difference between Pearson and Spearman correlation?
Pearson's r measures linear association using the actual values; Spearman's ρ replaces values with ranks first, so it measures monotonic association ("consistently increasing, straight or not"). Spearman is robust to outliers and fine for ordinal data — if the two disagree sharply, that's a clue your relationship is curved or an outlier is steering Pearson.
My two groups both show a correlation, but one is bigger. Can I test whether they really differ?
You can, and the answer is usually humbling. Put both correlations on the Fisher z scale, subtract, and divide by √(1/(n₁−3) + 1/(n₂−3)); the result is a z you read off the normal table. Take r = .55 in one group of 60 and r = .30 in another: z = 1.65, p = .099, so a gap that looks decisive is not distinguishable from sampling noise, and the two intervals ([.34, .71] and [.05, .51]) overlap across most of their length. Detecting that difference with 80% power would take 168 people per group, twice what either correlation on its own needs. Correlations measured on the same people (does X predict Y better than Z does?) are a different test again, because the two estimates are not independent.