[R] generate two sets of random numbers that are correlated

Ista Zahn izahn at psych.rochester.edu
Thu Aug 11 18:01:48 CEST 2011


If you want random numbers sampled from the normal distribution, you
can use the mvrnorm function in MASS.

Best,
Ista

On Thu, Aug 11, 2011 at 8:23 AM, Kathie <kathryn.lord2000 at gmail.com> wrote:
> Dear R users
>
> I'd like to generate two sets of random numbers with a fixed correlation
> coefficient, say .4, using R.
>
> Any suggestion will be greatly appreciated.
>
> Regards,
>
> Kathryn Lord
>
> --
> View this message in context: http://r.789695.n4.nabble.com/generate-two-sets-of-random-numbers-that-are-correlated-tp3735695p3735695.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org



More information about the R-help mailing list