Pearson Correlation (r, R^2, significance)
Pearson r and R^2 for paired x / y series.
Example
You enter
- X values (comma or whitespace separated) 1, 2, 3, 4, 5
- Y values (same count, paired with X) 2, 4, 5, 4, 5
- Significance level (alpha) 0.05
You get
- Correlation r 0.774597
- R² (coefficient of determination) 0.6
- Degrees of freedom 3
- t statistic 2.12132
Details, formula, and sources
With the t-test (t = r sqrt(n-2) / sqrt(1-r^2), n-2 df) and the two-tailed p-value from the Student-t CDF. Per OpenIntro Statistics Ch. 8.
Pearson r = sum((x - xbar)(y - ybar)) / sqrt(sum(x - xbar)^2 * sum(y - ybar)^2). R^2 = r^2. Significance test for rho = 0: t = r * sqrt(n - 2) / sqrt(1 - r^2) on n - 2 degrees of freedom; two-tailed p = 2 * (1 - tcdf(|t|, n - 2)).
OpenIntro Statistics 4th ed. Chapter 8 (introduction to linear regression) by name; the Student-t CDF via the regularized incomplete beta function per Numerical Recipes in C 2nd ed. §6.4.
OpenIntro Statistics free at openintro.org; Numerical Recipes chapters free at numerical.recipes.
Estimate only. Readability formulas and similar metrics are derived from a representative population and have known edge-case noise. The classroom teacher governs final text selection, grade placement, and assessment decisions.
Field names used by the API: x_values, y_values, alpha, r, r2, df, t
- Degrees of freedom n - 2 (two parameters estimated)Student-t test for a correlation coefficient
- Two-tailed p-value 2 * (1 - tcdf(|t|, n - 2))OpenIntro Statistics Ch. 8
- Student-t CDF derived from the regularized incomplete beta function I_x(df/2, 1/2)Numerical Recipes 6.4