BookmarkSubscribeRSS Feed
amrshd
Fluorite | Level 6

Hi, I want to create an HTML output for each response variable for each selection method I.e. stepwise, backwards, forwards etc.

7 REPLIES 7
djrisks
Barite | Level 11

Hello, does this work?

ods html file = "<file location and name>";

<procedure>

ods html close;

amrshd
Fluorite | Level 6


Hi, The actual requirement is as below:

Proc reg data = dsn;

model Y = x1 x2 x3 x4.....xn /selection =stepwise slstay=0.05 slentry=0.05;

run;

Proc reg data = dsn;

model Y = x1 x2 x3 x4.....xn /selection =backwards slstay=0.05 slentry=0.05;

run;

So, for each of the response variable I want to generate a seperate html file and save the output as - Y_X1_stepwise.html, Y_X2_stepwise ....etc.

I want individual html file for each response variable with method name.

Thanks for your help!

djrisks
Barite | Level 11

Hi, when you say response, do you mean your Y variable?

amrshd
Fluorite | Level 6

Yes... For each Y (response variable) and its interaction with each X variable.

djrisks
Barite | Level 11

Okay, then the best way is to make sure everything is in one dataset and then use a Macro.

For example:

ods html file = <file location>/&filename;

%macro response(response, filename);

Proc reg data = dsn;

by <group variable>; /* Group should be your variable that differentiates the responses */

where <group variable> = &response.; /* Response is the label that you have chosen to identify each group */

model Y = x1 x2 x3 x4.....xn /selection =stepwise slstay=0.05 slentry=0.05;

model Y = x1 x2 x3 x4.....xn /selection =backwards slstay=0.05 slentry=0.05;

run;


%mend;


%response(group1, Y1_stepwise)

%response(group1, Y1_backwards)

%response(group2, Y2_stepwise)

%response(group2, Y2_backwards)


I haven't got SAS on my computer, so couldn't test it. I hope you understand it though. The key thing is to create a Macro, so that you can expliciity label your output filenames easier.

amrshd
Fluorite | Level 6

Thanks I will try this and let you know if this works

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 7 replies
  • 1342 views
  • 1 like
  • 2 in conversation