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

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

4 REPLIES 4
Reeza
Super User

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:

wangry
Calcite | Level 5

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).

Reeza
Super User

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.

wangry
Calcite | Level 5

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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