Help using Base SAS procedures

Individual Counts Supression

Reply
Occasional Contributor
Posts: 5

Individual Counts Supression

Hi, 

 

I am looking for a way to supress individuals counts when running proc freq. I used proc format and it suppress the individual count but it doesnt change the total and the row percents. 

 

So far my code is 

 

proc format;
value hide

1-5='*'
other=[comma8.];
run;


proc freq data=mydataname;
table var1* var2 format=hide.;
run;

 

Thanks!

Occasional Contributor
Posts: 11

Re: Individual Counts Supression

Use option NOROW and NOCOL to supress row counts and column counts.

 

TABLES var1*var2  norow nocol;

I couldn't get a clear idea as to what you wanted in your output.

However, the following are the options available:-

 

NOCOL suppresses the column percentages in cells of the crosstabulation table.

 


NOCUM 
suppresses the cumulative frequencies and cumulative percentages for one-way frequency tables and for frequencies in list format.


NOFREQ 
suppresses the cell frequencies for a crosstabulation table. This also suppresses frequencies for row totals. 

 

NOPERCENT suppresses the cell percentages, the row total percentages, and the column total percentages for a crosstabulation table. For one-way frequency tables and frequencies in list format, suppresses the percentages and the cumulative percentages.

 

NOPRINT suppresses the frequency and crosstabulation tables, but displays all requested tests and statistics.

 

NOROW suppresses the row percentages in cells of the crosstabulation table.

 

You can consult the SAS documentation for more details and explanations

https://v8doc.sas.com/sashtml/proc/zlesstmt.htm

 

Valued Guide
Posts: 591

Re: Individual Counts Supression

Posted in reply to subobscure

I suspect the OP is looking for disclosure testing in which case I think writing the Proc Freq output to a data set and then processing the output to adjust the totals is the only way to do it. Of course it may be easier just to omit the Proc Freq and do the whole thing in one pass...

Occasional Contributor
Posts: 5

Re: Individual Counts Supression

Posted in reply to ChrisBrooks

Thanks for the information!  Perhaps using a macro to suppress the data might be better idea?

Super User
Posts: 13,498

Re: Individual Counts Supression

Since you don't show any input data or what the result should look like this is a guess, only process data where both var1 and var2 are in the range of 1 to 5.

 

proc freq data=mydataname;
where var1 in (1:5) and var2 in (1:5);
table var1* var2 ;
run;
Ask a Question
Discussion stats
  • 4 replies
  • 148 views
  • 2 likes
  • 4 in conversation