|
Hi All,
Can someone share with me a more efficient way to generate the
following data structure other than what I've done without PROC IML?
Group1 is normal (0,1) and Group2 is normal (1, 1).
Thanks!
sim group x1
1 A XXX
1 A XXX
1 A XXX
1 B XXX
1 B XXX
1 B XXX
2 A XXX
2 A XXX
2 A XXX
2 B XXX
2 B XXX
2 B XXX
Code:
data group1;
seed1 = 123;
do sim = 1 to 2;
do i = 1 to 3;
group = 'A';
x1 = rannor(seed1+sim);
output;
end;
end;
keep sim group x1;
run;
data group2;
seed2 = 321;
do sim = 1 to 2;
do i = 1 to 3;
group = 'B';
x1 = 1 + rannor(seed2+sim);
output;
end;
end;
keep sim group x1;
run;
data mydata;
set group1 group2;
run;
proc sort data=mydata;
by sim group;
run;
Thanks!
Song
|