proc freq data=test; tables var1; format var1 var1_fmt.; run;
----- Resulting output:
var1 Frequency Percent N/A 2 18.18 Very Poor 3 27.27 Average 5 45.45 Very Good 1 9.09
------ Is there a way to make the resulting proc freq output show all of the values listed in the proc format? I.e. I would like the output to look something like this:
var1 Frequency Percent N/A 2 18.18 Very Poor 3 27.27 Poor 0 0 Average 5 45.45 Good 0 0 Very Good 1 9.09
The only thing I can think of is to output the proc freq to a dataset, add the "missing" values for var1, and do a proc print.
To clarify my question, the "missing" option is not what I am after. Since a value of 2 and 4 do not exist in the dataset, Proc Freq simply doesn't "know" about them. I need to tell Proc Freq to expect values 0 through 5 and if it doesn't find a value in that range, display it anyway.
Jared
On Aug 24, 11:38 am, webonomic <webono...@gmail.com> wrote:
> var1 Frequency Percent > N/A 2 18.18 > Very Poor 3 27.27 > Average 5 45.45 > Very Good 1 9.09
> ------ > Is there a way to make the resulting proc freq output show all of the > values listed in the proc format? I.e. I would like the output to > look something like this:
> var1 Frequency Percent > N/A 2 18.18 > Very Poor 3 27.27 > Poor 0 0 > Average 5 45.45 > Good 0 0 > Very Good 1 9.09
> The only thing I can think of is to output the proc freq to a dataset, > add the "missing" values for var1, and do a proc print.
> var1 Frequency Percent > N/A 2 18.18 > Very Poor 3 27.27 > Average 5 45.45 > Very Good 1 9.09
> ------ > Is there a way to make the resulting proc freq output show all of the > values listed in the proc format? I.e. I would like the output to > look something like this:
> var1 Frequency Percent > N/A 2 18.18 > Very Poor 3 27.27 > Poor 0 0 > Average 5 45.45 > Good 0 0 > Very Good 1 9.09
> The only thing I can think of is to output the proc freq to a dataset, > add the "missing" values for var1, and do a proc print.
> var1 Frequency Percent > N/A 2 18.18 > Very Poor 3 27.27 > Average 5 45.45 > Very Good 1 9.09
> ------
I thought I'd post a followup to this question. I came across a SAS knowledge base article that shows how to solve this same problem using Proc Tabulate. http://support.sas.com/techsup/technote/ts278.html
> Is there a way to make the resulting proc freq output show all of the > values listed in the proc format? I.e. I would like the output to > look something like this:
> var1 Frequency Percent > N/A 2 18.18 > Very Poor 3 27.27 > Poor 0 0 > Average 5 45.45 > Good 0 0 > Very Good 1 9.09
> The only thing I can think of is to output the proc freq to a dataset, > add the "missing" values for var1, and do a proc print.