BookmarkSubscribeRSS Feed
jawon
Fluorite | Level 6
This is a SAS proc question, but at the core a statistics question.

I've used proc ttest and other statistical procedures for comparing averages of different groups. But what proc would I use to compare "sample percentages"? I'm guessing it may depend on how my data is laid out, so I'll provide a couple possibilities...

1. DETAILED data
Team Person_id Cancelled_flag
A 123 Y
A 456 N
B 789 Y
B 555 Y

2. Or SUMMARIZED data
Team Total_count Cancelled_count
A 100 40
B 120 50
1 REPLY 1
Doc_Duke
Rhodochrosite | Level 12
PROC FREQ will do both of these.

1) is the natural way.

PRC FREQ; TABLES team*cancelled_flag/chisq; RUN;

2) requires data in slightly different format

team cancelled_flag count
a y 40
a n 60
b y 50
b n 70

Then the proc looks like
PROC FREQ;
TABLES team*cancelled_flag/CHISQ;
WEIGHT count;
RUN;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 1001 views
  • 0 likes
  • 2 in conversation