Help using Base SAS procedures

Statistics procedure for sample percentages

Reply
Contributor
Posts: 20

Statistics procedure for sample percentages

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
Trusted Advisor
Posts: 2,116

Re: Statistics procedure for sample percentages

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;
Ask a Question
Discussion stats
  • 1 reply
  • 108 views
  • 0 likes
  • 2 in conversation