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