This is what I have tried to code but it's still incorrect and I need help leading towards the right direction data cork; input Tree$1-2 North South East West; datalines; T1 72 66 76 77 T2 60 53 66 63 T3 56 57 64 58 T4 41 29 36 38 T5 32 32 35 36 T6 30 35 34 26 %MACRO randomorder (input= ,nsets=, seed=, output=); PROC SORT DATA = input OUT = "&output"; seed=ranuni(seed); run; %MEND select; %randomorder(input=cork ,nsets=5, seed=0, output=outdata1) The question is asking Suppose we want to create several copies of a data set, but every time shuffled randomly. This task can be done with the following SAS program. Data new; set old; index=RANUNI(seed); Run; Proc sort data=new; By index; Run; Data new; set new; drop index; run; (a) Write a macro program with 4 parameters: input, nsets, seed, and output. “input” is the name of the existing data set, “nsets” is the number of randomly shuffled data sets, “seed” is an integer‐valued seed for RANUNI(), and “output” is the prefix of the names of randomly shuffled data sets. B. Read the datalines It contains 5 variables: tree, north, east, south, west. Read this data file into SAS. Suppose this SAS dataset name is ‘cork’. Then, suppose you submit the following code. %RandomOrder(cork, 5, 0, outData). Report the output of the following code: Proc print data=outData1; Run;
... View more