Much like my last post for help, I have another problem that I just cannot solve despite my best efforts. I need to generate random integers bounded on a specifyed interval, but I need them to all be unique. In order to do this I am generating random numbers from a uniform distribution, scaling them and then rounding them to the desired interval.
My goal, at least with the code that I have shown below, is to generate 7 datasets, each containing 5 unique integer values. I dont care if different datasets contain the same values, but each individual dataset needs 5 unique values.
The code below is only part of what I have written, but it is the most relevant to what I am asking about. I can post more of the code if need be. Also, the code that I have below is set in a macro statement, which later gets called in a different macro.
%macro samp;
DROP N;
DO SAMPLE=1 to &n;
DO N=1 to 5;
X=Uniform(33);
Y=(X*9)+1;
RY=Round(Y);
RY2=RY;
IF SAMPLE=&n THEN OUTPUT &name&n;
END;
END;
%mend samp;
I have tried several different things and just cant quite get a solution. This site was so helpful with my last post that I figured I would try again. Thank you for any help in advance.
My goal, at least with the code that I have shown below, is to generate 7 datasets, each containing 5 unique integer values. I dont care if different datasets contain the same values, but each individual dataset needs 5 unique values.
The code below is only part of what I have written, but it is the most relevant to what I am asking about. I can post more of the code if need be. Also, the code that I have below is set in a macro statement, which later gets called in a different macro.
%macro samp;
DROP N;
DO SAMPLE=1 to &n;
DO N=1 to 5;
X=Uniform(33);
Y=(X*9)+1;
RY=Round(Y);
RY2=RY;
IF SAMPLE=&n THEN OUTPUT &name&n;
END;
END;
%mend samp;
I have tried several different things and just cant quite get a solution. This site was so helpful with my last post that I figured I would try again. Thank you for any help in advance.