Data visualization with SAS programming

create HTML output for each response variable, each method selected in regression

Reply
Occasional Contributor
Posts: 12

create HTML output for each response variable, each method selected in regression

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

Super Contributor
Posts: 252

Re: create HTML output for each response variable, each method selected in regression

Hello, does this work?

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

<procedure>

ods html close;

Occasional Contributor
Posts: 12

Re: create HTML output for each response variable, each method selected in regression


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!

Super Contributor
Posts: 252

Re: create HTML output for each response variable, each method selected in regression

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

Occasional Contributor
Posts: 12

Re: create HTML output for each response variable, each method selected in regression

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

Super Contributor
Posts: 252

Re: create HTML output for each response variable, each method selected in regression

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.

Occasional Contributor
Posts: 12

Re: create HTML output for each response variable, each method selected in regression

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

Super Contributor
Posts: 252

Re: create HTML output for each response variable, each method selected in regression

That's fine!

Post a Question
Discussion Stats
  • 7 replies
  • 507 views
  • 1 like
  • 2 in conversation