Re: [R] How to simulate correlated data

From: Berwin A Turlach <>
Date: Fri 16 Dec 2005 - 02:50:13 EST

G'day Lisa,

>>>>> "LW" == Lisa Wang <> writes:

    LW> I would like to simulate X --Normal (20, 5) Y-- Normal (40,     LW> 10) and the correlation between X and Y is 0.6.

    LW> How do I do it in R?
That depends on what you want the joint distribution to be. :)

If you want the joint distribution to be normal, you could use the function mvrnorm() from the MASS package.

HTH. Cheers,

        Berwin mailing list PLEASE do read the posting guide! Received on Fri Dec 16 03:10:59 2005

This archive was generated by hypermail 2.1.8 : Fri 16 Dec 2005 - 04:29:53 EST