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

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 1 reply
  • 651 views
  • 0 likes
  • 2 in conversation