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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 1149 views
  • 0 likes
  • 2 in conversation