BookmarkSubscribeRSS Feed
momi
Obsidian | Level 7

Does anyone know how to do the pairwise comparison for Fisher's exact test?

 

Thanks,

 

Momi

3 REPLIES 3
ballardw
Super User

Provide some example data and the research question. Fisher has more than one test.

But I might guess that you want proc freq with an Exact statement and the Fisher option. You may need to make sure your data is in the correct structure.

momi
Obsidian | Level 7

 

group1 gorup2 goup3
A 7 6 11
B 3 3 6
C 15 1 7
D 0 0 4
E 13 8 14
F 10 2 3

 

Here is the data.  All caterogires are nominal. According to the Fisher's exact test, there is a siginificant relashionship between the gorups and the categories A - F.   Unfortunaly, I can not provide the actual measurement. (Does this matter?)  I was wondering if it would be possible to the pari comparisons of these.

 

Thank you,

 

Momi

Ksharp
Super User
data have;
infile cards expandtabs truncover;
input name $ group1	group2	group3;
cards;
A	7	6	11
B	3	3	6
C	15	1	7
D	0	0	4
E	13	8	14
F	10	2	3
;
proc transpose data=have out=want ;
by name;
var group1-group3;
run;

proc freq data=want;
 weight col1;
 tables name*_name_/chisq;
 exact fisher /mc n=1000000;
run;

you can remove 'mc n=100000' to get the right fisher test,but that  will cost you lots of time.


Monte Carlo Estimate for the Exact Test

Pr <= P 0.0375
99% Lower Conf Limit 0.0370
99% Upper Conf Limit 0.0380

 

therefore, category and group are not independent under alpha=0.05 .

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 2174 views
  • 0 likes
  • 3 in conversation