[R] Generate a serie of new vars that correlate with existing var

From: Nguyen Dinh Nguyen <n.nguyen_at_garvan.org.au>
Date: Mon 02 Apr 2007 - 01:47:25 GMT


Dear R helpers,
I have a var (let call X1) with approximately Normal distribution (say, mean=15, SD=5).
I want to generate a series of additional vars X2, X3, X4…such that the correlation between X2 and X1 is o.4, X3 and X1 is 0.5, X4 and X1 is 0.6 and so on with the condition all variables X2, X3, X4….have the same mean and SD with X1.
Any help should be appreciated
Regards
Nguyen



R-help@stat.math.ethz.ch 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. Received on Mon Apr 02 11:48:04 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 03 Apr 2007 - 16:30:52 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.