/*group=3*/
%macro sim ;
%let j=1 ;
%do j=1 %to 100;**隨機抽取樣本100次***;
%let i=0 ;
%do i= 0 %to 2 ;
DATA SIMU&i.&j ;
d=0.1+&i*0.4; ***因變量***;
DO n = 1 to 67 ;/*67sample size,樣本含量67例*/
R=1.002+9.023/(1+exp(10.47*(0.5-d)));**效應(yīng)值***;
v&i=R+3*rannor(1); /*標(biāo)準(zhǔn)差不變,蒙特卡羅模擬效應(yīng)值*/
output ;
end;
run ;
%end ;
proc sql ; create table new&j as
select mean(v0) as m0,mean(v1)as m1 ,mean(v2) as m2
from simu&i.&j;
output;
quit;
proc append data=new&j base=a3 ; run;
我想要d=0.1、0.5、0.9時的效應(yīng)值被模擬67例的均數(shù),放入新的數(shù)據(jù)集&newj,共抽取100次樣本,所以應(yīng)該每種劑量100個均值,可我為什么每次生成的simu&i&j數(shù)據(jù)集都是相同的?求大神指點?