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

this is my code: 

 

proc univariate data=katse.andmed2 noprint;
   histogram lugemiskiirus /midpoints=(0 to 6 by 0.5);
   inset N="maht" MIN="miinimum" MAX="maksimum" Median ="mediaan" MEAN = "keskmine" MODE = "mood" STD = "standardhälve" (8.3)
    / position = ne;
run;
 
I have tried and seached about it but nothing works.
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
/*
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;

Ksharp_0-1696851496321.png

 

View solution in original post

2 REPLIES 2
sbxkoenk
SAS Super FREQ

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

Ksharp
Super User
/*
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;

Ksharp_0-1696851496321.png

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1072 views
  • 0 likes
  • 3 in conversation