BookmarkSubscribeRSS Feed
Pdothard
Calcite | Level 5

I'm relatively new to SAS (Enterprise Guide 6.1), and I'm building graphs using the dot plot within PROC SGPLOT.  I'm graphing out observed to expected ratios with confidence limits based on the mean. I have everything I need so far, but want to add in conditional formatting, if possible, based on the limit range.  If the Upper Limit is below 1.0 I want it to be one color and if the Lower Limit is above 1.0 I want another.  Here's the code I have so far:

PROC SGPLOT DATA=WORK.SORTTempTableSorted;

refline 1.0/ lineattrs=(color=blue thickness=1.5pt) axis=x;

By Site;

  dot AttendingNPI / response=DirectCostOERatio

  stat=mean

  limitstat=clm

  limitattrs=(color=bib)

  categoryorder=respasc;

  RUN;QUIT;

1 REPLY 1
Jay54
Meteorite | Level 14

It is easier to help if you attach the full program including the data.   I suggest you compute another variable 'GRP' that is set using the condition you have defined.  Then use GROUP=GRP on the dot plot statement.  First encountered group value will get the GRAPHDATA1 color.  If you want to have more precise control of the color, with SAS 9.3 you can use the DiscreteAttrMap to assign specific colors to specific values of the GRP variable.  See doc for details.  Here is a Blog article on DiscreteAttrMaps.

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
  • 1 reply
  • 858 views
  • 0 likes
  • 2 in conversation