BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hr667
Fluorite | Level 6

I'm trying to add a non-inferiority margin to my forest plot for the primary outcome and not the secondary outcomes. (outcome = 1 in the example data). Here is some made up example data. I've been playing around with the bands statement with no luck. 

 

data plot;
input outcome adj_mean lowercl uppercl;
cards;
1	-0.1	.	3	
2	0.2	0.1	0.3	
3	-0.2	-0.4	0.1	
4	-0.3	-0.6	-0.1	
5	-0.3	-0.5	-0.1	
;
run;

proc sgplot data=plot NOAUTOLEGEND;
band y=outcome upper=4 lower=-5 / modelname="scatter" fill nooutline transparency=0.80 fillattrs=(color='yellow');
scatter x=adj_mean y=outcome / xerrorlower=lowercl xerrorupper=uppercl ERRORBARATTRS=(thickness = 1.5pt) markerattrs=(symbol=DiamondFilled size=8);
refline 0 / axis=x;
xaxis label="Adjusted Mean Difference and 95% Confidence Limits" min=-5 max=5 LABELATTRS=(family = caibri size = 12) VALUEATTRS=(family = caibri size = 11);
yaxis label="Outcome" fitpolicy=split splitchar=';' TYPE=DISCRETE LABELATTRS=(family = caibri size = 12) VALUEATTRS=(family = caibri size = 11);
run; 

I want the plot to look like this:

Capture.PNG

Is this possible?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Instead of a BAND, try using a HIGHLOW plot with TYPE=BAR. This will let you selectively place a "band" behind any outcome. See the swimmer plot in this post to see. the general idea.  Hope this helps!

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

Instead of a BAND, try using a HIGHLOW plot with TYPE=BAR. This will let you selectively place a "band" behind any outcome. See the swimmer plot in this post to see. the general idea.  Hope this helps!

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 806 views
  • 2 likes
  • 2 in conversation