"Using percentages to apply Fisher's exact test I have a 2*2 contingency table, but the total sample size is too large to be able to directly apply Fisher's exact test (as it involves factorials, so I'll obtain NaN or infinity). Data are like that: A=1 A=0 B=1 10000 6900 B=0 89333 120033 I know I could use chi.square instead, but I wanted to provide Fisher's exact test results. Among other reasons, because calculating left and right p-values of Fisher's exact test I can have the probabilities of positive or negative associations between variables.

Aydin Jarvis

Aydin Jarvis

Answered question

2022-10-18

Using percentages to apply Fisher's exact test
I have a 2 × 2 contingency table, but the total sample size is too large to be able to directly apply Fisher's exact test (as it involves factorials, so I'll obtain NaN or infinity). Data are like that:
A=1 A=0
B=1 10000 6900
B=0 89333 120033
I know I could use chi.square instead, but I wanted to provide Fisher's exact test results. Among other reasons, because calculating left and right p-values of Fisher's exact test I can have the probabilities of positive or negative associations between variables.
Could it be appropiate and acceptable to firstly transform the contingency table in percentajes, so sample size=100, then apply Fisher's exact test?

Answer & Explanation

Ostrakodec3

Ostrakodec3

Beginner2022-10-19Added 18 answers

Well, as BruceET commented, using percentages in turn of real data to apply Fisher's test does not seem accurate.
In turn I think I found a possible solution to be able to calculate Fisher's test even for large numbers, using gammaln function. In this way, I can work with the logarithm of factorials in turn of factorials themselves.
This makes quite easier to calculate Fisher's test even for large numbers.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in High school probability

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?