BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
daun_14
Calcite | Level 5

Hi, I want to know how to mark the average value on the boxplot.

Here is the phrase I wrote. How can I change it?

 

Proc sgplot data = A ;

   Vbox scr1 / categorty=cd

   group= cd boxwidth=0.8

   capshape=none meanattrs=(symbol=diamond size=12);

 

   axis color=black width=20;

run;

 

Thanks for appreciate!

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
data have;
 set sashelp.heart;
 keep status bp_status  weight;
run;




proc summary data=have nway;
class status bp_status; 
var weight;    
output out=temp mean=mean;
run;
data want;
 set have temp;
run;
proc sgplot data=want noautolegend ;
Vbox weight / category=status group=bp_status boxwidth=0.8 
  capshape=none meanattrs=(symbol=diamond size=12);
scatter x=status y=mean /group=bp_status groupdisplay=cluster clusterwidth=0.7
   datalabel=mean datalabelattrs=(color=black) markerattrs=(size=0)  ;
xaxis display=(nolabel) ;
run;

Ksharp_0-1708934155804.png

 

View solution in original post

1 REPLY 1
Ksharp
Super User
data have;
 set sashelp.heart;
 keep status bp_status  weight;
run;




proc summary data=have nway;
class status bp_status; 
var weight;    
output out=temp mean=mean;
run;
data want;
 set have temp;
run;
proc sgplot data=want noautolegend ;
Vbox weight / category=status group=bp_status boxwidth=0.8 
  capshape=none meanattrs=(symbol=diamond size=12);
scatter x=status y=mean /group=bp_status groupdisplay=cluster clusterwidth=0.7
   datalabel=mean datalabelattrs=(color=black) markerattrs=(size=0)  ;
xaxis display=(nolabel) ;
run;

Ksharp_0-1708934155804.png

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 216 views
  • 2 likes
  • 2 in conversation