[R] Defining vectors with per-determined correlations

John Sorkin jsorkin at grecc.umaryland.edu
Thu Sep 4 18:04:50 CEST 2014


I need to define three vectors x, y, z (each of length 100) such that the pair-wise correlations of the vectors have per-defined values r1 and r2. More specifically I need to define x, y, and z so that:
 
corr(x,y) = r1
corr(y,z) = r2
 
Is there any easy way to accomplish this with R?
 
Thank you,
John
John David Sorkin M.D., Ph.D.
Professor of Medicine
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing) 

Confidentiality Statement:
This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. 


More information about the R-help mailing list