A partial correlation measures the link between two variables while holding a third one constant. The partial correlation calculator takes the three pairwise correlations and the sample size, and gives the partial correlation, the partial r², the drop from the raw correlation, the t statistic, the degrees of freedom and the p-value.
How the calculation works
- Start from the three pairwise Pearson correlations: r(XY), r(XZ) and r(YZ), where Z is the variable you want to control for.
- The partial correlation is r(XY·Z) = (r(XY) − r(XZ) × r(YZ)) ÷ √((1 − r(XZ)²) × (1 − r(YZ)²)). It is the correlation left between X and Y once the linear effect of Z is removed from both.
- To test it, compute t = r × √(n − 3) ÷ √(1 − r²), with n − 3 degrees of freedom for one control variable.
- The partial r² is the share of the variance of Y not explained by Z that X explains. The drop shows how much of the raw correlation came through Z.
Example
In a sample of 60, r(XY) = 0.62, r(XZ) = 0.55 and r(YZ) = 0.48. The numerator is 0.62 − 0.264 = 0.356, and the denominator is √(0.6975 × 0.7696) = 0.7327, so the partial correlation is 0.4859. The partial r² is 0.2361. The correlation drops by 0.134 once Z is controlled for. The t statistic is 4.197 with 57 degrees of freedom and the p-value is 0.0001, so it remains significant.
Why it matters
Correlations are often confounded by a third factor. Computing the partial correlation is a basic way to test whether a link survives the control, and it is a common step in psychology, economics and the health sciences.
Good to know
The calculation assumes linear relationships and roughly normal variables, and the three correlations must come from the same sample. A very large drop can point to confounding, but it does not tell you which way the causation runs. The test uses n − 3 degrees of freedom for one control variable.
Related tools
The correlation significance calculator tests a simple correlation, and the r-squared calculator measures explained variance.