# 17.1.9.2 Algorithm (Partial Correlation Coefficient)

Partial correlation coefficient is used to describe the relation between two variables in the presence of controlling variables.

## Partial Correlation Coefficient

For a set of $n_y$ random variables Y and $n_x$ controlling variables X, combine two sets of variables X and Y, its variance-covariance matrix can be expressed as: $\begin{pmatrix} \Sigma_{xx} & \Sigma_{xy} \\ \Sigma_{yx} & \Sigma_{yy} \end{pmatrix}$

The variance-covariance matrix of Y variables for controlling variables X is given by: $\Sigma_{y|x} = \Sigma_{yy}-\Sigma_{yx}\Sigma_{xx}^{-1}\Sigma_{xy}$

The partial correlation coefficient matrix is calculated by: $\text{diag}(\Sigma_{y|x})^{-1/2} \Sigma_{y|x} \text{diag}(\Sigma_{y|x})^{-1/2}.$

## Significance of Partial Correlation Coefficient

A t-Test can be used to test the hypothesis that a partial correlation coefficient is zero.

The degrees of freedom are: $df=n-n_x-2$

where n is the number of observations in the calculation of the full correlation. For pairwise deletion of missing values, in the calculation of partial correlation of two variables $Y_i, Y_j$ given controlling variables X, n is the minimum number of observations in the pairs of $(Y_i, Y_j), (Y_i, X), (Y_j, X)$ and pairs in X.

t Statistic is: $t = |r| \sqrt{ \frac {df} {1-r^2} }$

where r is the partial correlation coefficient.

The two-tailed significance level $\text{Prob}>|t|$ can be calculated as: $2(1 - \text{tcdf}(t, df)).$

## References

1. Morrison, D. F. (1976), Multivariate Statistical Methods, Second Edition, New York: McGraw-Hill.
2. nag_partial_corr (g02byc)