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-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!

5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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