Hypothesis tests

Online calculator for hypothesis testing of the Pearson correlation coefficient

Test whether the sample correlation is compatible with a hypothesized value, using the t-test or Fisher's z transformation as appropriate.

Calculator

Enter the sample correlation r, the sample size, the null value ρ₀ and the significance level to get the test statistic, p-value, decision and confidence interval for ρ.

Result pending…

Explanation

The hypothesis test for the Pearson correlation lets you assess whether the population correlation \(\rho\) is compatible with a hypothesized value \(\rho_0\). The most common case is testing \(H_0\colon \rho = 0\) (no linear correlation), but it is also possible to test against any other value.

The choice of procedure depends on the null value: if \(\rho_0 = 0\) an exact t-test is used; if \(\rho_0 \neq 0\) Fisher's z transformation (arctanh) is used instead, which stabilizes the variance and produces an approximately normal statistic.

Hypotheses and statistics

\(H_0\colon \rho = \rho_0\)

When \(\rho_0 = 0\):

\( t = \dfrac{r\,\sqrt{n-2}}{\sqrt{1-r^2}}, \quad df = n-2 \)

When \(\rho_0 \neq 0\) (Fisher's z transformation):

\( z = \left(\operatorname{arctanh}(r) - \operatorname{arctanh}(\rho_0)\right)\cdot\sqrt{n-3} \)

The \(100(1-\alpha)\%\) confidence interval for \(\rho\) is always built using Fisher's transformation:

\( \hat{\rho}_{\text{lower}} = \tanh\!\left(\operatorname{arctanh}(r) - \dfrac{z_{\alpha/2}}{\sqrt{n-3}}\right) \)

\( \hat{\rho}_{\text{upper}} = \tanh\!\left(\operatorname{arctanh}(r) + \dfrac{z_{\alpha/2}}{\sqrt{n-3}}\right) \)

Quick interpretation guide

  • If the p-value is smaller than \(\alpha\), \(H_0\) is rejected: there is evidence that \(\rho \neq \rho_0\).
  • If the p-value is greater than or equal to \(\alpha\), the evidence is insufficient to reject \(H_0\).
  • With large samples, small correlations can be significant: always report the CI and \(r^2\) (coefficient of determination).
  • If the CI for \(\rho\) does not include \(\rho_0\), it agrees with rejecting \(H_0\) at level \(\alpha\).

Why Fisher's transformation?

The sampling distribution of \(r\) is skewed when \(\rho \neq 0\): the values of \(r\) are bounded within \([-1,1]\) and the distribution compresses near the extremes. Fisher showed in 1915 that \(\operatorname{arctanh}(r)\) has an approximately normal distribution with variance \(1/(n-3)\), regardless of the value of \(\rho\). This property makes the transformation essential for building confidence intervals and for testing \(H_0\colon \rho = \rho_0\) with \(\rho_0 \neq 0\).

Worked example

We have \(n = 30\) observations and obtain a sample correlation \(r = 0.45\). We test \(H_0\colon \rho = 0\) against \(H_1\colon \rho \neq 0\) with \(\alpha = 0.05\).

Since \(\rho_0 = 0\), the t-test is used with \(df = 28\):

\( t = \dfrac{0.45\,\sqrt{28}}{\sqrt{1 - 0.2025}} = \dfrac{0.45 \times 5.292}{\sqrt{0.7975}} \approx \dfrac{2.381}{0.893} \approx 2.667 \)

The two-tailed p-value is \(p \approx 0.012\). Since \(p = 0.012 < \alpha = 0.05\), \(H_0\) is rejected.

The 95% CI for \(\rho\) via Fisher's transformation is approximately \([0.11,\, 0.70]\), which does not include 0, confirming the test's decision.

How to interpret the result

Rejecting \(H_0\) (p-value < α) indicates that the sample correlation coefficient \(r\) is statistically incompatible with the hypothesized value \(\rho_0\). The most common case is \(\rho_0 = 0\): rejecting \(H_0\) means there is evidence of a linear association between the two variables. However, with large samples even very weak correlations (for example, \(r = 0.10\)) can be highly significant. The coefficient of determination \(r^2\) — which indicates what fraction of the variability of one variable is explained by the other — is the key metric for assessing practical relevance: an \(r^2 = 0.01\) means only 1% of the variance is shared, which may lack substantive importance.

Failing to reject \(H_0\) (p-value ≥ α) does not imply that \(\rho = \rho_0\); it only means the data are compatible with that value. With small samples the power is limited: moderate correlations (\(r \approx 0.3\)) may not turn out significant with fewer than 30–40 observations. Examine the confidence interval for \(\rho\): if it is wide, the uncertainty about the true correlation is large.

The t statistic (for \(\rho_0=0\)) or the Fisher z statistic (for \(\rho_0 \neq 0\)) is shown in the tool. In the chart, the green zone is the non-rejection region, the red zones are the critical regions, and the amber line marks the observed statistic. Remember that the test assumes a bivariate normal distribution and independence of pairs; against departures from normality with large \(n\) the test remains robust, but for small samples consider resampling methods.

Frequently asked questions

  • When should I use the t-test and when Fisher's z transformation? The t-test when \(\rho_0=0\); Fisher's z transformation when \(\rho_0 \neq 0\) because the distribution of r is not symmetric.
  • What assumptions does it require? Bivariate normal distribution, independence of observations and a linear relationship. Robust with large n.
  • How is the CI for ρ interpreted? It is built with the arctanh transformation and converted back to the original scale with tanh. If it does not include ρ₀, there is evidence of a difference.
  • Can a small r be significant? Yes, with large n. Always report r, its CI and r² to assess practical relevance.
  • Non-parametric alternative? Spearman's rank correlation or Kendall's tau when bivariate normality cannot be assumed.

Reference: Pearson correlation coefficient — Wikipedia