Overview

The Pearson correlation coefficient, r, measures how closely two variables follow a straight line, from −1 to 1. This works it out from the covariance and both 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. A t statistic with n − 2 degrees of freedom tests whether r differs from zero.

The formula

r = cov(X, Y) ÷ (s_X × s_Y)

Practical tips

  • A covariance of 18 with standard deviations of 5.2 and 6.1 gives r ≈ 0.57.
  • r² shows the share of variation explained, here about 32%.
  • Plot the data. Outliers or curves can make r misleading.

Frequently asked questions

Does correlation prove causation?

No. A third factor, or chance, can link two variables.

What is a strong correlation?

Roughly 0.5 or more in absolute value, though fields differ.

Can I calculate r from raw data?

In a spreadsheet, =CORREL(range1, range2).