| Date: | Wed, 31 Aug 2005 13:38:38 +0100 |
| Reply-To: | Jared Wilson <wilsonjaredm@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Jared Wilson <wilsonjaredm@GMAIL.COM> |
| Subject: | Re: repeat macro replacing variable each time |
|
| In-Reply-To: | <200508311104.j7VAk0XH032371@malibu.cc.uga.edu> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Hi Arild,
thanks for the advice and sorry for any confusion. My data file has variable
columns like this:
a b c ran1 ran2 ran3 ran4 ran5
and I am trying to replace the random variable that is included each time
the genmodsummary macro is run. In the example above I would want to run the
genmodsummary 5 times. The first run would contain ran1, the second ran2,
and so on until (in this example) the fifth run contained ran5.
So, the first run include the following models:
yvariable= GP04,
model1 = a ran1,
model2 = b ran1,
model3 = c ran1,
model4 = a,
model5 = b,
model6 = c,
And the 5th run would include the following models:
model1 = a ran5,
model2 = b ran5,
model3 = c ran5,
model4 = a,
model5 = b,
model6 = c ,
I also want the output from each run of genmodsummary to be saved in a
seperate outfile.
any help would be very appreciated!
thanks
jared
On 8/31/05, Arild S <kog@ssb.no> wrote:
>
> On Wed, 31 Aug 2005 06:23:04 -0400, Jared Wilson <wilsonjaredm@GMAIL.COM>
> wrote:
> ....
> >Basically I want to call a macro (genmodsummary)100 times, replacing the
> >ran1 variable with 100 different randomly generated variables (ran1 to
> >ran100 in the data sheet) each time.
> ....
>
> Hi,
> I'm not sure if I understand you correctly,
> but can't you simply nest the %genmodsummary call like this:
>
> %macro manygenmod(times);
> %do i=1 %to ×.;
> %genmodsummary(
> data= GPTRAIN,
> class= ,
> yvariable= GP04,
> model1 = a ran&i.,
> model2 = b ran&i.,
> model3 = c ran&i.,
> model4 = a,
> model5 = b,
> model6 = c ,
> distribution= poisson,
> link= log,
> number_of_models= 6,
> sortby=daic,
> out=GP&i.
> );
> %end;
> %mend;
> %manygenmod(100);
>
> You'll get GP1 - GP100 on the output side (I hope..).
>
> Arild
>
|