Help using Base SAS procedures

suppressing class levels in tabulate

Reply
Occasional Contributor
Posts: 8

suppressing class levels in tabulate

Hi. I'm using proc tabulate. I'm doing a table with variables that are yes/no, and I only want to see the percent who responded yes. by default tabulate wants to display the yeses and the nos.

I used the classdata= option and the exclusive option, but not only does it suppress printing of the 'no' responses, it removes them from percentages (I want the percent of yeses out of the yes/no total).

anyone know how to do this in tabulate?
thanks
Julia
Respected Advisor
Posts: 3,777

Re: suppressing class levels in tabulate

The SUM MEAN and N of a 0/1 indicator variable is COUNT, PERCENT and DENOM. Consider these statements.

[pre]
proc plan ordered seed=705361820;
factors id=14 q=10 resp=1 of 2 random;
output out=resp resp nvals=(0 1);
run;
quit;
proc tabulate;
class Q;
var resp;
tables q,resp*(sum='Count'*f=5. mean='Percent'*f=percent7. n*f=3.);
run;
[/pre]
Occasional Contributor
Posts: 8

Re: suppressing class levels in tabulate

thanks! I'd forgotten about recoding the 0/1 vars to 0/100 and taking the mean. that'll work.
Ask a Question
Discussion stats
  • 2 replies
  • 115 views
  • 0 likes
  • 2 in conversation