Pearson Correlation Coefficient
Print PageA Correlation Coefficient Calculator (also known as a Pearson Product-Moment Correlation [r] Calculator, Spearman Rank Correlation [ρ] Utility, Coefficient of Determination [r2] Generator, or Bivariate Covariance Analyzer) computes exact Pearson correlation coefficients (r = [ n ∑ xy - ∑ x ∑ y ] ÷ √[ ( n ∑ x2 - (∑ x)2 ) · ( n ∑ y2 - (∑ y)2 ) ]), Spearman rank correlation (ρ = 1 - [ ( 6 ∑ di2 ) ÷ ( n · (n2 - 1) ) ]), sample covariance (sxy), coefficient of determination (r2), t-statistic significance test (t = ( r · √[n - 2] ) ÷ √[1 - r2]), and p-values.
In financial portfolio diversification, medical epidemiological studies, machine learning feature selection, and educational testing, the **correlation coefficient** measures the strength and direction of a linear relationship between two continuous variables on a scale from -1.00 (perfect negative correlation) to +1.00 (perfect positive correlation).
Our free online Correlation Coefficient Calculator provides instant calculations across all bivariate correlation models:
- Pearson Product-Moment Correlation (r):
r = ∑ [ (xi - X̄)(yi - Ȳ) ] ÷ √[ ∑ (xi - X̄)2 · ∑ (yi - Ȳ)2 ]. - Spearman Rank Correlation (ρ / rs):
ρ = 1 - [ ( 6 · ∑ di2 ) ÷ ( n · ( n2 - 1 ) ) ](wherediis rank difference). - Coefficient of Determination (r2 Percentage):
r2 = (r)2 · 100%(Proportion of variance in Y explained by X). - Sample Covariance (sxy):
sxy = ∑ [ (xi - X̄)(yi - Ȳ) ] ÷ ( n - 1 ). - t-Test for Correlation Significance:
t = ( r · √[ n - 2 ] ) ÷ √[ 1 - r2 ](df = n – 2). - Correlation Magnitude Scale:
0.90 ≤ |r| ≤ 1.00: Very Strong Correlation.0.70 ≤ |r| < 0.90: Strong Correlation.0.50 ≤ |r| < 0.70: Moderate Correlation.0.30 ≤ |r| < 0.50: Weak Correlation.0.00 ≤ |r| < 0.30: Negligible / No Linear Relationship.
Master Correlation Reference Table (Student Study Hours vs. Final Exam Score: n = 5 Students)
The table below displays study hours (x), exam scores (y), deviations from means, products, and squared sums for 5 students (n = 5 Students, X̄ = 6.0 hours, Ȳ = 77.0 points):
| Student ID | Study Hours (x) | Exam Score (y) | x Deviation (x – 6.0) | y Deviation (y – 77.0) | Product Term (x – X̄)(y – Ȳ) |
|---|---|---|---|---|---|
| Student 1 | 2.0 hours | 60.0 points | -4.0 | -17.0 | +68.0 |
| Student 2 | 4.0 hours | 70.0 points | -2.0 | -7.0 | +14.0 |
| Student 3 (Mean Center) | 6.0 hours (X̄) | 80.0 points | 0.0 | +3.0 | 0.0 |
| Student 4 | 8.0 hours | 85.0 points | +2.0 | +8.0 | +16.0 |
| Student 5 | 10.0 hours | 95.0 points | +4.0 | +18.0 | +72.0 |
| SUMMATIONS (∑) | ∑x = 30.0 | ∑y = 385.0 | ∑(x-X̄)2 = 40.0 | ∑(y-Ȳ)2 = 680.0 | ∑Product = +170.0 |
Step-by-Step Study Hours vs. Exam Score Correlation Calculation
To calculate Pearson r, coefficient of determination r2, and t-test significance for the 5 students:
Step 1 (Calculate Sample Means): X̄ = 30.0 ÷ 5 = 6.0 hours, Ȳ = 385.0 ÷ 5 = 77.0 points
Step 2 (Calculate Sum of Product Deviations): ∑(x - X̄)(y - Ȳ) = 68.0 + 14.0 + 0.0 + 16.0 + 72.0 = +170.0
Step 3 (Calculate Squared Deviations): ∑(x - X̄)^2 = 16 + 4 + 0 + 4 + 16 = 40.0; ∑(y - Ȳ)^2 = 289 + 49 + 9 + 64 + 324 = 680.0
Step 4 (Calculate Pearson r): r = 170.0 ÷ √[ 40.0 · 680.0 ] = 170.0 ÷ √27,200 = 170.0 ÷ 164.924 = 0.99439 ≈ +0.994
Step 5 (Calculate R-Squared r^2): r^2 = (0.99439)^2 = 0.9888 ≈ 98.88% (98.88% of score variance explained by study hours)
Step 6 (Calculate t-Test Statistic for df = 3): t = (0.99439 · √3) ÷ √[1 - 0.9888] = 1.72233 ÷ 0.10583 = 16.275 (p = 0.0005 < 0.01 Statistically Significant)
Thus, study hours demonstrate a very strong positive correlation (r = +0.994, p = 0.0005) with exam scores, explaining 98.88% of score variance.
Correlation Metrics Comparison: Pearson r vs. Spearman Rho vs. Kendall Tau vs. R-Squared
Below is a comparative reference chart detailing when to use Pearson correlation versus alternative coefficient measures:
| Correlation Metric | Data Type Requirement | Relationship Type Evaluated | Primary Practical Application |
|---|---|---|---|
| Pearson Product-Moment (r) | Continuous Interval / Ratio Data | Linear (Straight-line) relationships | Parametric statistics & linear regression modeling. |
| Spearman Rank Correlation (ρ) | Ordinal Ranks or Non-Normal Continuous | Monotonic (Consistently increasing/decreasing) | Non-parametric survey rankings & skewed data. |
| Kendall Rank Tau (τ) | Ordinal Ranks (Small Sample Sizes) | Concordant vs Discordant Pairs | Small rank samples & tied rank handling. |
| Coefficient of Determination (r2) | Continuous Model Variance | Proportion of Shared Variance | Evaluating regression goodness-of-fit. |
History & Mathematics: 1888 Francis Galton to 1896 Karl Pearson & 1904 Charles Spearman
1888 Sir Francis Galton & Co-relation
In 1888, English polymath Sir Francis Galton published Co-relations and Their Measurement, Chiefly from Anthropometric Data in the Proceedings of the Royal Society of London, introducing the concept of mathematical correlation.
1896 Karl Pearson & 1904 Charles Spearman
In 1896, Karl Pearson derived the product-moment correlation formula r, while Charles Spearman published his non-parametric rank correlation ρ in 1904 in the American Journal of Psychology.
Popular direct tools:
Frequently Asked Questions (FAQ)
What is the formula for the Pearson Correlation Coefficient (r)?
The formula is r = ∑ [ (xi - X̄)(yi - Ȳ) ] ÷ √[ ∑ (xi - X̄)2 · ∑ (yi - Ȳ)2 ].
What does an R-Squared (r2) value mean?
R-Squared (r2) represents the percentage of variance in the dependent variable Y that is predictable from the independent variable X (e.g. r = 0.90 &implies; r2 = 0.81 = 81% explained variance).
Does correlation imply causation?
No. Correlation measures the mathematical association between two variables, but correlation does NOT prove causation due to potential confounding third variables or reverse causality.