Parameters
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 ρ.
Pearson correlation coefficient calculated on your sample, between -1 and 1.
Number of pairs of observations (x, y) used to calculate r. n ≥ 4 is required.
Population correlation value under H₀. The usual choice is 0 (no correlation), which activates the t test; with any other value Fisher's z transformation is used.
Risk of rejecting H₀ when it is true. The usual value is 0.05, equivalent to a 95% CI for ρ.
Two-tailed tests ρ ≠ ρ₀; the one-tailed options test whether ρ is specifically greater or smaller than ρ₀.
Rejection regions and observed statistic
What is a hypothesis test for Pearson's correlation?
It is the procedure for deciding whether the linear relationship between two quantitative variables, observed in a sample, really exists in the population or could be due to chance. Pearson's correlation coefficient \(r\) measures that relationship on a scale from −1 to 1: 0 means no linear relationship, positive values mean the two variables increase together, and negative values mean one falls as the other rises. Is height related to weight? Study hours to grades? Advertising spend to sales?
With little data, it is easy to get correlations of 0.3 or 0.4 between variables that have nothing to do with each other. The test answers the question: if the true correlation \(\rho\) were 0, would it be unusual to observe an \(r\) like mine with this sample size?
Hypotheses and test statistics
\(H_0: \rho = \rho_0\)
\(H_1: \rho \neq \rho_0\), \(\rho > \rho_0\) or \(\rho < \rho_0\)
The most common case is testing \(\rho_0 = 0\) ("no correlation"). A t statistic is used:
\( t = \dfrac{r\,\sqrt{n-2}}{\sqrt{1-r^2}}, \quad df = n - 2 \)
If the null hypothesis states another value (\(\rho_0 \neq 0\); for example, "the correlation is at least 0.5"), the distribution of \(r\) is no longer symmetric and Fisher's z transformation is used:
\( z_r = \tfrac{1}{2}\ln\dfrac{1+r}{1-r} = \operatorname{arctanh}(r), \qquad z = (z_r - z_{\rho_0})\,\sqrt{n-3} \)
The transformation turns \(r\), whose distribution is squeezed near ±1, into an approximately normal quantity with standard error \(1/\sqrt{n-3}\), whatever the true correlation. It is also used to compute the confidence interval for \(\rho\), which the calculator shows in the details and which is therefore not symmetric around \(r\).
Decision rule
- If the p-value is less than \(\alpha\), \(H_0\) is rejected: there is evidence that the correlation differs from \(\rho_0\).
- If the p-value is greater than or equal to \(\alpha\), there is not enough evidence to reject \(H_0\).
- Not rejecting \(\rho = 0\) does not prove that the variables are independent.
Significant does not mean strong
The test only says whether the correlation can be distinguished from \(\rho_0\); it does not say whether it is large. With large samples, tiny correlations are significant, and with small samples, sizeable correlations are not:
| Sample size | Smallest significant |r| (two-tailed, \(\alpha = 0.05\)) |
|---|---|
| \(n = 10\) | 0.63 |
| \(n = 30\) | 0.36 |
| \(n = 100\) | 0.20 |
| \(n = 1000\) | 0.06 |
To judge magnitude, use \(r\) itself and the coefficient of determination \(r^2\), the proportion of the variability of one variable that is linearly explained by the other. A correlation of 0.3 explains only 9%. As a rough guide (Cohen), |r| around 0.1 is a weak correlation, 0.3 moderate and 0.5 strong, although what counts as "strong" depends heavily on the field.
Assumptions of the test
- Two quantitative variables measured on the same individuals (paired data).
- Independent observations: each pair of values comes from a different individual.
- A linear relationship: \(r\) only measures the linear part of the relationship. A very strong curved relationship can give \(r\) close to 0.
- Approximate normality of both variables (bivariate normality), especially with small samples.
- No influential outliers: a single extreme point can create or destroy a correlation.
Before computing anything, draw the scatter plot: it is the only way to see whether the relationship is linear and whether there are anomalous points. If the relationship is monotonic but not linear, or there are outliers, the alternative is Spearman's rank correlation.
Worked example 1: is there a correlation?
In a sample of \(n = 30\) students, the correlation between study hours and grade is \(r = 0.45\). We test \(H_0\colon \rho = 0\) against \(H_1\colon \rho \neq 0\) with \(\alpha = 0.05\).
\( t = \dfrac{0.45\,\sqrt{28}}{\sqrt{1 - 0.45^2}} = \dfrac{2.381}{0.893} \approx 2.666 \)
With 28 degrees of freedom, the two-tailed critical value is 2.048 and the p-value is \(p \approx 0.013\). \(H_0\) is rejected: there is evidence of a positive linear correlation.
How strong? The 95% confidence interval for \(\rho\) runs from 0.11 to 0.70: the true correlation could be weak or strong. And \(r^2 = 0.20\): study hours explain around 20% of the variability in grades in this sample. With 30 students, the test detects with 80% probability only correlations of ±0.49 or stronger.
In the calculator: r = 0.45, n = 30, ρ₀ = 0 and "Two-tailed (≠)". These are the values the page opens with.
Worked example 2: testing a value other than zero
A psychological test is considered acceptable if its correlation with the reference test exceeds 0.5. In a sample of \(n = 50\) people, \(r = 0.72\) is obtained. We test \(H_0\colon \rho = 0.5\) against \(H_1\colon \rho > 0.5\) with \(\alpha = 0.05\). Since \(\rho_0 \neq 0\), Fisher's z is used:
\( z_r = \operatorname{arctanh}(0.72) \approx 0.908, \quad z_{\rho_0} = \operatorname{arctanh}(0.5) \approx 0.549, \quad z = (0.908 - 0.549)\sqrt{47} \approx 2.46 \)
The right-tailed p-value is \(p \approx 0.007\): \(H_0\) is rejected. There is evidence that the correlation exceeds 0.5; the 95% interval for \(\rho\) runs from 0.55 to 0.83.
In the calculator: r = 0.72, n = 50, ρ₀ = 0.5 and "Right tail (>)".
Example 3: significant but irrelevant
With \(n = 1000\) and \(r = 0.10\), the test of \(\rho = 0\) gives \(t \approx 3.18\) and \(p \approx 0.0015\): highly significant. But \(r^2 = 0.01\): one variable explains 1% of the other. The correlation exists, and it is practically useless for prediction.
How to interpret the result
Rejecting \(H_0\) (p-value < α) with \(\rho_0 = 0\) indicates that there is a linear relationship between the variables, and the sign of \(r\) gives its direction. It does not indicate that one causes the other: both may depend on a third variable. Always judge the magnitude with \(r\), \(r^2\) and the confidence interval.
Not rejecting \(H_0\) does not prove that there is no relationship: it may be weak, it may be non-linear, or the sample may be small.
In the calculator, the result shows the decision with the p-value, the correlation with its rough label (weak, moderate or strong), the statistic and a sentence stating the conclusion. On the chart, the green area is the non-rejection region, the red areas are the critical regions and the amber line marks the statistic. Under "Calculation details" you will find \(r^2\), the critical value and Fisher's confidence interval for \(\rho\).
Power and minimum detectable correlation
Below the conclusion, the calculator shows the minimum detectable correlation: the weakest true correlation that, with your sample size, the test would detect with 80% probability. If it is stronger than the correlation that would matter to you, a non-significant result says little. When you test \(\rho_0 = 0\), the link opens the sample size calculator for correlation with your α and the type of test. For reference, detecting a correlation of 0.3 takes about 85 pairs of observations; one of 0.1, about 780.
Common mistakes
- Confusing correlation with causation.
- Confusing significant with strong: with large samples, almost any correlation is significant.
- Not looking at the scatter plot: a high \(r\) may be due to a single point, and a null \(r\) may hide a curved relationship.
- Concluding that there is no relationship because \(r\) is not significant.
- Extrapolating the relationship beyond the observed range of values.
- Computing many correlations between many variables and keeping the significant ones: 1 in 20 will be so by chance.
Frequently asked questions
- What does it test? Whether the linear correlation between two variables in the population equals a value ρ₀, usually 0, based on the correlation r observed in a sample.
- When is t used and when Fisher's z? The t statistic, when the null hypothesis is ρ = 0. Fisher's z transformation, when testing another value of ρ and for the confidence interval.
- Is a significant correlation a strong correlation? No. Significant means distinguishable from zero. With 1000 observations, a correlation of 0.10 is highly significant and explains only 1% of the variability.
- What is r²? The coefficient of determination: the proportion of the variability of one variable that is linearly explained by the other.
- Does correlation imply causation? No. Two variables can be correlated because both depend on a third one, or by chance.
- What assumptions does it require? Paired, independent data, a linear relationship, approximate normality and no influential outliers. If they fail, use Spearman's correlation.
- Why is the confidence interval not symmetric? Because it is computed on Fisher's z scale and then transformed back; near ±1 the interval is compressed.
- What is the minimum detectable correlation? The weakest true correlation that the test would detect with 80% probability given your sample size.
- How much data do I need? It depends on the correlation you want to detect: about 85 pairs for ρ = 0.3 and about 780 for ρ = 0.1, with α = 0.05 and 80% power.
Reference: Pearson correlation coefficient — Wikipedia