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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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