Hello,
I need to suppress categories with low frequency values (less than 10) from the output of proc freq. Any tips to me me out would be appreciated.
proc freq order= freq ; table outcome_coded
Generally when I have such a requirement I send the output to a data set, which I then have for reference when the inevitable question comes back later, and just display the desired values in a report.
proc freq data=whatever order=freq noprint; tables outcome_coded / out=outcome_freqs outcum; run; Proc print data=outcome_freqs noobs; where count>10; /* or whatever limit*/ run;
The OUTCUM option means to include the cumulative count and percents. By default they do not appear in the out= data set.
Another approach if you want to show that the category existed but just suppress the count could be done but how you would address the percent values.
Generally when I have such a requirement I send the output to a data set, which I then have for reference when the inevitable question comes back later, and just display the desired values in a report.
proc freq data=whatever order=freq noprint; tables outcome_coded / out=outcome_freqs outcum; run; Proc print data=outcome_freqs noobs; where count>10; /* or whatever limit*/ run;
The OUTCUM option means to include the cumulative count and percents. By default they do not appear in the out= data set.
Another approach if you want to show that the category existed but just suppress the count could be done but how you would address the percent values.
Thanks!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.