Data visualization with SAS programming

gchart hbar - reduce output by frequency

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

gchart hbar - reduce output by frequency

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


Accepted Solutions
Solution
‎01-20-2016 02:13 PM
Grand Advisor
Posts: 10,192

Re: gchart hbar - reduce output by frequency

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


All Replies
Solution
‎01-20-2016 02:13 PM
Grand Advisor
Posts: 10,192

Re: gchart hbar - reduce output by frequency

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.

New Contributor
Posts: 3

Re: gchart hbar - reduce output by frequency

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. -##
Grand Advisor
Posts: 10,192

Re: gchart hbar - reduce output by frequency

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.

New Contributor
Posts: 3

Re: gchart hbar - reduce output by frequency

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. -##
Grand Advisor
Posts: 10,192

Re: gchart hbar - reduce output by frequency

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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 374 views
  • 0 likes
  • 2 in conversation