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

 

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
  • 2 replies
  • 378 views
  • 0 likes
  • 3 in conversation