Date: Mon, 2 Apr 2007 06:53:53 -0400
Reply-To: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Subject: Re: random permutations
quebecstat@aim.com wrote:
> Hi all.
>
> I would need to create random permutations in order to conduct a
> multiple testing experiment using Friedman's chi-squared test.
>
> Configuration: Each column contains two random permutations of 1,2,3
> as indicated below
>
> 113
> 232
> 321
> 121
> 212
> 332
>
> I was able to obtain those columns one at a time with proc plan. Is
> there an easy to obtain those columns?
RANPERM could be the basis of numerous varieties of DATA Step codings. Here
is one:
%let NBLOCKS = 2;
%let NREPLICATES = 3;
%let NITEMS = 3;
data foo;
_n_ = 97867564;
do block = 1 to &NBLOCKS;
do replicate = 1 to &NREPLICATES;
array item[&NITEMS] (1:&NITEMS);
call ranperm(_n_, of item[*]);
output;
end;
end;
run;
proc transpose data=foo out=foot prefix=repl_;
by block;
id replicate;
var item:;
run;
proc print;
run;
--
Richard A. DeVenezia
http://www.devenezia.com/