BookmarkSubscribeRSS Feed
olliegeorge
Calcite | Level 5

Hello, I wrote a macro to perform several logistic regressions for the same outcome variable but several different exposure variables. Is there a way to create a table that contains all the odds ratios and 95% confidence intervals for all ResExp variables. 

 

%macro dd_singlepest;
%do i = 1 %to 47;
proc logistic data=ev.pregev_Dataall;
model neuro(event='1') = ResExp&i birthyear female mage hispan ses;
run;
%end;
%mend;

1 REPLY 1
ballardw
Super User

I think you may want to use ODS OUTPUT to place the odds ratio information into a data set. Then combine the data sets (proc append or data step)

 

See if the set OddResExp1 created below has what you want.

ods output oddsratios= OddResExp1;
proc logistic data=ev.pregev_Dataall;
model neuro(event='1') = ResExp1 birthyear female mage hispan ses;
run;

If so you should be able to create an output set for each by using &i in the OdsResExp instead of 1.

Then combine.

 

Note that all the different output object names created by your code are available setting ODS TRACE ON; before running a procedure. You can then use ODS OUTPUT to create sets for each name using pairs of object/dataset names. Turn the trace off using: ODS TRACE OFF; after the procedure.

 

Ods Output <object name> = <my data set name> ;

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 182 views
  • 0 likes
  • 2 in conversation