How to use this calculator
- Enter or choose x values.
- Enter or choose y values (same order).
- Enter or choose alternative hypothesis.
- Enter or choose confidence level for r.
- The pearson’s r updates as you type. Use Copy result or Share to keep it.
Method
r = Sxy ÷ √(Sxx·Syy); t = r·√((n − 2) ÷ (1 − r²)) with n − 2 df; CI = tanh(atanh r ± z* ÷ √(n − 3))
- Sxy
- Σ(x − x̄)(y − ȳ)
- Sxx, Syy
- sums of squared deviations of x and y
- n
- number of pairs
- z*
- two-sided standard normal critical value
Worked example
- x̄ = 3, ȳ = 4. Sxy = 6, Sxx = 10, Syy = 6.
- r = 6 ÷ √(10 × 6) = 0.7746, so r² = 0.6.
- t = 0.7746 × √(3 ÷ 0.4) = 2.121 with 3 df: two-sided p = 0.124.
The five pairs have r = 0.77, a fairly strong positive association, but with so few points it is not significant at 5% (p = 0.12).
What the result means
r describes linear association only: a strong curved relation can give r near 0, and a single outlier can create or hide a correlation, so always look at a scatter plot. Correlation does not show which variable causes the other, or whether a third factor drives both.
Assumptions and limits
- Pairs are independent observations.
- For the p-value and interval: x and y are roughly bivariate normal (or n is large).
- The p-value is for the null hypothesis ρ = 0, with the sidedness you choose.
- The Fisher z interval needs at least 4 pairs and is approximate for small n.
- For ranked or strongly non-normal data, use Spearman’s rank correlation.
Questions
What counts as a strong correlation?
It depends on the field. As a rough guide, |r| around 0.1 is small, 0.3 moderate and 0.5 or more large, but a scatter plot says more than any label.
Why do r and the regression slope have the same p-value?
With one predictor, the test of zero correlation and the test of zero slope are the same t test.