s-news
[Top] [All Lists]

Re: Generating multivariate normal

To: "Hendry Raharjo" <hendry@mail.wima.ac.id>
Subject: Re: Generating multivariate normal
From: John Fox <jfox@mcmaster.ca>
Date: Fri, 19 Sep 2003 09:19:43 -0400
Cc: s-news@wubios.wustl.edu
In-reply-to: <WorldClient-F200309191014.AA14101906@mail.wima.ac.id>
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
-----------------------------------------------------


<Prev in Thread] Current Thread [Next in Thread>