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-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

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
  • 5 replies
  • 1280 views
  • 1 like
  • 4 in conversation