Dear Hendry,
I assume that the "correlation" matrix (say, R) that you want to use is
actually positive-definite, and that you don't require that the
correlations for your sample be exactly equal to the target values, but
only equal in expectation. If so, then you can use the Cholesky square root
of R. Using rnorm(), generate a matrix, say Z, of independent
standard-normal variables of the required dimension. Then compute Z %*%
chol(R).
I hope that this helps,
John
At 10:14 AM 9/19/2003 +0700, Hendry Raharjo wrote:
Dear all,
i wish to generate 4 random normal variables simultaneously (say V,X,Y,Z)
which have particular correlation values among one-another (say r(v,x)=r
(v,y)=r(x,z)...=0.8) using S-Plus.
Can anyone help?
thank you very much.
regards,
hendry raharjo
industrial engineering.
--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu. To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message: unsubscribe s-news
-----------------------------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: jfox@mcmaster.ca
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
-----------------------------------------------------
|