Why Test a Partial Correlation?
A partial correlation describes the linear association between two variables after removing their linear relationships with a specified set of controls. A test of zero partial correlation asks whether the remaining association is consistent with zero under a specified sampling model. The controls matter: both the estimated association and the appropriate degrees of freedom depend on which variables are held fixed.
The exact \(t\) test is a finite-sample result, not merely a large-sample approximation. Its exactness depends on the joint normal model and the null hypothesis. The result below concerns a specified pair of variables and a fixed set of \(q\) controls; it is not a test of every possible association in a multivariate data set.
For a sample of \(n\) observations, include an intercept and all \(q\) controls in each regression. The design matrix must have rank \(q+1\), so that the residuals are well-defined and the residual subspace has dimension \(n-q-1\). The statistic requires \(n-q-2>0\), and its finite numerical form also requires \(|r_{XY\cdot Z}|<1\).
Why the Degrees of Freedom Are \(n-q-2\)
The degrees of freedom follow from the dimension of the residual space and the distribution of the angle between two residual vectors. To see this, let \(D\) be the design matrix containing the intercept and controls, and let \(M=I-D(D^\mathsf{T}D)^{-1}D^\mathsf{T}\) be the residual-maker matrix. It is a projection onto the subspace orthogonal to the columns of \(D\), whose dimension is \(m=n-q-1\).
Under joint normality, each variable can be expressed as a linear function of the controls plus a normal regression error. The errors are independent of the controls, and under the null their covariance is zero. Because they are jointly normal, zero covariance makes the two errors independent. Conditional on the observed controls, the two projected error vectors therefore are independent isotropic normal vectors in the \(m\)-dimensional residual subspace. Their sample correlation is \(r_{XY\cdot Z}\).
Choose orthonormal coordinates for this subspace. After rescaling, write the two residual vectors as independent \(m\)-dimensional standard normal vectors \(U\) and \(V\). Conditional on \(U\), rotate coordinates so that \(U/\|U\|\) is the first coordinate direction. Rotational invariance of the standard normal distribution means the coordinates of the rotated \(V\) remain independent standard normals. Call its first coordinate \(A\), and let \(B\) be the sum of squares of its other \(m-1\) coordinates. Then \(A\sim N(0,1)\), \(B\sim\chi^2_{m-1}\), and \(A\) and \(B\) are independent. The correlation and its transformation are $$ r_{XY\cdot Z}=\frac{A}{\sqrt{A^2+B}}, \qquad \frac{\sqrt{m-1}\,r_{XY\cdot Z}}{\sqrt{1-r_{XY\cdot Z}^{\,2}}} =\frac{A}{\sqrt{B/(m-1)}}. $$ The right-hand side has a Student \(t\) distribution with \(m-1=n-q-2\) degrees of freedom. Since \(A^2+B>0\) and \(B>0\) with probability one, \(|r_{XY\cdot Z}|<1\) with probability one as well. This establishes the stated null distribution. \(\square\)
Hypotheses, Test Statistic, and P-Values
For a two-sided question, the hypotheses are \(H_0:\rho_{XY\cdot Z}=0\) and \(H_1:\rho_{XY\cdot Z}\ne 0\). The observed statistic is calculated with \(\nu=n-q-2\) degrees of freedom. If \(F_\nu\) is the cumulative distribution function of \(t_\nu\), the exact two-sided p-value is
For a prespecified positive alternative \(H_1:\rho_{XY\cdot Z}>0\), use \(p=1-F_\nu(t_{\text{obs}})\). For a prespecified negative alternative \(H_1:\rho_{XY\cdot Z}<0\), use \(p=F_\nu(t_{\text{obs}})\). The direction must be chosen from the scientific question before examining the observed sign; selecting a one-sided alternative after seeing the data does not give the stated test its nominal error rate.
Worked Example: A Negative Sample Partial Correlation
Suppose \(n=20\), \(q=5\), and the observed sample partial correlation is \(r_{XY\cdot Z}=-0.25\). Test \(H_0:\rho_{XY\cdot Z}=0\) against a two-sided alternative at level \(\alpha=0.05\).
The degrees of freedom are \(\nu=20-5-2=13\). The test statistic is $$ t_{\text{obs}}=-0.25\sqrt{\frac{13}{1-(-0.25)^2}} =-0.25\sqrt{\frac{13}{0.9375}} \approx -0.931. $$
Thus the two-sided p-value is \(2F_{13}(-0.931)\), approximately \(0.369\). Since \(0.369>0.05\), do not reject \(H_0\). In this sample, the observed partial correlation is negative, but it is not statistically significant at the 5% level under the specified model. This conclusion does not establish that the population partial correlation is exactly zero.
Worked Example: A Two-Sided Test With a Smaller P-Value
In another study, let \(n=24\), \(q=3\), and \(r_{XY\cdot Z}=0.50\). Test for a nonzero partial correlation at level \(\alpha=0.05\).
Here \(\nu=24-3-2=19\), and $$ t_{\text{obs}}=0.50\sqrt{\frac{19}{1-0.50^2}} =0.50\sqrt{\frac{19}{0.75}} =\sqrt{\frac{19}{3}} \approx 2.517. $$
The two-sided p-value is $$ 2F_{19}(-|2.517|)\approx 0.02099. $$ Since \(0.02099<0.05\), reject the zero-partial-correlation null hypothesis. The data provide evidence of a nonzero linear association between \(X\) and \(Y\) after controlling for the three specified variables. The test does not claim that the association is causal.
Worked Example: A Prespecified Positive Alternative
Suppose \(n=22\), \(q=4\), and \(r_{XY\cdot Z}=0.60\). The scientific question specified in advance is whether the population partial correlation is positive.
The degrees of freedom are \(\nu=22-4-2=16\). The statistic is $$ t_{\text{obs}}=0.60\sqrt{\frac{16}{1-0.60^2}} =0.60\sqrt{\frac{16}{0.64}} =0.60(5)=3.00. $$
For the positive one-sided alternative, the p-value is \(1-F_{16}(3.00)\approx 0.00424\). This is less than \(0.05\), so reject \(H_0\) in favor of a positive partial correlation. Had the alternative instead been two-sided, the p-value would be approximately \(2(0.00424)=0.00848\); the one-sided p-value is appropriate here because the direction was specified beforehand.
Critical Values and the Rejection Rule
For a two-sided test at level \(\alpha\), let \(c=F_\nu^{-1}(1-\alpha/2)\), the positive \(t\) critical value. Reject when \(|t_{\text{obs}}|\ge c\), equivalently when the p-value is at most \(\alpha\). The equivalent cutoff on the sample partial correlation follows by solving the statistic inequality. For \(|r|<1\), both sides are nonnegative, so squaring and rearranging gives
Equality belongs to the rejection region when the rule is \(p\le\alpha\): at the critical value the p-value is exactly \(\alpha\). For a positive one-sided test, the corresponding rule is \(t_{\text{obs}}\ge F_\nu^{-1}(1-\alpha)\); for a negative one-sided test it is \(t_{\text{obs}}\le F_\nu^{-1}(\alpha)\).
Assumptions and Common Pitfalls
The word exact refers to the null distribution under the model, not to a guarantee that the model describes every data set. The observations must be independent and identically distributed, the relevant variables must be jointly multivariate normal, and the control design must have full rank. If these assumptions are doubtful, the quoted \(t\) p-value need not have its stated finite-sample calibration. The result also concerns the partial correlation for the controls actually included; changing the controls changes the estimand and the degrees of freedom.
- Using the wrong degrees of freedom. With \(q\) controls and an intercept, use \(n-q-2\), not \(n-2\). The intercept and controls determine the residual-space dimension.
- Reporting a p-value above one. A two-sided p-value is \(2F_\nu(-|t_{\text{obs}}|)\), which lies between zero and one. For a negative observed statistic, use its absolute value in the two-sided formula; \(2F_\nu(-t_{\text{obs}})\) would incorrectly exceed one.
- Using the wrong tail. A one-sided p-value depends on the direction stated in \(H_1\). A positive observed statistic does not by itself justify switching to a positive one-sided test.
- Assuming nonzero residual sums of squares imply \(|r|<1\). Two nonzero residual vectors can be proportional and have correlation \(1\) or \(-1\). The finite-statistic formula requires \(|r|<1\); under the continuous normal model in the theorem this condition holds with probability one.
- Overstating the conclusion. Rejecting \(H_0\) is evidence against a zero partial correlation under the model. It does not prove causation, and failing to reject does not prove that the population partial correlation is zero.
Check Your Understanding
Work through these questions by identifying the null, the degrees of freedom, and the appropriate tail before interpreting a p-value.
- For \(n=30\) observations and \(q=6\) controls, what are the degrees of freedom for the exact test?
- If a two-sided test has \(t_{\text{obs}}=-2.1\), which expression gives its p-value: \(2F_\nu(-2.1)\) or \(2F_\nu(-|{-2.1}|)\)? Explain why.
- What model assumptions support the exact \(t\) distribution stated in this tutorial?
- Why is it not valid to report a one-sided p-value merely because the observed partial correlation has the desired sign?
- What does a p-value of \(0.03\) mean for a two-sided test, and what does it not mean?