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.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:
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).
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.
I will not be able to subgroup the vbars in that case. Is there any better options? Thanks!
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.
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.