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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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