BookmarkSubscribeRSS Feed
jsberger
Obsidian | Level 7

Hi All,

I've been trying to get UNIVARIATE to create a histogram with two vertical references lines of two different colors.  I seem to be able to specify the location of two reference lines, with no problem...but can't seem to get two different colors to be used for the two lines individually.  I was basing my attempts on the enhancements listed here:

http://support.sas.com/documentation/cdl/en/whatsnew/65742/HTML/default/viewer.htm#procstatwhatsnew9...

Under Univariate, before 'What's Changed' it says CHREF will accommodate a list.  I've tried listing several different colors, but i always get errors.  Here's a simple data step to create a file, and the UNIVARIATE code i have been editing.  Both lines plot with no problems, but they're always either one color, or i get an error in the log.  Any help is appreciated, though i'm thinking i  need to either go GPLOT or ANNOTATE (which i don't mind doing, but also don't want to do if there's an easier way as mentioned by the enhancements).

data octane;

input Expert Customer;

datalines;

94.5 92.0

94.0 88.0

94.0 90.0

93.0 93.0

88.0 88.0

;

run;

Jason

proc univariate data=octane;

  histogram customer

  /href=89 91 chref=red green;

  run;

5 REPLIES 5
Doc_Duke
Rhodochrosite | Level 12

Have you tried

CHREF=(red green)

?  That's the format other procedures use for multiple colors.

jsberger
Obsidian | Level 7

I did try that, i get an error that underlines the parentheses and says 'expecting one of the following...'

Reeza
Super User

That's the same thing I got, I'd contact Tech Support, there weren't any examples online I could find and they probably have the answer faster Smiley Happy

ballardw
Super User

You may need to use one of the other procedures such as SGPLOT or GCHART that give you more control over what is displayed.

Reeza
Super User

The doc does specify you should be able to have multiple values in chref, just not how to Smiley Happy

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 2250 views
  • 0 likes
  • 4 in conversation