Fisher's Exact Test Calculator for a 2 by 2 Table: p-Value and Odds Ratio
An exact test for small 2 by 2 tables.
Engineering student calculators
Free textbook calculators with every step shown, so you can check your own working. Pick one, type in your numbers and see the formulas worked out. Or switch to Ask a question for an explained answer. No account needed.
Calculated from standard textbook formulas, with every step shown. The formulas are fixed, so the working does not need checking: what matters is the numbers you type in. Use these calculators only if you are competent to choose the inputs (loads, material strength, dimensions, supports) and check your units and assumptions. For learning and checking your own working: design and sign-off are for a qualified engineer. Drafting Central does not store the numbers you type.
How this calculator works
Enter the four counts of the table.
Enter the significance level.
The calculator gives the exact p-values, the odds ratio and its interval, and a statement of the conclusion.
Formulas used
- P = \frac{\binom{r_1}{a}\binom{r_2}{c}}{\binom{N}{c_1}}
- OR = \frac{ad}{bc}
Worked example
With the default numbers in the calculator above:
- Probability of exactly this table, with the row and column totals fixed (hypergeometric): 0.023601
- Two-sided p-value: the total probability of all tables as unlikely or less than this one: 0.034965
- One-sided p-value for more in the first cell (the upper tail): 0.024476
- One-sided p-value for fewer in the first cell (the lower tail): 0.99913
- Sample odds ratio: 20
- 95 percent confidence interval for the odds ratio (Woolf's method): 1.416 to 282.5
Change the numbers in the calculator to see the full working, every step, for your own case.
Common questions
When do I use Fisher's exact test?
For a 2 by 2 table with small counts, when any expected count is below 5 and the chi-square test is not reliable.
What is the odds ratio?
The odds of the outcome in one group divided by the odds in the other. A value of 1 means no association.
What is the difference between one-sided and two-sided?
One-sided tests for an association in one direction only. Two-sided tests for any association.
Related calculators
Got a question about this? Ask an engineering question and get a plain-language answer with references.
Further reading: Any statistics text (exact tests for contingency tables).
Need a calculator we do not have?
Embed this calculator on your own page
Copy this code into your page. The calculator runs inside the frame and links back to Drafting Central.
Need this drawn, designed or checked?
Drafting Central is a mechanical engineering and drafting business working with customers across Australia and around the world. A calculator gives you the numbers; we can turn them into drawings and designs.
Need help with a real project?
Talk to Drafting Central →