Does anyone know how to do the pairwise comparison for Fisher's exact test?
Thanks,
Momi
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.
|
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
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 .
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.