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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 848 views
  • 0 likes
  • 2 in conversation