It looks like your code is for the multivariate normal case. You can simplify your life by using the built-in RANDNORMAL function. For your other two questions, you might want to look at my book Simulating Data with SAS. Chapter 8 deals with simulating MV data from standard distributions. For the MVN case, you can generate 20 replicates like this: NumSamples = 20; Mean = j(1,4,0); x = RandNormal( NumSamples*N, Mean, R); ID = colvec(repeat( T(1:NumSamples), 1, N)); Y = ID || x; varNames = "x1":"x4"; create MVN from Y[c=("ID"||varNames)]; append from Y; close MVN; The case of ordinal variables is described in Chapter 9.
... View more