[R] Generate data from correlation matrix

2011-02-07 Thread Jeremy Miles
Hi All, I was wondering if anyone knew of a function which would generate data from a pre-specified correlation matrix (as in the Stata command r2corr) or sampled from a population with a specific covariance/correlation. (I thought I'd check before I wrote something inelegant and slow.) Jeremy

Re: [R] Generate data from correlation matrix

2011-02-07 Thread Ista Zahn
Hi Jeremy, See the mvrnorm function in the MASS package. -Ish On Tue, Feb 8, 2011 at 4:10 AM, Jeremy Miles jeremy.mi...@gmail.com wrote: Hi All, I was wondering if anyone knew of a function which would generate data from a pre-specified correlation matrix (as in the Stata command r2corr) or