Overview

Pearson's r measures how strongly two variables follow a straight-line relationship, from −1 to +1. This works it out from the covariance and the two standard deviations, and tests whether it's significant.

Enter the covariance, both standard deviations, the sample size and your alpha.

Worked examples

InputsResult
Covariance18Std Dev of X5.2Std Dev of Y6.1Sample Size (n)120Alpha (%)5Pearson r: 0.57t-statistic: 7.49p-value: <0.0001Statistically significant at alpha=5%
Show 2 more examples
Covariance-12Std Dev of X4Std Dev of Y5Sample Size (n)40Alpha (%)5Pearson r: -0.6t-statistic: -4.62p-value: <0.0001Statistically significant at alpha=5%
Covariance2Std Dev of X3Std Dev of Y4Sample Size (n)20Alpha (%)5Pearson r: 0.17t-statistic: 0.72p-value: 0.48Not statistically significant at alpha=5%

Pearson r by std dev of x

With the calculator's starting values, the pearson r is 0.57. The table shows how it changes with the std dev of x.

Std Dev of XPearson r
30.98
40.74
50.59
5.2starting value0.57
60.49
70.42

Other inputs: Covariance: 18 · Std Dev of Y: 6.1 · Sample Size: 120 n · Alpha: 5%. Change them in the calculator above for your own numbers.

How it works

r is the covariance divided by the product of the standard deviations. It's turned into a t statistic using the sample size, and the p-value comes from the t distribution with n − 2 degrees of freedom.

The formula

r = cov(X, Y) ÷ (s_X × s_Y)
tr × √((n − 2) ÷ (1 − r²))

Practical tips

  • A covariance of 18 with standard deviations of 5.2 and 6.1 gives r ≈ 0.57.
  • r² is the share of variation explained by the straight line, so r = 0.57 explains about 32%.
  • Correlation doesn't show cause and effect, and r can miss strong curved relationships.

Frequently asked questions

What is a strong correlation?

As a rough guide, about 0.1 is weak, 0.3 moderate and 0.5 or more strong, but it depends on the field.

Why does it say |r| ≥ 1 is impossible?

Valid inputs always give r between −1 and 1. Anything else means the inputs don't match.

Should the covariance and standard deviations be sample or population values?

Use the same kind for all three.