BookmarkSubscribeRSS Feed
EddieJackson
Calcite | Level 5

Quick question about the chi square from the surveyfreq command,

 

I'll enter something like the following:

 

PROC SURVEYFREQ DATA= code;
CLUSTER xxxx;
STRATA xxx;
weight xx;
TABLE obesity*gender/chisq;
RUN;

 

I get a chi square result. However if I double check this result with any online 2x2 table calculator, the p-value is different.

 

However if I do a regular PROC FREQ chisquare instead of surveyfreq, the p-value checks out with all those online calculators.

 

Am I doing something wrong with the surveyfreq command? Or is the calculation intrinsically different for a surveyfreq such that it won't check out with the online calculators like regular proc freq does?

 

Thanks

3 REPLIES 3
Watts
SAS Employee

Yes, it's a different statistic. The CHISQ option in PROC SURVEYFREQ provides a Rao-Scott chi-square test, which is a design-adjusted version of the Pearson chi-square test. The Rao-Scott chi-square test takes into account the complex survey design that you specify (in design options and statements -- e.g., STRATA and CLUSTER statements).

 

The CHISQ option in PROC FREQ provides the (unadjusted) Pearson chi-square.

 

For more info, the PROC SURVEYFREQ documentation is here .

 

 

Reeza
Super User
The marjority of online calculators do not take into account the weight and strata components. So the question is really, do you need those components and are you using them correctly.
EddieJackson
Calcite | Level 5

Thanks!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 997 views
  • 0 likes
  • 3 in conversation