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!

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!

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.

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
  • 4 replies
  • 830 views
  • 0 likes
  • 2 in conversation