Thank you for all your inspiring ideas!
One suggestion which I like very much was (slightly modified):
data test;
rho=.5;
retain seed1 123 seed2 234 seed3 345;
do i=1 to 10000;
call rannor(seed1,z1);
call rannor(seed2,z2);
call rannor(seed3,z3);
x1= z1*sqrt(1-rho)+z3*sqrt(rho);
x2= z2*sqrt(1-rho)+z3*sqrt(rho);
output;
end;
run;
proc corr data=test; var x1 x2; run;
=> x1 and x2 correlate by rho=.5
Best regards,
Christoph
>>>>>>
Dear all,
I am searching for a way to create correlated random variates in SAS, however I do not have its IML package. Is there any other way?
Background: I want to calculate the sample size for a mixed model, with 4 time points of measurement, and I expect the repeated measurements to be correlated by e.g. 0.5.
Any help would be appreciated, and I will post a final result.
Christoph
________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/
|