Fisher exact and Fisher-Freeman-Halton test
fisher_exact_testCalculate exact p-values for contingency tables, including 2x2 Fisher and larger Fisher-Freeman-Halton tests, with chi-square diagnostics for low expected counts.
Instructions
Exact p-value for a contingency table of counts. 2x2: Fisher exact test (two-sided, greater or less, as R fisher.test). Larger r x c tables (for example 3 variants x converted/not, or 4 x 4 survey tables): Fisher-Freeman-Halton exact test by a network algorithm. Also returns Pearson chi-square and how many cells have expected counts below 5, so you can see when the chi-square approximation is unsafe.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"table": "<table>"
},
"name": "fisher_exact_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Rows of counts, for example [[12, 488], [25, 475]] (rows = groups, columns = outcomes). | |
| alternative | No | One-sided options apply to 2x2 only; greater = odds ratio above 1. | two-sided |