Pearson Correlation Calculators
0 calculators tagged with “Pearson Correlation”
All Calculators
No calculators found for this topic.
Pearson r Formula
r = Σ[(xᵢ − x̄)(yᵢ − ȳ)] / √[Σ(xᵢ − x̄)² × Σ(yᵢ − ȳ)²]
Or equivalently: r = COV(X,Y) / (SD_X × SD_Y).
r² (coefficient of determination): proportion of variance in Y explained by X (and vice versa).
Interpretation of r
- |r| = 1.0: perfect linear relationship
- |r| = 0.9–1.0: very strong
- |r| = 0.7–0.9: strong
- |r| = 0.5–0.7: moderate
- |r| = 0.3–0.5: weak
- |r| < 0.3: very weak or no linear relationship
Significance Testing
t-test: t = r × √(n−2) / √(1−r²); df = n − 2. Example: r = 0.65, n = 30: t = 0.65 × √28 / √(1−0.4225) = 0.65 × 5.292 / 0.760 = 4.53; p < 0.001.
Assumptions
Both variables measured on interval/ratio scale. Both variables approximately normally distributed (Shapiro-Wilk test). Linear relationship (check scatter plot). No significant outliers (leverage points can distort r dramatically). Homoscedasticity (variance in Y consistent across X values).
Pearson vs. Spearman
Use Spearman (rho) when: data are ordinal; distributions are non-normal; relationship is monotonic but not linear; outliers are present (Spearman is more robust). Use Pearson when: data are normally distributed continuous variables; relationship appears linear on scatter plot.
Glossary
Frequently Asked Questions
Pearson r measures the strength and direction of the linear relationship between two continuous variables. Range: −1 to +1. r = +1: perfect positive linear relationship (both variables increase together). r = −1: perfect negative linear relationship. r = 0: no linear relationship (but non-linear relationship may still exist). Conventional interpretation: r > 0.7 = strong; 0.5–0.7 = moderate; 0.3–0.5 = weak; < 0.3 = negligible. r² = proportion of variance in one variable explained by the other. Example: r = 0.70 → r² = 0.49 → 49% of the variance in Y is 'explained' by X (same for X by Y). Important: correlation does not imply causation.
H₀: ρ = 0 (no linear correlation in the population). Test statistic: t = r√(n−2)/√(1−r²), with df = n−2. Compare to t-distribution to get p-value. Example: r = 0.55, n = 25 (df=23): t = 0.55 × √23 / √(1−0.3025) = 0.55 × 4.796 / 0.835 = 3.16. From t-table: p ≈ 0.004 → significant. R: cor.test(x, y, method='pearson'). Python: scipy.stats.pearsonr(x, y) → returns r and p-value. Rule of thumb: with small n, even large r values may not be statistically significant; with very large n, even tiny r values are statistically significant but may not be practically meaningful.
Pearson r: assumes linearity and normal distribution; uses raw values of both variables; sensitive to outliers; appropriate for continuous, normally distributed data. Spearman's rho (ρ): non-parametric; converts data to ranks, then calculates Pearson r on the ranks; does not assume normality or linearity — only monotonic relationship; robust to outliers; appropriate for: ordinal data (Likert scales, ranks); non-normal distributions; data with outliers; relationships that are monotonic but not linear. When to use Spearman: one or both variables are clearly non-normal (Shapiro-Wilk p < 0.05); scatter plot shows non-linear but monotonic pattern; outliers are present and cannot be removed. In practice: run Pearson and Spearman — if results differ substantially, Spearman is usually more appropriate.
r² (= r × r) = the proportion of variance in one variable that is linearly associated with (explained by) the other variable. Example: r = 0.80 → r² = 0.64 → 64% of the variability in Y is associated with variability in X. The remaining 36% is explained by other factors not measured. Context matters for interpretation: in physics (controlled experiments): r² > 0.99 expected. In biology (field studies): r² = 0.5–0.7 = strong. In social sciences: r² = 0.1–0.3 may be meaningful. r² = 0.25 may be 'only 25% of variance explained' — but for predicting human behavior or complex biological systems, explaining 25% of variance is often a substantial achievement. r² is used in simple linear regression: it equals the proportion of total sum of squares explained by the regression model (SSreg/SStotal).