Displaying 1 result from an estimated 1 matches for "corab".
Did you mean:
colab
2004 Dec 21
3
R code for var-cov matrix given variances and correlations
Dear list members,
Where can I find code for computing the p*p variance-covariance
matrix given a vector of p variances (ordered varA, varB, ...,
varp) and a vector of all possible correlations (ordered corAB,
corAC, ..., corp-1,p)?
I know that the covariance between 2 variables is equal to the
product of their correlation and their standard deviations:
corAB * varA^.5 * varB^.5
and so:
covAB <- function(corAB, varA, varB) {
corAB * varA^.5 * varB^.5
}
If the vector of variances were
var...