Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Fisher's exact test
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Derivation == <ref>[https://galton.uchicago.edu/~yibi/teaching/stat226/2022/L07.pdf STAT 226: Lecture 7, Section 2.6, Fisher’s Exact Tests.] Yibi Huang, University of Chicago</ref> {| class="wikitable" style="text-align:center;" |- ! ! Class I ! Class II |''Row Total'' |- ! scope="row" | Blue | bgcolor="lightgray" | '''''a''''' || bgcolor="lightgray" | '''''b''''' || ''a + b'' |- ! scope="row" | Red | bgcolor="lightgray" | '''''c''''' || bgcolor="lightgray" | '''''d''''' || ''c + d'' |- | ''Column Total'' | ''a + c'' || ''b + d'' || ''a + b + c + d (=n)'' |} {{Math proof|title=Derivation|proof= We set up the following probability model underlying Fisher’s exact test. Suppose we have <math display="inline">a+b</math> blue balls, and <math display="inline">c+d</math> red balls. We throw them together into a black box, shake well, then remove them one by one until we have pulled out exactly <math display="inline">a+c</math> balls. We call these balls “class I” and the <math display="inline">b+d</math> remaining balls “class II”. The question is to calculate the probability that exactly <math display="inline">a</math> blue balls are in class I. Every other entry in the table is fixed once we fill in one entry of the table. Suppose we pretend that every ball is labelled, and before we start pulling out the balls, we permutate them uniformly randomly, then pull out the first <math display="inline">a+c</math> balls. This gives us <math display="inline">n!</math> possibilities. Of these possibilities, we condition on the case where the first <math display="inline">a+c</math> balls contain exactly <math display="inline">a</math> blue balls. To count these possibilities, we do the following: first select uniformly at random a subset of size <math display="inline">a</math> among the <math display="inline">a+c</math> class-I balls with <math display="inline">\binom{a+c}{a}</math> possibilities, then select uniformly at random a subset of size <math display="inline">b</math> among the <math display="inline">b+d</math> class-II balls with <math display="inline">\binom{b+d}{b}</math> possibilities. The two selected sets would be filled with blue balls. The rest would be filled with red balls. Once we have selected the sets, we can populate them with an arbitrary ordering of the <math display="inline">a+b</math> blue balls. This gives us <math display="inline">(a+b)!</math> possibilities. Same for the red balls, with <math display="inline">(c+d)!</math> possibilities. In full, we have <math display="block">\binom{a+c}{a}\binom{b+d}{b}(a+b)!(c+d)!</math> possibilities. Thus the probability of this event is <math display="block">\frac{\binom{a+c}{a}\binom{b+d}{b}(a+b)!(c+d)!}{n!}=\frac{\binom{a+c}{a}\binom{b+d}{b}}{\binom{n}{a+b}}</math> }} Another derivation: {{Math proof|title=Derivation|proof= Suppose each blue ball and red ball has an equal and independent probability <math display="inline">p</math> of being in class I, and <math display="inline">1-p</math> of being in class II. Then the number of class-I blue balls is binomially distributed. The probability there are exactly <math display="inline">a</math> of them is <math display="inline">\binom{a+b}{a}p^a(1-p)^b</math>, and the probability there are exactly <math display="inline">c</math> of red class I balls is <math display="inline">\binom{c+d}{c}p^c(1-p)^d</math>. The probability that there are precisely <math display="inline">a+c</math> of class I balls, regardless of number of red or blue balls in it, is <math display="inline">\binom{n}{a+c}p^{a+c}(1-p)^{b+d}</math>. Thus, conditional on having <math display="inline">a+c</math> class I balls, the conditional probability of having a table as shown is <math display="block">\frac{\binom{a+c}{a}\binom{b+d}{b}}{\binom{n}{a+b}}</math> }}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)