Help using Base SAS procedures

UNIVARIATE HISTOGRAM CHREF list

Reply
Contributor
Posts: 22

UNIVARIATE HISTOGRAM CHREF list

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;

Trusted Advisor
Posts: 2,116

Re: UNIVARIATE HISTOGRAM CHREF list

Have you tried

CHREF=(red green)

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

Contributor
Posts: 22

Re: UNIVARIATE HISTOGRAM CHREF list

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

Super User
Posts: 19,876

Re: UNIVARIATE HISTOGRAM CHREF list

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

Super User
Posts: 11,343

Re: UNIVARIATE HISTOGRAM CHREF list

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

Super User
Posts: 19,876

Re: UNIVARIATE HISTOGRAM CHREF list

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

Ask a Question
Discussion stats
  • 5 replies
  • 374 views
  • 0 likes
  • 4 in conversation