BookmarkSubscribeRSS Feed
georgel
Quartz | Level 8

Hi all, 

I would like to include more than one arguments in each parameter of  following macro. For example, in the position of ys to have more than one ys and the parameter xs to have more than one x. Please see the code below


%macro multireg(ys=, yhats= ,xs=);
       
proc robustreg data=want outest=est noprint;
      model &ys = &xs  lnnum_lu ;
   output out=want
      p= &yhats;
quit;

%mend multireg;


%multireg(ys=bhared_3y , yhats= bhared_3yhatm1, xs=lupe);

 

I want to run a code for multiple regressions e.g

 

%multireg(ys=bhared_3y bhared_2y bhared_1y, yhats= bhared_3yhatm1 bhared_2yhatm1 bhared_1yhatm1, xs=lupe x1 x2);

 

Thank you very much in advance 

 

Regards

George

 

3 REPLIES 3
Patrick
Opal | Level 21

Couldn't you just call the macro multiple times passing in different parameter values?

ballardw
Super User

Show the code you want to generate without macro variables that uses 2 or more response variables (Ys) that generates desired output.

 

Then we can help you.

 

 

 

 

Quentin
Super User

Agree, show the generated code you would want from your macro call where you past the lists.  Would you want 3 PROC steps? 3 model statements? 9 proc steps?...

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1035 views
  • 2 likes
  • 4 in conversation