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:
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;
Have you tried
CHREF=(red green)
? That's the format other procedures use for multiple colors.
I did try that, i get an error that underlines the parentheses and says 'expecting one of the following...'
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
You may need to use one of the other procedures such as SGPLOT or GCHART that give you more control over what is displayed.
The doc does specify you should be able to have multiple values in chref, just not how to
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.