Correlation Coefficient Calculator
Our free correlation & regression calculator solves correlation coefficient problems. Get worked examples, visual aids, and downloadable results.
Reviewed for accuracy by Daniel Agrici, Founder & Lead Developer
Correlation Coefficient Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: r = [n(Sum_XY) - (Sum_X)(Sum_Y)] / sqrt{[n(Sum_X2) - (Sum_X)2][n(Sum_Y2) - (Sum_Y)2]}
Worked example โ r = 0.993 | R2 = 98.7% | Very strong positive correlation
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) R-squared = 98.7% of score variance explained by hours Regression: Score = 5.89 ร Hours + 44.29 Each 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) R-squared = 98.8% Regression: Sales = 8.21 ร Temp - 402.14 Each 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.
What is R-squared and how do I interpret it?
R-squared (R2) is the square of the correlation coefficient. It represents the proportion of variance in the dependent variable that is explained by the independent variable. For example, r = 0.8 gives R2 = 0.64, meaning 64% of the variance in Y is explained by X. The remaining 36% is unexplained. R2 always ranges from 0 to 1 (or 0% to 100%).
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 for accuracy by Daniel Agrici, Founder & Lead Developer ยท Editorial policy
Related Calculators
๐งฎDescriptive Statistics Calculator
Calculate descriptive statistics with inputs, formulas, and instant results.
๐งฎBayesian Posterior Calculator
Calculate bayesian posterior with inputs, formulas, and instant results.
๐งฎFalse Discovery Rate Calculator
Calculate false discovery rate with inputs, formulas, and instant results.
๐งฎBinomial Distribution Calculator
Calculate binomial distribution with inputs, formulas, and instant results.
๐งฎChi Square Test Calculator
Calculate chi square test with inputs, formulas, and instant results.
๐งฎZtest Proportions Calculator
Calculate ztest proportions with inputs, formulas, and instant results.
๐งฎEffect Size Calculator
Calculate effect size with inputs, formulas, and instant results.
๐งฎPower Analysis Calculator
Calculate power analysis with inputs, formulas, and instant results.