Compute Pearson's r, coefficient of determination (R²), linear regression equation, and p-value. Visualize data with interactive scatter plot and line of best fit.
The Pearson correlation coefficient (r) measures the strength and direction of the linear relationship between two continuous variables. r ranges from -1 to +1: +1 perfect positive, 0 no linear correlation, -1 perfect negative. Formula: covariance divided by product of standard deviations.
This tool also provides R² (proportion of variance explained), p-value (testing H₀: r=0), and the ordinary least squares regression line. A low p-value (<0.05) indicates a statistically significant linear association.
Algorithm: (1) parse numeric arrays, (2) compute means, sums of squares and cross-products, (3) derive Pearson r, (4) slope = Cov(X,Y)/Var(X) and intercept = ȳ - slope·x̄, (5) p-value using t-distribution with df = n-2: t = r·√((n-2)/(1-r²)). All results rounded to 4 decimals.
Researcher collects n=10: study hours (X) and final scores (Y). Using this calculator: r = 0.85, R² = 0.72, p = 0.002 → strong positive correlation, 72% variance explained, significant. Scatter plot shows clear upward trend.
| Correlation strength | |r| range | Interpretation |
|---|---|---|
| Perfect | = 1.0 | Exact linear relationship |
| Strong | 0.7 – 0.9 | Clear linear trend |
| Moderate | 0.4 – 0.69 | Noticeable association |
| Weak | 0.1 – 0.39 | Slight linear relationship |
| Negligible | 0 – 0.1 | No linear correlation |
? Authoritative basis: This tool implements standard formulas (Pearson, 1895; Fisher, 1915) and is validated against R cor.test and SciPy outputs. Reviewed by GetZenQuery tech team — updated June 2026.
References: NIST/SEMATECH e-Handbook, Statistics by Freedman, Pisani, Purves.