Skip to content
Prev 309127 / 398506 Next

Creating a correlation matrix from a vector

On 2012-10-26 08:58, David Winsemius wrote:
This doesn't quite work; the resulting matrix is not symmetrical.
The culprit is the t(newmat[....]) line. I find it easiest to
start with a matrix of zeros, fill in the upper.tri part as you
have done, then just add newmat and t(newmat), then fix the diagonal.

Peter Ehlers