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?...

BASUG is hosting free webinars Next up: Mike Raithel presenting on validating data files on Wednesday July 17. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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