BookmarkSubscribeRSS Feed
tarheel13
Rhodochrosite | Level 12

Okay, so I have never made forest plot before. I have googled it extensively and keep finding this code from Sanjay Mantage. 

 

https://blogs.sas.com/content/graphicallyspeaking/files/2016/05/Subgrouped_Forest_Plot_SG_94.txt

 

However, I am a little bit confused about how to build the dataset forest_subgroup. So do I just have to output all the odds ratios for my subgroups from proc logistic and stack them together in one dataset? 

 

My shell is not very detailed. It just has a skeleton of a forest plot by subgroup and says odds ratio and confidence intervals will be presented as labels. 


TIA!

3 REPLIES 3
djrisks
Barite | Level 11

Hi Tia,

 

Yes, you're right. If you're calculating odd ratios, then you can use Proc Logistic first to obtain your odds ratios (for each subgroup). Have you used that procedure before?

 

Many thanks,

 

Kriss

tarheel13
Rhodochrosite | Level 12

Lol by TIA, I meant thanks in advance. And, no I am newer to proc logistic. 

proc sort data=dsn;
by subgroupvar;
run;

proc logistic data=dsn plots(only)=effect(x=(ordinal_visit) sliceby=treatment*severity_baseline individual connect alpha=0.5);
class severity_baseline(ref=first) treatment baseline_Steroid/param=ref;
model ordinal_visit=treatment baseline_steroid;
oddsratio treatmnet;
ods output oddsratioswal=ORest;
by subgroupvar;
run;

 

So basically, I will put this in a macro and pass in the subgroup var as a parameter and name the datasets separately and then stack them? To get overall, you just exclude the by subgroupvar? Then stack all these together and then I can use Sanjay's program? 

djrisks
Barite | Level 11

Oh lol!

 

Yes you're right, to get the overall, you don't need to use the BY statement. Yes, it's just a case of stacking all your odd ratio datasets together, and in the right order. You may have to do some additional renaming so that you get the correct Subgroup headers, and subgroups. After you have done that you should be able to use Sanjay's program to guide you to produce the Forest Plot. If you need any more assistance, just ask.


Thanks,

 

Kriss

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 722 views
  • 0 likes
  • 2 in conversation