[R] generate correlated dataset

Huntsinger, Reid reid_huntsinger at merck.com
Sat May 10 00:12:14 CEST 2003


You could use mvrnorm once for each cluster, with a different mean vector
each time (if you mean clusters in that sense.) 

You could draw the number of observations in a cluster randomly if that's
important.

Reid Huntsinger

-----Original Message-----
From: ge yreyt [mailto:tothri2000 at yahoo.ca] 
Sent: Friday, May 09, 2003 5:02 PM
To: r-help
Subject: [R] generate correlated dataset


Hi,I want to generate a dataset, which have more than one clusters (say 2)
and the elements in each cluster have high correlation (say 0.85)
andelements among different clusters have low (say 0.1) or zero
correlation.The correlation structure of final dataset should have a
block-diagonal structure, that likes  0.85 0.85 .. 0.85 0 0 0 0 ...0 0 0...0
0 0 .......................................................0.85 0.85  ..
0.85 0 0 0 0...0 0 0 ...0 0 0 0 0 0 0 000 0000 0.85 0.85 0.85 ....
0.85.........................................................0 0 0 0 0......
0 0 0.85 0.85 .............0.85 for each block (cluster), I can use mvrnorm
command to generate data,but the key problem is I do not know how to
generate data which have 0correlation when elements are among different
clusters???? Thank you very much for your help!!! pin   


---------------------------------
Post your free ad now! Yahoo! Canada Personals

	[[alternate HTML version deleted]]

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, cont... {{dropped}}




More information about the R-help mailing list