Date: Tue, 26 Oct 2004 19:10:00 -0400
Reply-To: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Subject: Re: one random permutation
nyiann wrote:
> Hi all,
>
> I have a set of data I want to randomize--essentially, just one random
> permutation of the dataset. I guessd the easiest way to describe it
> is shifting the fields up or down a random number of positions. Is
> there an easy way to do this that anyone has done before? I can't
> think of any easier way than to subset each field, randomize it, then
> merge the fields together again.
Sort the table by a random value.
data foo;
do rowid = 1 to 100;
output;
end;
run;
%let seed=20041026;
* just one of the 100! permutations please;
proc sql;
create table foo_randomized as
select * from foo
order by ranuni(&seed)
;
quit;
--
Richard A. DeVenezia
http://www.devenezia.com/