Skip to main content

Correlation Coefficient Calculator

Our free correlation & regression calculator solves correlation coefficient problems. Get worked examples, visual aids, and downloadable results.

Reviewed by Daniel Agrici, Founder & Lead Developer

Reviewed by Daniel Agrici, Founder & Lead Developer

Formula

r = [n(Sum_XY) - (Sum_X)(Sum_Y)] / sqrt{[n(Sum_X2) - (Sum_X)2][n(Sum_Y2) - (Sum_Y)2]}

Pearson's r is computed by dividing the covariance of X and Y by the product of their standard deviations. The formula uses sums of products, sums of squares, and sample size n. R-squared = r squared. The regression line uses y = slope * x + intercept where slope = r * (Sy/Sx).

Worked Examples

Example 1: Study Hours vs. Test Score

Problem:Data: (1,50), (2,55), (3,65), (4,70), (5,75), (6,80), (7,85). Calculate the correlation.

Solution:Pearson r = 0.9934 (very strong positive)\nR-squared = 98.7% of score variance explained by hours\nRegression: Score = 5.89 × Hours + 44.29\nEach additional hour predicts ~5.9 more points.

Result:r = 0.993 | R2 = 98.7% | Very strong positive correlation

Example 2: Temperature vs. Ice Cream Sales

Problem:Data: (60,100), (65,120), (70,150), (75,200), (80,250), (85,300), (90,350).

Solution:r = 0.994 (very strong positive)\nR-squared = 98.8%\nRegression: Sales = 8.21 × Temp - 402.14\nEach degree increase predicts ~8 more units sold.

Result:r = 0.994 | R2 = 98.8% | Very strong positive

Frequently Asked Questions

What is Pearson's correlation coefficient (r)?

Pearson's r measures the strength and direction of the linear relationship between two continuous variables. It ranges from -1 to +1. A value of +1 indicates a perfect positive linear relationship, -1 indicates a perfect negative linear relationship, and 0 indicates no linear relationship. It only measures linear associations — two variables can have a strong non-linear relationship but a low Pearson r.

Does correlation imply causation?

No. Correlation measures association, not causation. Two variables can be correlated because: (1) X causes Y, (2) Y causes X, (3) a third variable causes both, or (4) it is a coincidence. Establishing causation requires controlled experiments, temporal ordering, ruling out confounders, and theoretical justification. Always be cautious about inferring causation from correlation alone.

What is the difference between correlation and causation?

Correlation measures the strength and direction of a linear relationship between two variables (r ranges from -1 to +1). Causation means one variable directly influences the other. Correlation alone cannot prove causation because confounding variables, reverse causality, or coincidence may explain the association.

References

Reviewed by Daniel Agrici, Founder & Lead Developer · Editorial policy