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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.