2
$\begingroup$

I know it is possible to get the partial correlation between $a$ and $b$ given $c$ when you know all the full correlations:

$$ r_{(a, b |c)} = \frac{r_{(a, b)}-r_{(a, c)}r_{(b, c)}} {\sqrt{(1-r_{(a, c)}^2)((1-r_{(b, c)}^2)}} $$

Presumably we can get the full correlations when we know all the partials, but I can't figure out the equations. Is it possible?

$\endgroup$

2 Answers 2

0
$\begingroup$

Partial correlation is the inverse of the covariance matrix... So Compute all the partials, write down the matrix and compute the inverse! :)

$\endgroup$
3
  • 1
    $\begingroup$ I like the nature of this answer but believe it's incomplete, because the inverse of a covariance matrix cannot, in general, possibly contain correlation coefficients. See en.wikipedia.org/wiki/…. $\endgroup$
    – whuber
    Commented Jan 22, 2020 at 23:23
  • $\begingroup$ I guess you are right... in general. Because the cov. matrix needs to be invertible. In this case you only have (a,b,c), so my guess is that if the cov. matrix is not invertible (for instance you have only 2 samples to work with), than also partial correlation will be 1. because the residuals you would get from the regression would be 0. $\endgroup$
    – M. GENTILI
    Commented Jan 23, 2020 at 15:48
  • $\begingroup$ I read you post here, I have few questions, can I contact you? if so... how? $\endgroup$
    – M. GENTILI
    Commented Jan 23, 2020 at 15:49
0
$\begingroup$

Some additional steps are necessary other than simply calculating the inverse. The actual steps are the following:

  • Step 1: Get the negative of the matrix of partial correlations;
  • Step 2: Set all the values in the diagonal of this new matrix to 1;
  • Step 3: Calculate the inverse of this matrix (i.e., the modified matrix of partial correlations where all the off-diagonal elements have the inverse sign of the original matrix of partial correlations);
  • Step 4: Scale the resulting inverse.

Below I present a reproducible example with R:

# Set seed for reproducibility
set.seed(1)

# Randomly sample the original random correlation matrix
R <- cov2cor(rWishart(n=1, df=6, Sigma=diag(5))[,,1])

# Get the partial correlation matrix using the "partial.r" function of the psych package
Rho <- psych::partial.r(R)

# Do the steps described above
# Step 1: Get the negative of the of matrix of partial correlations
temp <- -Rho

# Step 2: Set all the values in the diagonal of this new matrix to 1
diag(temp) <- 1

# Step 3: Calculate the inverse of the matrix
inv <- solve(temp)

# Step 4: Scale the resulting inverse
R_rec <- cov2cor(inv)

# Check if the solution is correct
# Due to computer precision, the matrices will not be identical, but
# you can round the results to your machine's precision and check
# that the procedure works as it should
round(R, .Machine$double.eps) == round(R_rec, .Machine$double.eps)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.