Correlation Coefficient Calculator
Calculate Pearson's r, Spearman's ρ, R², p-value, and linear regression with interactive scatter plot. Supports CSV paste and manual data entry.
| # | X | Y |
|---|
About
Misidentifying the strength or direction of a relationship between two variables leads to flawed models, incorrect predictions, and costly decisions. The Pearson correlation coefficient r quantifies the linear dependence between paired observations X and Y, bounded on [−1, +1]. A value of 0 does not imply independence - only the absence of a linear trend. This calculator computes both Pearson's r and Spearman's ρ (rank-based, robust to monotonic non-linear relationships), along with the coefficient of determination R2, two-tailed p-value via the t-distribution, and ordinary least-squares regression parameters. Results assume continuous data free of significant outliers. Spearman's ρ is preferred when normality assumptions fail or ordinal scales are used.
Formulas
Pearson product-moment correlation coefficient:
Spearman rank correlation uses the same formula applied to rank-transformed data. When no ties exist, the shortcut applies:
Statistical significance via the t-test:
with n − 2 degrees of freedom. Linear regression line of best fit:
where b = r ⋅ sysx is the slope and a = − b ⋅ is the intercept. R2 = r2 gives the proportion of variance in Y explained by X.
Reference Data
| r Range | Strength | Interpretation | Typical Use Case |
|---|---|---|---|
| 0.90 - 1.00 | Very Strong Positive | Near-perfect linear increase | Calibration curves, repeated measures |
| 0.70 - 0.89 | Strong Positive | Clear upward trend | Height vs. weight, income vs. spending |
| 0.40 - 0.69 | Moderate Positive | Noticeable but scattered | Study hours vs. exam score |
| 0.20 - 0.39 | Weak Positive | Slight upward tendency | Age vs. reaction time |
| −0.19 - 0.19 | Negligible | No meaningful linear pattern | Shoe size vs. IQ |
| −0.39 - −0.20 | Weak Negative | Slight downward tendency | Exercise vs. resting heart rate |
| −0.69 - −0.40 | Moderate Negative | Noticeable inverse trend | Price vs. demand (normal goods) |
| −0.89 - −0.70 | Strong Negative | Clear downward trend | Altitude vs. air pressure |
| −1.00 - −0.90 | Very Strong Negative | Near-perfect linear decrease | Distance vs. gravitational force (approx) |
| Critical r values for two-tailed test at α = 0.05 | |||
| n = 5 | 0.878 | n = 20 | 0.444 |
| n = 10 | 0.632 | n = 30 | 0.361 |
| n = 15 | 0.514 | n = 50 | 0.279 |
| n = 100 | 0.197 | n = 500 | 0.088 |