BookmarkSubscribeRSS Feed
romangelzhaeuse
Fluorite | Level 6

Hi,

 

I want to generate various histograms using the by statement and assign different colors to each histogram. Is there a method analogous to proc boxplot's cvref which works?

 

I mean something similar to the below code:

 

ods select Histogram;
proc univariate data=Simon4;
	histogram IL6A / cboxfill=MF_IL6                 
		midpoints =0 50 100 150 200 250 300;
	var IL6A;
	by Gruppe;
run;

where "MF_IL6" is variable giving the colors for different by groups.

1 REPLY 1
DanH_sas
SAS Super FREQ

How about something like this?

 

title "Cholesterol by Weight Status";
proc sgpanel data=heart noautolegend;
panelby weight_status / novarname columns=1;
histogram cholesterol / group=weight_status;
run;

 

The SGPanel Procedure

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 833 views
  • 0 likes
  • 2 in conversation