Help using Base SAS procedures

SAS proc Freq & gchart display additional value's frequency/ bars

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

SAS proc Freq & gchart display additional value's frequency/ bars

This might be a weird question. I have a data set contains data like agree, neutral, disagree...for many questions. There is not so many observations so for some question, one or more options has frequency of 0, say neutral. When I run proc freq, since neutral shows up in that variable, the table does not contain a row for neutral. I end up with tables with different number of rows. I would like to know if there is a option to show these 0 frequency rows. I will also need to run proc gchart for the same data set, and I will run into the same problem for having different number of bars. Please help me on this. Thank you!


Accepted Solutions
Solution
‎03-30-2014 03:25 PM
Super User
Posts: 17,829

Re: SAS proc Freq & gchart display additional value's frequency/ bars

1.Add the row with zero in.

2. Try the sparse option in proc freq.

3. Try the preloadfmt with proc means/tabulate.

And a better answer is linked below:

View solution in original post


All Replies
Solution
‎03-30-2014 03:25 PM
Super User
Posts: 17,829

Re: SAS proc Freq & gchart display additional value's frequency/ bars

1.Add the row with zero in.

2. Try the sparse option in proc freq.

3. Try the preloadfmt with proc means/tabulate.

And a better answer is linked below:

New Contributor
Posts: 3

Re: SAS proc Freq & gchart display additional value's frequency/ bars

Thank you. It is good. Could you also tell me how to do preloadfmt when using Gchart? I need the additional bars too(I know it will just be space since the height of the bar will be 0).

Super User
Posts: 17,829

Re: SAS proc Freq & gchart display additional value's frequency/ bars

Don't use GCHART, use SGPLOT with vbarparm, using the precomputed data from the previous procedure.

Assuming you have 9.3 or above at least.

New Contributor
Posts: 3

Re: SAS proc Freq & gchart display additional value's frequency/ bars

I will not be able to subgroup the vbars in that case. Is there any better options? Thanks!

☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 261 views
  • 0 likes
  • 2 in conversation