Advertisement

Pearson correlation calculator

Measure linear association in original numeric values. Use paired lists or mutually consistent covariance and standard-deviation summaries.

Calculator

Use commas, spaces or new lines between numbers. Use the same unit for every observation.

Use commas, spaces or new lines between numbers. Use the same unit for every observation.

Pearson correlation r
0.981981
R squared for a line with intercept
0.964286
Pair count
3.000000
Mean x
2.000000
Mean y
3.666667
Centred calculation
xyx - meanXy - meanYCross-product
1.0000002.000000-1.000000-1.6666671.666667
2.0000004.0000000.0000000.3333330.000000
3.0000005.0000001.0000001.3333331.333333

Advertisement

How this calculator works

Pearson correlation divides the centred cross-product total by the geometric mean of the two squared-deviation totals. Sample or population divisors cancel when all summaries use the same convention. A value near +1 indicates an increasing straight-line relationship and a value near -1 a decreasing one. Constant variables have no defined correlation. Summary inputs must respect the covariance bound |Cov| ≤ SDx × SDy.

Formula

r = Σ((x - meanX)(y - meanY))/sqrt(Σ(x - meanX)² Σ(y - meanY)²) = Cov(x,y)/(SDx × SDy).

Worked example

For x = 1, 2, 3 and y = 2, 4, 5, the cross-product total is 3 and the squared totals are 2 and 14/3. Thus r = sqrt(27/28) ≈ 0.981981.

Advertisement

Frequently asked questions

Does r squared always describe explained variation?

It equals regression R squared for ordinary simple linear regression with an intercept on these pairs. Other model settings may differ.

Is Pearson suitable for curved trends?

It describes linear association. A strong curved pattern can have a small coefficient; inspect a scatter plot.

Why do summary inputs sometimes fail?

Mixing sample covariance with population standard deviations, different data sets or inconsistent rounding can violate the correlation bound.

Sources

Advertisement