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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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