BookmarkSubscribeRSS Feed
sgtilson18
Calcite | Level 5

Hi,

I have created a format using Proc Format for a particular variable. There are 9 values that the variable can take on, so I assign 9 different formats.

I then do a Proc Freq and specify / plots = freqplot(twoway=stacked scale=grouppct) after the tables statement to create stacked bar charts.

For some of the plots that are created, data exists for all 9 different formats and I like this, but for some of the plots, the data underlying the plot only has perhaps

7 or 8 types from the proc format. The color scheme for the plots with all 9 types of formats is different from the color scheme for plots with only, say 7 or 8

types of the format.

How can I ensure that the color scheme is consistent across the plots? Can I force proc freq to plot all 9 of the formats, thereby ensuring that the color scheme

is consistent? Or is there a better way to do this?

Thank you so much!

Sebastian Tilson

1 REPLY 1
sgtilson18
Calcite | Level 5

I think I've found the answer: this paper by Erin Christen titled "PROC FORMAT is Our Friend" has a section titled "ZERO-FILLING (AKA ‘DUMMYING UP’) OUTPUT DISPLAY" that solves this problem. Thanks to anyone who considered this question.

http://www.lexjansen.com/pharmasug/2006/Tutorials/TU02.pdf

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 440 views
  • 0 likes
  • 1 in conversation