Skip to content
Back to formatted view

Raw Message

Message-ID: <1351259561492-4647548.post@n4.nabble.com>
Date: 2012-10-26T13:52:41Z
From: F_Smithers
Subject: Creating a correlation matrix from a vector

I'm looking to create a correlation matrix, but I have already obtained the
correlations, which are stored in a vector. (Basically, I'm running a
simulation which requires a correlation matrix, but I am simulating the
various correlations.)

My aim is to create a function that can take the vector, and fit the values
into their respective locations in a correlation matrix. (The correlations
are ordered as if working along the upper triangle of the correlation matrix
row-wise.)

The initial step in the function was to create a diagonal matrix of length
n, (n being the number of factors) and then add the correlations at each
level using a for command.

Thanks



--
View this message in context: http://r.789695.n4.nabble.com/Creating-a-correlation-matrix-from-a-vector-tp4647548.html
Sent from the R help mailing list archive at Nabble.com.