BookmarkSubscribeRSS Feed
mftuchman
Quartz | Level 8
This post should contain one format statement, one proc gchart and one question. If you are not seeing all of these, it means my question was truncated.
proc format;
value xxx
0 <- .10 = '0 to 10%'
.10 <- .30 = '10% to 30%'
.30 <- .60 = '30% to 60%'
.60 <- high = 'More than 60%';
run;
proc gchart data=inputdata;
format val xxx.;
vbar val / freq=_freq discrete;
run;
quit;

How can I create this same plot using PROC SGPLOT? I'm having trouble finding the options I need either in the XAXIS statement of SGPLOT or the options. I'm probably just missing something obvious that's already in the documentation, but can anybody help me make my plot?

The point of this for me is to learn SGPLOT, so please don't say "if you're already doing it, why worry".

Message was edited by: mftuchman

Message was edited by: mftuchman

Message was edited by: mftuchman
5 REPLIES 5
DanH_sas
SAS Super FREQ
For this example, all you need to do is drop the word DISCRETE and change the proc name to SGPLOT 🙂

Dan
mftuchman
Quartz | Level 8
OK. That worked. Thank you. It just seems odd that I need to specify DISCRETE in one environment but not the other.

How does PROC SGPLOT "think", in this particular instance? Also, what's the sgplot analog for LEVELS=n?
DanH_sas
SAS Super FREQ
Currently, there is not a direct analog to the LEVELS option. By default, the procedure summarizes on DISCRETE numeric or character values. To achieve the LEVELS functionality, you can define your own user-defined format to establish your ranges and define the label for each range.

Thanks!
Dan
ArtC
Rhodochrosite | Level 12
The following link talks about the markup text used in the forum and gives some direction as to why your post was truncated.
http://support.sas.com/forums/thread.jspa?messageID=27609毙
Jay54
Meteorite | Level 14
Posting a program with special characters like < or > or / causes problems to how the message shows up in the viewer. You can use the appropriate HTML escape characters for these special characters, as I have use here. The / (forward slash) for the statement options is really needed.

Here is a link to the full list of HTML escape characters:
http://www.theukwebdesigncompany.com/articles/entity-escape-characters.php

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2088 views
  • 1 like
  • 4 in conversation