Generating the treatment layout of a completely randomized (CR) design

This a small SAS program to generate the treatment layouts of a completely randomized (CR) design. Use any text editor to enter the following program and save it to a file with a file extension “.SAS”. Then you can run the program in SAS. You can change the number of treatments (th) and the number of replicates (rep) in the program according to your specific needs.

options ps=60 ls=70;

data set1;
  do th = 1 to 8;
    do rep = 1 to 9;
     ran = ranuni(0);
     output;
    end;
  end;
run;

proc sort;
  by ran;
run;

proc print;
  var th rep ran;
run;
  • Share/Bookmark

Leave a Response

You must be logged in to post a comment.