BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Batman
Quartz | Level 8

Can I suppress the mean or median symbol in Proc BoxPlot?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@Batman wrote:

Can I suppress the mean or median symbol in Proc BoxPlot?


Time to move to Prog SGPLOT and the VBOX or HBOX plot. That allows suppressing either or both with the NOMEAN and NOMEDIAN option.

View solution in original post

4 REPLIES 4
ballardw
Super User

@Batman wrote:

Can I suppress the mean or median symbol in Proc BoxPlot?


Time to move to Prog SGPLOT and the VBOX or HBOX plot. That allows suppressing either or both with the NOMEAN and NOMEDIAN option.

Batman
Quartz | Level 8
Yes, SGPLOT does allow me to suppress the mean. Is there away to label the symbols on the chart, so the reader can know the "I" stands for the median?
ballardw
Super User

@Batman wrote:
Yes, SGPLOT does allow me to suppress the mean. Is there away to label the symbols on the chart, so the reader can know the "I" stands for the median?

Since "I" is not a default associated with medians you may have to share some of your code.

 

One of the very nice features of the newer SGPLOT over the older procedures Gplot/Gchart/Boxplot is the ability to, within some limits, overlay multiple plots. And one of those is designed to place text at graph positions. The trick may be getting the coordinates for something like a summary value like mean or median, not really difficult, and then combining with the data to plot. A brief example that shows the word "Median" in place of the bar in a vertical box plot.

proc summary data=sashelp.class nway;
   class sex;
   var height;
   output out=work.summary (drop=_:) mean= median=/autoname;
run;

data work.plot;
   set sashelp.class
       work.summary
   ;
   if height_median ne . then medtxt = 'Median';
run;

proc sgplot data=work.plot;
   vbox height /category=sex nomedian;
   text x=sex y=height_median text=medtxt;
run;

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1848 views
  • 2 likes
  • 3 in conversation