BookmarkSubscribeRSS Feed
monsterpie
Obsidian | Level 7

Hi everyone, 

 

I have 2 categorical variables: Var1 - 3 levels, Var2- 5 levels (i.e., table is bigger than 2x2). Since I have multiple cells <5, I have run a Fisher's exact test with Monte Carlo estimation for the p value (code and output is below). I understand that if I want to determine which specific cells are not associated, I need to perform a post hoc test, but I'm not sure which test to perform, or how to do this in SAS? From doing some research online, it seems like a Bonferroni correction might be a suitable choice? Any help would be very much appreciated. 

 

CODE:

proc freq data=winter_t1;
title "Fisher's exact with exact option";
tables var1*var2;
exact fisher/mc;
run;

 

OUTPUT:

Statistics for Table of Var1 by Var2

 

Statistic

DF

Value

Prob

Chi-Square

8

434.4255

<.0001

Likelihood Ratio Chi-Square

8

186.6401

<.0001

Mantel-Haenszel Chi-Square

1

92.1028

<.0001

Phi Coefficient

 

0.7704

 

Contingency Coefficient

 

0.6103

 

Cramer's V

 

0.5447

 

WARNING: 27% of the cells have expected counts less
than 5. Chi-Square may not be a valid test.

 

Fisher's Exact Test

Table Probability (P)

<.0001

 

Monte Carlo Estimate for the Exact Test

Pr <= P

<.0001

99% Lower Conf Limit

<.0001

99% Upper Conf Limit

0.0005

 

 

Number of Samples

10000

Initial Seed

814770001

 

Sample Size = 732

1 REPLY 1
SAS_Rob
SAS Employee

You might try one of the suggested approaches in the usage note linked below.

https://support.sas.com/kb/22/565.html 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1719 views
  • 3 likes
  • 2 in conversation