The Correlation Coefficient r Explained With a Small Dataset

October 21, 2026

The correlation coefficient, usually written r, summarizes how closely two variables move together in a straight-line pattern. It ranges from −1 to +1. A value near +1 means that when one variable rises, the other tends to rise as well; near −1 means one rises as the other falls; near 0 means no linear relationship. It is one of the most common statistics in science, business, and the media, so knowing how it works and what it can and cannot tell you is valuable.

We will calculate r by hand for a small dataset of hours studied (x) and quiz score out of 5 (y): x = 1, 2, 3, 4, 5 and y = 2, 4, 5, 4, 5.

Skip the math and get your answer instantly:

Open the Average Calculator →

Step 1: Means and Deviations

The mean of x is 3 and the mean of y is 4. The deviations are: x − 3 = −2, −1, 0, 1, 2 and y − 4 = −2, 0, 1, 0, 1.

Multiplying the deviations pairwise gives (−2)(−2) = 4, (−1)(0) = 0, (0)(1) = 0, (1)(0) = 0, (2)(1) = 2, so Σ(x−x̄)(y−ȳ) = 6.

Step 2: Sums of Squares and the Formula

The sum of squared x deviations is 4 + 1 + 0 + 1 + 4 = 10. The sum of squared y deviations is 4 + 0 + 1 + 0 + 1 = 6. Then r = 6 ÷ √(10 × 6) = 6 ÷ 7.746 = 0.775.

The r-squared value, 0.60, says that about 60% of the variation in quiz scores is accounted for by a straight-line relationship with hours studied in this tiny sample.

x (hours)y (score)x - meany - meanProduct
12-2-24
24-100
35010
44100
55212

The Line of Best Fit

The slope of the least-squares regression line is Σ(x−x̄)(y−ȳ) ÷ Σ(x−x̄)² = 6 ÷ 10 = 0.6. The intercept is ȳ − slope × x̄ = 4 − 0.6 × 3 = 2.2. So the predicted quiz score is 2.2 + 0.6 × hours. Each extra hour is associated with 0.6 points more on the quiz.

A prediction of 3.4 for 2 hours and 5.2 for 5 hours reminds us that predictions beyond the range of the data, such as 10 hours, would give 8.2 on a 5-point quiz, which is impossible. Do not extrapolate far beyond observed values.

How to Interpret r

Rules of thumb vary by field: |r| below 0.3 is often called weak, 0.3 to 0.7 moderate, and above 0.7 strong, but in physics a correlation of 0.9 might be considered poor, whereas in social science 0.3 can be meaningful. Always plot the data first. A scatterplot can reveal curves, clusters, and outliers that a single number hides.

With only five points, an r of 0.775 is not strong evidence of a real relationship. With larger samples, the same r would be far more convincing. Significance depends on both r and n.

Correlation Is Not Causation

Two variables can correlate because one causes the other, because both are caused by a third factor (confounding), or by coincidence. Ice cream sales and drowning deaths both rise in summer, but neither causes the other. Establishing causation requires controlled experiments, careful design, or strong causal reasoning.

Reverse causation is another trap: do people who exercise more become healthier, or do healthier people exercise more? The data alone cannot always say.

When r Misleads

A single outlier can raise or destroy a correlation. Curved relationships, such as the connection between stress and performance, can have r near zero even though the link is strong. Restricting the range of data, such as looking only at college graduates, can shrink r. Combining distinct groups can create or hide correlations, known as Simpson's paradox.

Frequently Asked Questions

What does r = 0.77 mean?

A fairly strong positive linear relationship: as one variable increases, the other tends to increase.

What is r-squared?

The proportion of variance in one variable accounted for by a linear relationship with the other.

Does a high correlation prove causation?

No. Causation requires further evidence, such as experiments or strong causal reasoning.

Can r be greater than 1?

No. It always falls between −1 and +1. A value outside that range indicates a calculation error.

Why plot the data?

Plots reveal outliers, curves, and subgroups that the correlation number can hide.