To simulate I use the following proc iml. The aim is to simulate random effects...... proc iml; N1t = 30; N2t = 40; N3t = 50; N4t = 60; N5t = 70; N1p = 30; N2p = 40; N3p = 50; N4p = 60; N5p = 70; NumSamples=1000; MeanT = {4, 5, 15}; MeanP = {9, 8, 21}; CovT = {74 0 0, 0 80 0, 0 0 117}; CovP = {49 0 0, 0 64 0, 0 0 81}; call randseed(100); ST1 = RandNormal(N1t*NumSamples, MeanT, CovT); ST2 = RandNormal(N2t*NumSamples, MeanT, CovT); ST3 = RandNormal(N3t*NumSamples, MeanT, CovT); ST4 = RandNormal(N4t*NumSamples, MeanT, CovT); ST5 = RandNormal(N5t*NumSamples, MeanT, CovT); SP1 = RandNormal(N1p*NumSamples, MeanP, CovP); SP2 = RandNormal(N2p*NumSamples, MeanP, CovP); SP3 = RandNormal(N3p*NumSamples, MeanP, CovP); SP4 = RandNormal(N4p*NumSamples, MeanP, CovP); SP5 = RandNormal(N5p*NumSamples, MeanP, CovP); S1t = colvec(repeat(T(1:NumSamples), 1, N1t)); S2t = colvec(repeat(T(1:NumSamples), 1, N2t)); S3t = colvec(repeat(T(1:NumSamples), 1, N3t)); S4t = colvec(repeat(T(1:NumSamples), 1, N4t)); S5t = colvec(repeat(T(1:NumSamples), 1, N5t)); S1p = colvec(repeat(T(1:NumSamples), 1, N1p)); S2p = colvec(repeat(T(1:NumSamples), 1, N2p)); S3p = colvec(repeat(T(1:NumSamples), 1, N3p)); S4p = colvec(repeat(T(1:NumSamples), 1, N4p)); S5p = colvec(repeat(T(1:NumSamples), 1, N5p)); Z1t = S1t || ST1; Z2t = S2t || ST2; Z3t = S3t || ST3; Z4t = S4t || ST4; Z5t = S5t || ST5; Z1p = S1p || SP1; Z2p = S2p || SP2; Z3p = S3p || SP3; Z4p = S4p || SP4; Z5p = S5p || SP5; create work.Treated1 from Z1t[c={"Simulation" "x1" "x2" "x3"}]; append from Z1t; close work.Treated1; create work.Treated2 from Z2t[c={"Simulation" "x1" "x2" "x3"}]; append from Z2t; close work.Treated2; create work.Treated3 from Z3t[c={"Simulation" "x1" "x2" "x3"}]; append from Z3t; close work.Treated3; create work.Treated4 from Z4t[c={"Simulation" "x1" "x2" "x3"}]; append from Z4t; close work.Treated4; create work.Treated5 from Z5t[c={"Simulation" "x1" "x2" "x3"}]; append from Z5t; close work.Treated5; create work.Placebo1 from Z1p[c={"Simulation" "x1" "x2" "x3"}]; append from Z1p; close work.Placebo1; create work.Placebo2 from Z2p[c={"Simulation" "x1" "x2" "x3"}]; append from Z2p; close work.Placebo2; create work.Placebo3 from Z3p[c={"Simulation" "x1" "x2" "x3"}]; append from Z3p; close work.Placebo3; create work.Placebo4 from Z4p[c={"Simulation" "x1" "x2" "x3"}]; append from Z4p; close work.Placebo4; create work.Placebo5 from Z5p[c={"Simulation" "x1" "x2" "x3"}]; append from Z5p; close work.Placebo5; quit;
... View more