Fisher Exact Test Calculator

Run Fisher exact test for a 2 x 2 contingency table with exact one-sided or two-sided p-values

Example Results

1 examples

Test association in a 2 x 2 table

Compute an exact p-value for small categorical counts

{
  "result": {
    "pValue": 0.035,
    "oddsRatio": 20,
    "rejectNull": true
  }
}
View input parameters
{ "cellA": 8, "cellB": 2, "cellC": 1, "cellD": 5, "alternative": "two-sided", "alpha": 0.05, "decimalPlaces": 4 }

Key Facts

Category
Math, Date & Finance
Input Types
number, select
Output Type
json
Sample Coverage
4
API Ready
Yes

Overview

The Fisher Exact Test Calculator provides a precise statistical analysis for 2x2 contingency tables, determining the significance of the association between two categorical variables. Unlike the Chi-square test, this tool calculates exact p-values, making it the standard choice for small sample sizes where asymptotic approximations are unreliable.

When to Use

  • When analyzing categorical data in a 2x2 contingency table with small sample sizes.
  • When any expected cell frequency in a contingency table is less than five.
  • When you need an exact p-value rather than an approximation for hypothesis testing.

How It Works

  • Enter the observed frequencies into the four cells (A, B, C, and D) of the 2x2 contingency table.
  • Select the alternative hypothesis (two-sided, greater than, or less than) and set your significance level (alpha).
  • The tool calculates the probability of the observed distribution and more extreme cases using the hypergeometric distribution.
  • Review the resulting p-value and odds ratio to determine if the null hypothesis should be rejected based on your alpha.

Use Cases

Comparing the success rate of two different medical treatments in a small clinical trial.
Analyzing the relationship between a specific gene mutation and the presence of a rare disease.
Evaluating the effectiveness of two different marketing A/B test variations with low conversion counts.

Examples

1. Small Sample Clinical Trial

Medical Researcher
Background
A researcher is testing a new drug on a group of 10 patients and a placebo on 6 patients.
Problem
The sample size is too small for a Chi-square test to be statistically valid.
How to Use
Input 8 (Drug Success), 2 (Drug Failure), 1 (Placebo Success), and 5 (Placebo Failure) into the cells.
Example Config
cellA: 8, cellB: 2, cellC: 1, cellD: 5, alternative: 'two-sided', alpha: 0.05
Outcome
The tool returns a p-value of 0.035, indicating a statistically significant difference between the drug and placebo.

2. Manufacturing Quality Control

Lab Technician
Background
A technician compares defect rates between two small production batches.
Problem
Batch A has 1 defect in 20 items, while Batch B has 4 defects in 18 items.
How to Use
Enter 19 (Batch A Pass), 1 (Batch A Fail), 14 (Batch B Pass), and 4 (Batch B Fail) into the table.
Example Config
cellA: 19, cellB: 1, cellC: 14, cellD: 4, alternative: 'less', alpha: 0.05
Outcome
The calculator determines if the lower defect rate in Batch A is statistically significant compared to Batch B.

Try with Samples

math-&-numbers

FAQ

What is the difference between Fisher's Exact Test and Chi-square?

Fisher's test provides an exact p-value based on the hypergeometric distribution, while Chi-square uses an approximation that is often inaccurate for small samples.

Can I use this for tables larger than 2x2?

No, this specific calculator is designed exclusively for 2x2 contingency tables.

What does the 'Greater Than' alternative hypothesis test?

It tests if the proportion of successes in the first group is significantly larger than the proportion in the second group.

What is the significance of the Odds Ratio?

The odds ratio quantifies the strength of the association between the two categorical variables, indicating how much more likely an outcome is in one group versus another.

What is a typical Alpha value for this test?

Most researchers use 0.05 as the standard threshold for determining statistical significance.

API Documentation

Request Endpoint

POST /en/api/tools/fisher-exact-test-calculator

Request Parameters

Parameter Name Type Required Description
cellA number No -
cellB number No -
cellC number No -
cellD number No -
alternative select No -
alpha number No -
decimalPlaces number No -

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-fisher-exact-test-calculator": {
      "name": "fisher-exact-test-calculator",
      "description": "Run Fisher exact test for a 2 x 2 contingency table with exact one-sided or two-sided p-values",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=fisher-exact-test-calculator",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]