Date: Mon, 28 Jan 2008 08:09:53 -0800
Reply-To: thomas <addstat@GOOGLEMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: thomas <addstat@GOOGLEMAIL.COM>
Organization: http://groups.google.com
Subject: craete data-set with all combinations of n x 1, n x 0
Content-Type: text/plain; charset=ISO-8859-1
Hi,
I need a data set with all combinations of 1 and 0 (both n times).
I've got it with (example n=3)
data test (keep=x1 x2 x3 x4 x5 x6);
array x [6] (1 1 1 0 0 0);
n=dim(x);
nfact=fact(n);
do i=1 to nfact;
call allperm(i, of x[*]);
output;
end;
run;
proc sort data=test NODUPREC;
BY _ALL_;
run;
However, in case of larger n (e.g. 6) this way does not work because
it is too time consuming, or ALLPERM will not work. Does exist another
simple possibility to create my data set?
Thank you
Best regards thomas
|