Hello programmers, I am trying to implement this piece of code from a SAS guide. I can't implement it as it's giving me error messages. Can anyone explain why it doesn't work? l=t(root(eps)); /* calculate cholesky root of cov matrix eps */
z=normal(j(1,n,seed)); /* generate n samplesize normals */
xx=l*z*v; /* multiply by cholesky root and variance */
tx=t(xx);
do i=1 to &n ;
Group[i] = round(ranuni(int(time())));
x[i] = rannor(int(time()))*2 ;
do r=1 to &mm ;
b0[r]=-.2-2.6*cos((r-&m)*3.14159/ 30)* / );
yy[i,r]=b0[r]*Group[i]+3.5*sin(2*3.14159*x[i]/5);
end;
end;
yy=yy+tx; /*yy with multivariate normal error*/ Thanks
... View more