Help using Base SAS procedures

FIsher's exact pairwise comparison

Posts: 21

FIsher's exact pairwise comparison

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





Super User
Posts: 10,474

Re: FIsher's exact pairwise comparison

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.

Posts: 21

Re: FIsher's exact pairwise comparison


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,



Super User
Posts: 9,671

Re: FIsher's exact pairwise comparison

data have;
infile cards expandtabs truncover;
input name $ group1	group2	group3;
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;

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

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 .

Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation