用什么语句可以实现产生两个独立的服从正态分布的随机变量或者相关系数为0.3的两个随机变量。
Data bivariate_normal_1000;
drop rho n;
rho = 0.3;
do n = 1 to 1000;
x = rannor(0); /*0 is the seed*/
y = rho*x + rannor(0)*sqrt(1-rho**2);
output;
end;
run;
/*find sample correlation*/
proc corr;
var x y;
run;
上面的code运行出来样本均值和方差并不为0和1,相关系数也不为0.3,我的目标就是产生的样本的均值和方差就是0和1,没有误差。请问如何实现?