I've been looking all over the internet and have been having trouble finding good uses of a covariance matrix to find the correlation coefficient.
I know that, from a simple 2×2 variance-covariance matrix, the correlation is given by $\mathrm{COR}\left(X,Y\right)=\frac{\mathrm{COV} \left(X,Y\right)}{\sqrt{Var\left(X\right)\cdot V a r\left(Y\right)}}$.
But, if a variance-covariance matrix is a 3×3, like in this example:
m s df
m 1.004899e-04 -4.762594e-06 -0.07856965
s -4.762594e-06 7.781352e-05 0.47418130
df -7.856965e-02 4.741813e-01 8278.92601173
Is it possible to compute $\mathrm{COR}\left(X,Y\right)$ ?
Best Answer
Yes, it is. We have the variances on the diagonal of the variance-covariance matrix and covariances off the diagonal. So if we calculate the correlation between, for example, $m$ and $df$, we get $$ \operatorname{Cor}(m,df)=\frac{\operatorname{Cov(m,df)}}{\sqrt{\operatorname{Var (m)\cdot\operatorname{Var}(df)}}}=\frac{-7.856965\cdot 10^{-2}}{\sqrt{1.004899\cdot 10^{-4}\cdot8278.92601173}}. $$ I hope this helps.