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.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to