BookmarkSubscribeRSS Feed
KelLeo
Calcite | Level 5

Hello, 

 

I am using proc boxplot in SAS v9.3 to produce side by side boxplots.  I am including the inset group statement to include n, mean, std dev, etc in the plot.  I have tried various formats and positions, but I cannot get the statistics in the inset to line up over the corresponding box.  

 

Here is the code I used: 

 

ods graphics off;
proc boxplot data=all;
plot diff*race/ boxwidth=5 skiphlabels=0 vref=3 -3 vreflabels='weight gain' 'weight loss' vreflabpos=3;
insetgroup n mean stddev q1 q2 q3 / format=bestd4.1 position=topoff cframe=black;
goptions htext=1.3;
run;

 

And here is the resulting plot:

boxplot.png

 

I just want the statistics to line up a little more precisely, to make this easier to interpret to those outside the study.  Does anyone know if this is possible?  

 

Thank you, 

Kelsey

 

 

3 REPLIES 3
Ksharp
Super User
Use PROC SGPLOT .



data class;
 set sashelp.class;
run;
proc summary data=class nway;
 class sex;
 var weight;
 output out=temp n=n mean=mean std=std;
run;
data class;
 set class temp;
run;

proc sgplot data=class;
 vbox weight/category=sex;
 xaxistable n mean std/x=sex location=inside position=top;
run;

KelLeo
Calcite | Level 5

The xaxistable statement isn't working for me.  I believe that is new to SAS 9.4.  I'm using 9.3.  

Ksharp
Super User
You could use other skill .

http://blogs.sas.com/content/graphicallyspeaking/2013/06/24/schematic-plot/

http://blogs.sas.com/content/graphicallyspeaking/2013/09/07/bar-charts-with-stacked-and-cluster-groups/

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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