BookmarkSubscribeRSS Feed
jrushing_wfu
Calcite | Level 5
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
2 REPLIES 2
data_null__
Jade | Level 19
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]
jrushing_wfu
Calcite | Level 5
thanks! I'd forgotten about recoding the 0/1 vars to 0/100 and taking the mean. that'll work.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1283 views
  • 0 likes
  • 2 in conversation