Date: Sun, 21 May 2006 22:53:01 -0700
Reply-To: David L Cassell <davidlcassell@MSN.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: David L Cassell <davidlcassell@MSN.COM>
Subject: Re: Creating combinations in SAS
In-Reply-To: <200605211258.k4LAlaVZ004671@mailgw.cc.uga.edu>
Content-Type: text/plain; format=flowed
rdevenezia@WILDBLUE.NET replied:
>saurabh wrote:
> > Hi All ,
> >
> > I am new to SAS, however I am asked to do some work beyond that
> > knowledge level and its going over my head and understanding . ok
> > lets get to it ....
> >
> > Ok the present method what I am doing is ....
> >
> > I have a set of 20 variables. I need combinations of 4 each.
> > 1. creating a combination of those 20 variables. this should come out
> > into a data set.
>
>Perhaps in future releases of SAS there will be an ALLCOMB function.
I have heard rumors that such a function may appear one of these days.
>In the meantime, a simple m-m-m-m-macro can enumerate all the combinations
>by generating a DATA Step source code that contains the requisite number of
>nested and properly bounded loops.
>
>%macro allcomb (n=6,k=3);
> data combos_&n._&k.;
> i0=0;
> %do i = 1 %to &k;
> do i&i = i%eval(&i-1)+1 to %eval(&n-&k+&i);
> %end;
> output;
> n+1;
> %do i = 1 %to &k;
> end;
> %end;
> drop i0;
> run;
>%mend;
>
>options mprint;
>
>%allcomb(n=20,k=4);
But this is not needed for PROC REG. Just look at the SELECTION=
options.
Or don't. Let's pretend there is no such option. It was all a bad
dream. :-) :-)
> > 2. running proc reg on the combinations , by picking up each variable
> > to be a dependant variable and running proc reg on those 4895
> > combinations . With all values of Proc Reg coming out ( ie R Sqaure
> > and Adj R Square and the test of significance ) into a dataset.
>
>Someone, somewhere in the world has blanched and is turning an awful shade
>a
>green.
That would be me.
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330
_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/