this is my code:
/*
Yes.Switch into PROC SGPANEL to manipulate more .
*/
data have;
set sashelp.heart(obs=1000);
keep bp_status weight;
run;
proc sort data=have;by bp_status;run;
proc summary data=have ;
by bp_status;
var weight;
output out=summary n=n min=min max=max median=median mean=mean mode=mode std=std;
run;
data want;
inb=0;
merge have summary(in=inb);
by bp_status;
if not inb then call missing(n,min,max,median,mean,mode,std);
label n="maht" min="miinimum" max="maksimum" Median ="mediaan" MEAN = "keskmine" MODE = "mood" STD = "standardhälve";
run;
proc sgpanel data=want noautolegend;
panelby bp_status/layout=rowlattice novarname onepanel ROWHEADERPOS=left;
histogram weight/group=bp_status;
inset n min max Median MEAN MODE STD /border position=ne separator='=' ;
run;
Go here: https://blogs.sas.com/content/?s=histogram+color
You will find (among others) this:
Histogram with Gradient Color
By Sanjay Matange on Graphically Speaking November 30, 2015
https://blogs.sas.com/content/graphicallyspeaking/2015/11/30/7180/
BR,
Koen
/*
Yes.Switch into PROC SGPANEL to manipulate more .
*/
data have;
set sashelp.heart(obs=1000);
keep bp_status weight;
run;
proc sort data=have;by bp_status;run;
proc summary data=have ;
by bp_status;
var weight;
output out=summary n=n min=min max=max median=median mean=mean mode=mode std=std;
run;
data want;
inb=0;
merge have summary(in=inb);
by bp_status;
if not inb then call missing(n,min,max,median,mean,mode,std);
label n="maht" min="miinimum" max="maksimum" Median ="mediaan" MEAN = "keskmine" MODE = "mood" STD = "standardhälve";
run;
proc sgpanel data=want noautolegend;
panelby bp_status/layout=rowlattice novarname onepanel ROWHEADERPOS=left;
histogram weight/group=bp_status;
inset n min max Median MEAN MODE STD /border position=ne separator='=' ;
run;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.