BookmarkSubscribeRSS Feed
abdullala
Calcite | Level 5


is it ever possible to associate the color to a treatment group but NOT using treatment group as 'group' or 'subgroup' to draw bar chart? in fact the treatment group will appear totally randomly, but I want to use a special color to associate with a treatment group.

2 REPLIES 2
GraphGuy
Meteorite | Level 14

Do you have an example of what you'd like your graph to look like, and/or what your data is like?

Jay54
Meteorite | Level 14

It will be easier with SAS 9.3 SGProcedures or GTL, as you can create an independent DiscreteAttributesMap, and use that to color the bars.  The colors are applied by value of the variable, so you reliably get Drug A to be Blue, regardless of its position in the data.  If the value is numeric, you can also use the RangeAttributesMap (GTL).

Depending on what you want to do, you can use VBAR, VBARPARM or HIGHLOW plot as they have different features.  If you want to avoid summarization by the group variable, then VBARPARM or HIGHLOW will be more suitable.

This is likely doable using SAS 9.2, with a bit more custom coding.

sas-innovate-2024.png

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.

 

Register now!

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
  • 2 replies
  • 823 views
  • 0 likes
  • 3 in conversation