Hi, I want to create an HTML output for each response variable for each selection method I.e. stepwise, backwards, forwards etc.
Hello, does this work?
ods html file = "<file location and name>";
<procedure>
ods html close;
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!
Hi, when you say response, do you mean your Y variable?
Yes... For each Y (response variable) and its interaction with each X variable.
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.
Thanks I will try this and let you know if this works
That's fine!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.