Pearson Correlation Calculator
Calculate Pearson correlation coefficient ($r = \frac{\sum (x - \bar{x})(y - \bar{y})}{\sqrt{\sum (x - \bar{x})^2 \sum (y - \bar{y})^2}}$), coefficient of determination ($R^2$), $t$-statistic, and $p$-value.
Calculate Pearson Product-Moment Correlation
Enter numerical X values and corresponding Y values separated by commas.
Calculation Results
Calculated using Pearson product-moment formula: r = \frac{\text{Cov}(X,Y)}{s_X s_Y} = \frac{\sum (x - \bar{x})(y - \bar{y})}{\sqrt{\sum (x - \bar{x})^2 \sum (y - \bar{y})^2}}
Quick Summary
The Pearson Correlation Calculator evaluates linear association strength ($r$), coefficient of determination ($R^2$), $t$-statistic ($t = r\sqrt{\frac{n-2}{1-r^2}}$), and two-tailed $p$-value.
Formula Explanation
r = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum (x_i - \bar{x})^2 \sum (y_i - \bar{y})^2}}
t = r \sqrt{\frac{n - 2}{1 - r^2}}, \quad R^2 = r^2How It Works
Pearson's $r$ quantifies how strongly two continuous variables move together in a linear pattern. The Pearson Correlation Calculator normalizes covariance by dividing by the product of sample standard deviations $s_X$ and $s_Y$.
Step-by-Step Worked Example
Practical Problem: Calculate Pearson $r$ for datasets $X = \{1, 2, 3, 4, 5\}$ and $Y = \{2, 4, 5, 4, 5\}$.
- Step 1: Calculate means ($\bar{x}, \bar{y}$): $\bar{x} = 15/5 = \mathbf{3.0}$, $\bar{y} = 20/5 = \mathbf{4.0}$.
- Step 2: Calculate sum of squares $SS_{XX}$ and $SS_{YY}$: $SS_{XX} = (-2)^2 + (-1)^2 + 0^2 + 1^2 + 2^2 = \mathbf{10.0}$; $SS_{YY} = (-2)^2 + 0^2 + 1^2 + 0^2 + 1^2 = \mathbf{6.0}$.
- Step 3: Calculate sum of cross-products $SS_{XY}$: $(-2)(-2) + (-1)(0) + (0)(1) + (1)(0) + (2)(1) = 4 + 0 + 0 + 0 + 2 = \mathbf{6.0}$.
- Step 4: Compute Pearson r: $r = 6.0 / \sqrt{10.0 \times 6.0} = 6.0 / \sqrt{60} = 6.0 / 7.7460 = \mathbf{+0.7746}$.
- Step 5: Compute R² & Significance: $R^2 = (0.7746)^2 = \mathbf{0.6000\text{ (60\% variance shared)}};$ $t = 0.7746 \sqrt{3 / 0.40} = \mathbf{2.1213}$ ($p = 0.1241$).
Real-World Calculation Examples
Scenario 1: Height vs Weight Correlation
Parameters: X = Height, Y = Weight
Result: r = +0.85 (Strong positive linear correlation).
Scenario 2: Study Hours vs Test Exam Score
Parameters: X = Hours studied, Y = Score
Result: r = +0.92 ($R^2 = 84.6\%$).
Scenario 3: Car Age vs Resale Market Value
Parameters: X = Vehicle Age, Y = Price
Result: r = -0.88 (Strong negative correlation).
Scenario 4: Shoe Size vs IQ Score
Parameters: Unrelated variables
Result: r = +0.02 (No linear correlation).
Key Benefits of Using This Calculator
Complete Linear Association Output
Outputs correlation coefficient $r$, $R^2$, sample covariance, and $t$-test $p$-value.
Qualitative Strength Rating
Automatically classifies correlation strength (Very Strong, Strong, Moderate, Weak).
Statistical Significance Testing
Tests null hypothesis $H_0: \rho = 0$ using Student's $t$-distribution.
100% Free & Client-Side
Executes locally in your browser with zero latency or web server transmission.
Frequently Asked Questions (FAQ)
What is Pearson correlation coefficient ($r$)?
Pearson's $r$ measures the linear relationship strength and direction between two continuous variables, ranging from $-1.0$ to $+1.0$.
What is the difference between correlation and causation?
Correlation indicates that two variables change together, but does NOT prove that one variable causes the other to change.
What does $r = 0$ mean?
$r = 0$ indicates zero LINEAR relationship (though a non-linear quadratic or curvilinear relationship may still exist).
How do I calculate Pearson correlation in Excel?
Use formula =CORREL(array1, array2) or =PEARSON(array1, array2).
What assumptions are required for Pearson correlation?
1. Continuous interval/ratio data. 2. Linear relationship. 3. Bivariate normality. 4. Absence of extreme outliers.
What is coefficient of determination ($R^2$)?
$R^2 = r^2$ represents the proportion of variance in $Y$ that is predictable from $X$.
When should I use Spearman rank correlation instead of Pearson?
Use Spearman rank correlation when data is ordinal/ranked or non-linear monotonic, or contains strong outliers.
How does an outlier affect Pearson $r$?
A single extreme outlier can artificially inflate or attenuate Pearson $r$ significantly.
What is Fisher's Z transformation?
Fisher's Z transformation converts $r$ into a normal variable $z' = \frac{1}{2}\ln\left(\frac{1+r}{1-r}\right)$ to construct confidence intervals for correlation.
What is spurious correlation?
A spurious correlation occurs when two unlinked variables appear correlated due to coincidental trends or a confounding third variable.