I am trying to investigate the correlation values. A big problem happens. The method I used is in corpcor package in R. I have a column as missing data. I firstly calculate the correlation matrix.


Then I get a correlation matrix. when I did partial correlations using cor2pcor functions as follows, I got a big problem.

## 80th column and 80th row are all NAs.
### the above delete the missing value column

Most of the correlation become negative. More importantly, some correlations, for instance, 0.9 correlation becomes -0.91 in partial correlation.

The method I used is in corpcor package in R (https://cran.r-project.org/web/packages/corpcor/index.html).

Can anyone comment on that? Is it reasonable to change correlation of 0.9 to -0.9 in partial correlation?

  • 3
    $\begingroup$ Correlations are not "being changed". Why would you expect that the partial correlations would be similar to the ordinary correlations? $\endgroup$
    – Glen_b
    Aug 9, 2014 at 7:34
  • $\begingroup$ I expected the partial correlation could "modify" the correlation, for instance, change 0.9 in correlation to 0.5, but it changed 0.9 to -0.9 is a completely another way around. Something are very positively correlated become very negatively correlated. $\endgroup$
    – GeekCat
    Aug 9, 2014 at 13:45

1 Answer 1


Suppose that you have $X_1=Y+\epsilon_1$ and $X_2=Y+\epsilon_2$. Thus, let's say you want to measure $Y$, but you only can do it with error through $X_1$ and $X_2$. Let's suppose $\epsilon_1$ and $\epsilon_2$ are negatively correlated with each other and have common varioance $\sigma^2{\epsilon}$. The covariance between $X_1$ and $X_2$ is given by: $E(X_1X_2)-E(X_1)E(X_2)=E(Y^2)+E(\epsilon_1\epsilon_2)-E^2(Y)=Var(Y)+Corr(\epsilon_1\epsilon_2)*Var(\epsilon).$

The variance of $X_1$ and $X_2$ is equal to $Var(Y)+Var(\epsilon)$ (due to independence between $Y$ and both $\epsilon_1$ and $\epsilon_2$). Then, since $Corr(X_1,X_2)=\frac{Cov(X_1,X_2)}{SE(X_1)SE(X_2)}$, it is: $\rho_{X_1X_2}=\frac{\sigma^2_Y+\rho_{\epsilon_1\epsilon_2}\sigma^2_{\epsilon}}{\sigma^2_{Y}+\sigma^2_{\epsilon}}$. As for partial correlation, since it is equal to the correlation among regressions on the variable we are controlling for, it is: $\rho_{X_1X_2|Y}=\rho_{\epsilon_1\epsilon_2}$. Suppose that $\rho_{\epsilon_1\epsilon_2}=-0.91$,$\sigma^2_{\epsilon}=1$ and $\sigma^2_{Y}=18.1$. Then you have a partial correlation between $X_1$ and $X_2$ of $-0.91$, while a correlation of $\frac{18.1-0.91}{19.1}$, that is equal to $0.90$, as in your case. Thus, if you have two variables $X_1$ and $X_2$ whose correlation is a combination of a positive and a negative part, and another variable $(Y)$ explaining all the positive part of the correlation between $X_1$ and $X_2$, then the residual correlation between them is negative.


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.