[code:a99aa]data a;
do i=1 to 1000;
x1=rannor(1);
x2=rannor(2);
x3=rannor(3);
x4=rannor(4);
output;
end;
run;[/code:a99aa]
Please be noted that you are talking about independence between x_i and x_j, not records.作者: shiyiming 时间: 2004-3-20 10:24
生成的是随机数字吗?为什么每次运行的结果都是一样?作者: shiyiming 时间: 2004-3-20 12:48
it's pseudo-random numbers, fixed when the seed is fixed except you use 0 as the seed.作者: shiyiming 时间: 2004-3-22 02:06
Sorry, it should be written as
[code:d786f]data a;
do i=1 to 1000;
x1=rannor(0);
x2=rannor(0);
x3=rannor(0);
x4=rannor(0);
output;
end;
run;[/code:d786f]
in case you do not want to see the repeated measure.作者: shiyiming 时间: 2004-3-23 19:12
rannor(0)
参数为0时,随机数种子为系统时间,所以每次不一样,如果你不为0,每次当然是
同一组随机数了(随机数种子相同)