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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.