BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
txgordo
Calcite | Level 5

I am producing hbar graphs, which could have up to 256 hbars - I want to limit those by the value of the frequency of the parameter.

For example, I have data paramters A, B, C, D, and E.  A,B, and C have a frequency greater than 50.  D and E have frequencies less than 50.

How can I plot the data values that have frequencies > 50?

 Yes, I can hard-limit the y-axis by selecting only specific data points, but dataset to dataset, those frequencies on the data points will change.  I want to limit the plots by the frequencies of the data.

 

Thanks!

 

Gordon

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Probably easiest is to presummarize your data before the GCHART or other graphics procedure and then use a Where clause or dataset option to limit the records used to those with the desired frequency.

View solution in original post

5 REPLIES 5
ballardw
Super User

Probably easiest is to presummarize your data before the GCHART or other graphics procedure and then use a Where clause or dataset option to limit the records used to those with the desired frequency.

txgordo
Calcite | Level 5
Thanks so much for the quick response. Yeah, that's what I was hoping to
avoid. My cohorts thought similarly. As a novice user, it's a little more
work than I was hoping to do, but it's a good project!

Gordon

##- Please type your reply above this line. Simple formatting, no
attachments. -##
ballardw
Super User

The summarization may not be that bad as there are LOTS of ways to summarize data using SAS.

 

I would suggest that you put together some example data, in the form of a datastep, that is similar to your data and the type of summary it would need and post as another question on the forum. Include that you will need to know something about that frequency to filter the data later.

txgordo
Calcite | Level 5
I was able to 'solve' my problem by doing a count of the desired data,
using 'count(x) as y' in a 'select' statement, then grouping by x, then
using a 'where' clause where I did a GT or LT on a chosen value. By
experimentation, I also saw how I could get even greater granularity by
adding other 'group by' variables.

Thanks!


##- Please type your reply above this line. Simple formatting, no
attachments. -##
ballardw
Super User

If you think you may be doing things like this frequently you may want to look into Proc summary.

When you use class variables you levels of summary for combinations of the class variables. For instance if you you have Gender and Race as class variables you get an output of requested summaries for: All records, Race, Gender and Race combined with Gender. A special variable _type_ tells which combination data is summarized. So could summarize the data with one pass through and then using combinations of _type_ ,ranges of the Class variables and/ or statistics you can build a number of tables or charts from one summarized data set.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1113 views
  • 0 likes
  • 2 in conversation