Rhodochrosite | Level 12

## Help with forest plot

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
Barite | Level 11

## Re: Help with forest plot

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

Rhodochrosite | Level 12

## Re: Help with forest plot

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?

Barite | Level 11

## Re: Help with forest plot

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

Discussion stats
• 3 replies
• 668 views
• 0 likes
• 2 in conversation