BookmarkSubscribeRSS Feed
epi101
Fluorite | Level 6

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!

4 REPLIES 4
subobscure
Obsidian | Level 7

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

 

ChrisBrooks
Ammonite | Level 13

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...

epi101
Fluorite | Level 6

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

ballardw
Super User

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;

sas-innovate-2024.png

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.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 844 views
  • 2 likes
  • 4 in conversation