Can anyone help me? I am running one-way frequency tables on a list of variables that have 3 possible levels. I want all 3 levels displayed even when there are no responses for a given level (i.e. for some vars, nobody replied 'never'). I thought the sparse option in the tables statement would work, but it did not. Any ideas? Thank you!
format never 0='never' 1='sometimes' 2='always';
proc freq data=mydata;
format var10--var10 never.;
Thanks for answering and oops Right - my mistake on the format statement.... But that's not the problem. And using the 'missing' option shows the cases with missing data, but that's not what I want either. It's really just in the table...I want the table to display a line for 'Never' even though there are no responses with that value.
Never 0 0
Sometimes 10 50
Always 10 50
PROC MEANS, PROC REPORT and PROC TABULATE all support the use of the PRELOADFMT option that allows you to specify a user-defined format to provide ALL
the -possible- values that you want to see in your report (even if, as in your case, there are no values of 0 in the actual data) and so some of the formatted values will show as 0.
However, PRELOADFMT does not work with PROC FREQ. If you look at examples of PRELOADFMT with either PROC TABULATE or PROC REPORT, you'll probably find an example that will work for you.
These are the expected proportions of race in our outpatient clinic (Afr.Am, Nat.Am, Latino, Other, White). I am testing a subset of the data to see if there is any disparity of race in this subset. The subset contains 0 native American persons. I'd like this information included in the chi sq goodness of fit test (and not combine it with another group). However, I get an error when running this code, because the data only has 4 categories.
I am, at best, an average SAS user, but I thought PROC FREQ was my only option for the one way chi sq (and it does not appear that either PROC TABULATE or PROC REPORT have a chi sq option).
Is there a way to do this, or would I be stuck with combining categories?