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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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