Partial Correlation Calculator

StatisticsLast updated: August 22, 2026

Partial correlation measures the relationship between two variables once the influence of a third variable has been removed. The famous link between ice cream sales and drowning incidents is the classic illustration: control for air temperature and the relationship all but disappears, because temperature drives both. Partial correlation is the most direct way of exposing this kind of spurious relationship.

From your X, Y, and control variable Z data, this calculator computes the three zero-order correlations (r_xy, r_xz, r_yz), then the partial correlation r_xy.z, a t test with n − 3 degrees of freedom, the p-value, and a Fisher z confidence interval. It quantifies how much the control changed the relationship, also reports the semipartial (part) correlation, and visualizes the result with a scatter plot of the residuals left after Z is partialed out.

The first of the two variables whose relationship you want to examine.
The second variable; it must be in the same order as X.
The variable whose influence is removed (age, experience, income, temperature, and so on). It must be in the same order as X and Y.
Sets the false-positive risk. In the social sciences 5% is the usual choice.
The probability that the interval covers the true parameter.

Partial Correlation Formulas

Partial correlation:  r_xy.z = (r_xy − r_xz·r_yz) / √[(1 − r_xz²)(1 − r_yz²)]
Semipartial (part):   r_y(x.z) = (r_xy − r_xz·r_yz) / √(1 − r_xz²)
Degrees of freedom:   df = n − 2 − k = n − 3   (k = 1 control variable)
Test statistic:       t = r_xy.z · √[(n − 3) / (1 − r²_xy.z)]
Fisher transform:     z = artanh(r_xy.z),  SE = 1 / √(n − 3 − k)
Confidence interval:  tanh( z ± z_(1−α/2)·SE )
Equivalent form:      r_xy.z = corr( X − X̂(Z) , Y − Ŷ(Z) )

The formula is the first-order partial correlation, with a single control variable. To control for several variables at once, use a higher-order partial correlation or multiple regression; the degrees of freedom drop by one for each additional control variable.

How to Calculate

  1. Paste the values of X, Y, and the control variable Z into the three boxes in the same order; all three must contain the same number of values.
  2. Choose the significance level (α) and the confidence level; in partial correlation the degrees of freedom are n − 3.
  3. Read the zero-order correlation table first: how strongly Z relates to X and Y tells you in advance how much the control will matter.
  4. Read the partial correlation together with the effect-of-the-control row; if the relationship weakens markedly, the third variable may be a common source.
  5. Look at the residual scatter plot: the slope between the X and Y residuals with Z partialed out is the visual counterpart of the partial correlation.
  6. Carry the APA line and the confidence interval into your report together, and state explicitly in the text which variable was controlled.

Worked Examples

The relationship weakens once experience is controlled

The uncontrolled correlation between monthly training hours (X) and performance score (Y) is r = 0.876. Once experience (Z), which correlates about 0.74 with both, is controlled, the partial correlation drops to r_xy.z = 0.726; the relationship weakens but stays significant with t(12) = 3.654 and p = 0.003.

Partial correlation (r_xy.z): 0.726 · Zero-order correlation (r_xy): 0.876 · Effect of the control (r_xy − r_xy.z): 0.151

A spurious relationship: it disappears once controlled

Ice cream sales (X) and sunburn visits (Y) show a strong relationship, r_xy = 0.852. But once temperature (Z), which drives both, is controlled, the partial correlation falls to r_xy.z = −0.103 and loses all significance with p = 0.764: the apparent relationship is spurious.

Partial correlation (r_xy.z): -0.103 · Zero-order correlation (r_xy): 0.852 · Effect of the control (r_xy − r_xy.z): 0.955

A suppressor variable: the relationship strengthens once controlled

The uncontrolled relationship is only moderate at r_xy = 0.376 and is not even significant, with p = 0.228; yet once Z is controlled the partial correlation rises to r_xy.z = 0.886. Z correlates 0.828 with X but only -0.139 with Y: it is a suppressor variable masking the true link. After the control, t(9) = 5.740 and p < 0.001 make the strengthened relationship significant.

Partial correlation (r_xy.z): 0.886 · Zero-order correlation (r_xy): 0.376 · Effect of the control (r_xy − r_xy.z): -0.510

Frequently Asked Questions

What is the difference between partial correlation and ordinary correlation?
Ordinary (zero-order) correlation gives the raw relationship between two variables and takes no other variable into account. Partial correlation removes the variance a third variable shares with both, and measures what is left. The larger the gap between the two, the more of the relationship the control variable explains.
How do partial and semipartial (part) correlation differ?
In partial correlation the control variable is partialed out of both X and Y; in semipartial correlation it is partialed out of X only, leaving Y in its raw form. That is why the square of the semipartial coefficient gives the unique contribution X makes to the TOTAL variance in Y and corresponds to the change in R² in multiple regression. In absolute value, the semipartial coefficient is always smaller than or equal to the partial coefficient.
What does it mean when the correlation INCREASES after the control?
This is called suppression: the control variable acts like a source of noise that masks the true relationship between X and Y. The relationship between cognitive ability and job performance, for example, can strengthen once anxiety is controlled. Suppressor variables are rare; when you find one, make sure you can explain it theoretically and confirm the result in a separate sample.
How many observations are needed, and why are the degrees of freedom n − 3?
Each control variable consumes one degree of freedom: at zero order df = n − 2, so with one control variable the partial correlation has df = n − 3. The calculation runs with as few as 5 observations, but at least 30 are recommended for a stable result; in small samples the partial correlation is far more volatile than the zero-order correlation.
Can I control for more than one variable at a time?
This calculator computes the first-order partial correlation for a single control variable. To control for several variables, it is better to fit a multiple regression and read the partial or semipartial coefficient of the predictor you care about; in regression, each additional predictor costs a degree of freedom and raises the risk of multicollinearity.
Does partial correlation prove causation?
No. Controlling for a variable statistically is not the same as holding it constant experimentally. Other unmeasured common causes may remain, measurement error can leave the partialing incomplete, and if the controlled variable is actually a link in the causal chain between X and Y (a mediator), controlling for it destroys the relationship artificially. A causal claim requires an experimental design.
Do the results match SPSS?
Yes. The Analyze → Correlate → Partial procedure in SPSS uses the same formula and returns the same coefficient, the same degrees of freedom (n − 3), and the same p-value. In R, the pcor.test function of the ppcor package gives an equivalent result. Excel has no built-in function; you have to compute the three correlations separately and apply the formula by hand.