I want to generating data with a known correlation structure. I use proc iml and this codes. proc iml; n = 5; r = {1 .07 .25 .6, .07 1 .07 .25, .25 .07 1 .07, .6 .25 .07 1}; print r; c = root(r); print c; z=j(n,4,.); do i = 1 to n; do j = 1 to 4; z[i,j]=rannor(-99); end; end; print z; d = z*c; print d; x1 = d[,1]; x2=d[,2]; x3=d[,3]; x4=d[,4]; print x1 x2 x3 x4; create mvn var{x1 x2 x3 x4}; append; quit; proc print data = mvn; run; It is okey but I want to iteration. I've tried many codes, but so far I did not succeed. How can I make 20 replicate? And also I want to generate ordinal data. How I can do it? Thanks for your help...
... View more