Skip to content
Omnikalc

Partial correlation calculator: what is left of a correlation after controlling for a third variable?

Enter the three pairwise correlations and the sample size to get the partial correlation, its t statistic and its p-value.

Updated on
Your inputs

Value out of range

Value out of range

Value out of range

Value out of range

Results

Partial correlation of X and Y controlling for Z

0.4859

Partial coefficient of determination (r²)
0.2361
Drop from the raw correlation
0.1341
t statistic
4.197
Degrees of freedom
57
p-value (two-sided)
0.0001
Significant at the 5 % level

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.

The correlation significance calculator tests a simple correlation, and the r-squared calculator measures explained variance.

Frequently asked questions

What does a partial correlation show?

It shows the association between two variables after the linear effect of a third variable has been removed from both. It helps tell whether a link between X and Y is direct or whether it comes from both being related to Z, such as ice cream sales and drownings, which both rise with temperature.

How is it different from a plain correlation?

A plain correlation ignores all other variables. The partial correlation holds Z fixed in a statistical sense, so it can be smaller, larger or even change sign. If controlling for Z makes the correlation almost vanish, Z probably explains the link.

Can I control for more than one variable?

Yes, but the formula in this calculator handles one control variable. For several, the correlations can be adjusted step by step, or the calculation can be done from the inverse of the correlation matrix, and the degrees of freedom become n minus 2 minus the number of controls.

Does a partial correlation prove causation?

No. It only removes the linear effect of the variables you control for. Variables you did not measure can still produce the link, and controlling for a variable that lies on the causal path between X and Y can hide a real effect.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.