Skip to content
en

Correlation calculator

Pearson's correlation from pairs of numbers: r, the coefficient of determination r², the direction of the link and its strength on the Chaddock scale.

Input

Result

Fill in the fields – the result will appear here.

Report a problem
This will be sent with your message:
Advertisement

Correlation, r and r²

What a correlation coefficient is

A number from −1 to 1 that shows how closely two series of numbers move together. One – all points lie on one rising straight line: a larger X always means a larger Y. Minus one – the same line, only falling. Zero – there is no straight-line link. The most widely used of these coefficients is Pearson's linear coefficient, and that is the one this calculator works out.

How it is worked out

The calculator takes the mean of X and the mean of Y, looks at how far each pair deviates from those means and compares whether they deviate in the same direction. The sum of the products of the deviations is divided by the spread of both series – which is why the result does not depend on the units. Dollars and degrees, kilograms and points give an equally readable r.

Coefficient of determination r²

This is r multiplied by itself. It reads as the share of the spread of Y that is explained by the link with X: r = 0.8 gives r² = 0.64, that is 64% of the swings in Y go along with the change in X, and the other 36% come from something else. The sign is lost on the way, so r² speaks about the strength of the link but not its direction.

Strength of the link on the Chaddock scale

In words, the strength of the link is described on the Chaddock scale: up to 0.1 – there is practically no link, 0.1–0.3 – weak, 0.3–0.5 – moderate, 0.5–0.7 – marked, 0.7–0.9 – high, from 0.9 – very high. This is a reading convention, not part of the formula: textbooks agree on the boundaries themselves, but some swap the words “moderate” and “marked”. So look at the boundaries, not the adjective.

Correlation is not cause

The costliest mistake in reading r. Two series can move together because one affects the other, because both depend on something third, or simply by chance – with short series this happens often. The number itself does not tell these cases apart and cannot.

Common questions about correlation

How many pairs are needed?

At least three. A straight line always passes through two points, so with two pairs r is one whatever the numbers are and measures nothing – the calculator does not work out such a request. It will work out three pairs, but the result becomes reliable rather from a few dozen upwards.

How do I enter the numbers?

One pair per line: X first, then Y, separated by a space, a tab or a semicolon. Two columns copied from a spreadsheet paste in exactly like that. A point or a comma marks decimals, and a comma never separates the pair: “1.5 2” and “1,5 2” are both the pair 1.5 and 2. A line with one number or three the calculator does not read and names its number.

Can I leave labels on the lines?

Yes. Anything that comes before the numbers and holds no digits counts as a label. The line “January 10 20” is the pair 10 and 20. A line with three numbers is refused, though: otherwise the calculator would quietly take the last two and you would never notice that a column went missing.

Why is r sometimes zero even though the link shows on a chart?

Because r sees only a straight line. If the points lie on an arc, a parabola or any other curve, the link can be obvious while the coefficient is close to zero. A zero r means “no straight-line link”, not “no link”.

What does the message about identical values mean?

That one of the columns does not change – for example all X values equal 5. In the formula r is divided by the spread of both series, and the spread of a series that does not move is zero, so the coefficient is simply undefined. That is not zero and not a mistake in your data: for a number to appear, both columns need different values.

What about Spearman's and Kendall's coefficients?

Those are other coefficients, for ranks and non-monotonic data, and they are worked out by their own formulas. This calculator works out Pearson only and does not pretend to replace the others.

Rounding

r and r² are shown to four decimal places. Only the printed value is rounded: deviations and sums are divided in full, with no intermediate rounding. Deviations are worked out from the means, not through sums of squares, so large numbers close to each other – such as years or prices in dollars – do not lose precision.

Advertisement

Report a problem

This will be sent with your message: