BookmarkSubscribeRSS Feed
ketch
Calcite | Level 5
Hello.
I am using Proc Boxplot to make a grouped box and whisker plot. I am using annotate to draw brackets between boxes indicating statistically significant pair-wise differences.

How do I get three different color fills inside each of the three locations (Neck, Chest, Groin) and how do I then create a legend outside of the plot area that will include the color definition as well as the p-value labels that I currently have showing inside the plot area?

By the way, I would love to do this using Proc SGPanel. Does anyone know if SGPanel can be "tricked" into somehow adding brackets to a grouped boxplot?

Thanks,
Norma Ketchum

[pre]
goptions reset=goptions fill
device=PNG target=PNG Xmax=8 in Ymax=5 in
Ftext='arial' Ftitle='arial' gunit=pct
XPIXELS=4000 YPIXELS=4000 Htext=3.5 Htitle=3 ;

%annomac
data anno1;
length function style color $ 8 text $23;
retain hsys '3' xsys '3' ysys '3';
size=3; color='black'; function='label';
when='A';

%line(14.0, 75.0, 66.0, 75.0, red, 1,.1);
%line(14.0, 75.0, 14.0, 60.0, red, 1,.1);
%line(66.0, 75.0, 66.0, 74.0, red, 1,.1);
%LABEL (92.0, 84.0, "p<0.01", red, 0, 0, 3.00, arial, E);

%line(24.0, 73.0, 64.0, 73.0, blue, 1,.1);
%line(24.0, 73.0, 24.0, 65.0, blue, 1,.1);
%line(64.0, 73.0, 64.0, 72.0, blue, 1,.1);
%LABEL (92.0, 80.0, "p<0.05", blue, 0, 0, 3.0, arial, E);
run;

proc boxplot data=dose_final;
plot dose*group_loc \ boxwidth=8 cboxes=black cboxfill=lig CONTINUOUS
BOXSTYLE=schematic annotate=anno1
haxis=axis1 vaxis=axis2;
run;
quit;

[/pre]
2 REPLIES 2
GraphGuy
Meteorite | Level 14
If you can't find another way, perhaps this example will be a good starting-place for creating a totally custom boxplot, using annotate to draw it ...

http://robslink.com/SAS/democd47/anno_boxplot_info.htm
http://robslink.com/SAS/democd47/anno_boxplot.htm
http://robslink.com/SAS/democd47/anno_boxplot.sas Message was edited by: Robert Allison @ SAS

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 806 views
  • 0 likes
  • 3 in conversation