In probability theory and statistics, partial correlation measures the degree of association between two random variables, with the effect of a set of controlling random variables removed. When determining the numerical relationship between two variables of interest, using their correlation coefficient will give misleading results if there is another confounding variable that is numerically related to both variables of interest. This misleading information can be avoided by controlling for the confounding variable, which is done by computing the partial correlation coefficient. This is precisely the motivation for including other right-side variables in a multiple regression; but while multiple regression gives unbiased results for the effect size, it does not give a numerical value of a measure of the strength of the relationship between the two variables of interest. For example, given economic data on the consumption, income, and wealth of various individuals, consider the relationship between consumption and income. Failing to control for wealth when computing a correlation coefficient between consumption and income would give a misleading result, since income might be numerically related to wealth which in turn might be numerically related to consumption; a measured correlation between consumption and income might actually be contaminated by these other correlations. The use of a partial correlation avoids this problem. Like the correlation coefficient, the partial correlation coefficient takes on a value in the range from –1 to 1. The value –1 conveys a perfect negative correlation controlling for some variables (that is, an exact linear relationship in which higher values of one variable are associated with lower values of the other); the value 1 conveys a perfect positive linear relationship, and the value 0 conveys that there is no linear relationship. The partial correlation coincides with the conditional correlation if the random variables are jointly distributed as the multivariate normal, other elliptical, multivariate hypergeometric, multivariate negative hypergeometric, multinomial, or Dirichlet distribution, but not in general otherwise.
Formal definition Formally, the partial correlation between X and Y given a set of n controlling variables Z = {Z1, Z2, ..., Zn}, written ρXY·Z, is the correlation between the residuals eX and eY resulting from the linear regression of X with Z and of Y with Z, respectively. The first-order partial correlation (i.e., when n = 1) is the difference between a correlation and the product of the removable correlations divided by the product of the coefficients of alienation of the removable correlations. The coefficient of alienation, and its relation with joint variance through correlation are available in Guilford (1973, pp. 344–345).
Computation
Using linear regression A simple way to compute the sample partial correlation for some data is to solve the two associated linear regression problems and calculate the correlation between the residuals. Let X and Y be random variables taking real values, and let Z be the n-dimensional vector-valued random variable. Let xi, yi and zi denote the ith of N i.i.d. observations from some joint probability distribution over real random variables X, Y, and Z, with zi having been augmented with a 1 to allow for a constant term in the regression. Solving the linear regression problem amounts to finding (n+1)-dimensional regression coefficient vectors 𝐰X∗ and 𝐰Y∗ such that
𝐰X∗=argmin𝐰{∑i=1N(xi−⟨𝐰,𝐳i⟩)2} 𝐰Y∗=argmin𝐰{∑i=1N(yi−⟨𝐰,𝐳i⟩)2} where N is the number of observations, and ⟨𝐰,𝐳i⟩ is the scalar product between the vectors 𝐰 and 𝐳i. The residuals are then
eX,i=xi−⟨𝐰X∗,𝐳i⟩ eY,i=yi−⟨𝐰Y∗,𝐳i⟩ and the sample partial correlation is then given by the usual formula for sample correlation, but between these new derived values:
ρ̂XY⋅𝐙=N∑i=1NeX,ieY,i−∑i=1NeX,i∑i=1NeY,iN∑i=1NeX,i2−(∑i=1NeX,i)2 N∑i=1NeY,i2−(∑i=1NeY,i)2=N∑i=1NeX,ieY,iN∑i=1NeX,i2 N∑i=1NeY,i2. In the first expression the three terms after minus signs all equal 0 since each contains the sum of residuals from an ordinary least squares regression.
Example Consider the following data on three variables, X, Y, and Z:
Computing the Pearson correlation coefficient between variables X and Y results in approximately 0.970, while computing the partial correlation between X and Y, using the formula given above, gives a partial correlation of 0.919. The computations were done using R with the following code.
The lower section of the code reports the generalized nonlinear partial correlation coefficient between X and Y after removing the nonlinear effect of Z (0.8844). It also reports the generalized nonlinear partial correlation coefficient between X and Z after removing the nonlinear effect of Y (0.1581). Additional documentation is available in the R package generalCorr, including package vignettes.
Using recursive formula It can be computationally expensive to solve the linear regression problems. Actually, the nth-order partial correlation (i.e., with |Z| = n) can be easily computed from three (n - 1)th-order partial correlations. The zeroth-order partial correlation ρXY·Ø is defined to be the regular correlation coefficient ρXY. It holds, for any Z0∈𝐙, that
ρXY⋅𝐙=ρXY⋅𝐙∖{Z0}−ρXZ0⋅𝐙∖{Z0}ρZ0Y⋅𝐙∖{Z0}1−ρXZ0⋅𝐙∖{Z0}21−ρZ0Y⋅𝐙∖{Z0}2 Naïvely implementing this computation as a recursive algorithm yields an exponential time complexity. However, this computation has the overlapping subproblems property, such that using dynamic programming or simply caching the results of the recursive calls yields a complexity of 𝒪(n3). Note in the case where Z is a single variable, this reduces to:
ρXY⋅Z=ρXY−ρXZρZY1−ρXZ21−ρZY2
Using matrix inversion The partial correlation can also be written in terms of the joint precision matrix. Consider a set of random variables, 𝐕=X1,…,Xn of cardinality n. We want the partial correlation between two variables Xi and Xj given all others, i.e., 𝐕∖{Xi,Xj}. Suppose the (joint/full) covariance matrix Σ=(σij) is positive definite and therefore invertible. If the precision matrix is defined as Ω=(pij)=Σ−1, then
… excerpt ends here. Continue reading the full article.
