[R] R code for var-cov matrix given variances and correlations

2004-12-21 Thread Haynes, Maurice (NIH/NICHD)
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

Re: [R] R code for var-cov matrix given variances and correlations

2004-12-21 Thread Peter Dalgaard
Haynes, Maurice (NIH/NICHD) [EMAIL PROTECTED] writes: If the vector of variances were var.vec - c(14, 12, 7) and the vector of correlations were cor.vec - c(.4, .2, .5), then the vector of covariances would be: covAB(c(.4, .2, .5),c(14, 14, 12), c(12, 7, 7)) [1] 5.184593 1.979899

Re: [R] R code for var-cov matrix given variances and correlations

2004-12-21 Thread David Firth
On 21 Dec, 2004, at 13:09, Haynes, Maurice (NIH/NICHD) wrote: 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)?

Re: [R] R code for var-cov matrix given variances and correlations

2004-12-21 Thread Martin Maechler
PD == Peter Dalgaard [EMAIL PROTECTED] on 21 Dec 2004 14:34:59 +0100 writes: PD Haynes, Maurice (NIH/NICHD) [EMAIL PROTECTED] writes: If the vector of variances were var.vec - c(14, 12, 7) and the vector of correlations were cor.vec - c(.4, .2, .5), then the