Categorical Data and Proportions
Fisher's Exact Test
Fisher's exact test checks whether two yes/no variables are related.
Fisher's exact test takes a two-by-two table of counts, such as a yes/no outcome in two groups, and tests whether the variables are related, with exact probabilities that hold in small samples.
Do booster sessions of cognitive therapy lower the chance of a depression relapse? In a pilot trial, 30 adults recovering from depression were randomly assigned to monthly booster sessions or usual care, 15 each, and we recorded who relapsed within a year.
- Tests
- Odds ratio in a 2 × 2 table
- Observations
- Independent
- Parametric
- No
- Headline Statistic
- p
- Effect Size
- Odds Ratio
- Groups
- 2
The Basics
When to Use It
Use Fisher's exact test (also called the Fisher–Irwin test) when you have two independent groups and a yes/no outcome (or any two yes/no variables), counted into a 2 × 2 table, and the sample is small. Because it's exact and never too liberal, it's a safe default for small tables. The traditional rule, chi-square only when every expected frequency is 5 or more, is stricter than it needs to be: for 2 × 2 tables, the “N − 1” chi-square holds its error rate whenever every expected count is at least 1 (Campbell, 2007). Choose one test in advance and report it. Fisher's test is valid for large samples too. To compare one group's rate with a fixed value in a small sample, the exact counterpart is the exact binomial test (binom.test in R). For example:
- Do booster sessions of cognitive therapy lower the chance of a depression relapse?
- Among 28 students with test anxiety, are those who tried expressive writing before the exam more likely to pass it?
- Of 32 volunteers, are those told to count basketball passes less likely to notice the gorilla in the video?
Vocabulary You Need
Definition Contingency Table
A table that cross-classifies people on two categorical variables, one along the rows and one along the columns, so each cell counts the people with that combination. The row and column totals (the margins) show how each variable is spread on its own; the cells show how the two go together. Tables are described by their size, rows × columns, such as a 2 × 3 table. Glossary →
Definition Expected Frequency (E)
The count the null hypothesis predicts for a cell. For one group compared with a fixed proportion it's n × π₀. In a test of independence it's the row total times the column total divided by the total sample size, so each row is spread across the columns in the same proportions as everyone combined. Other tests have their own; McNemar's test, for instance, expects the people who switched to split evenly between the two directions. It's an average, so it needn't be a whole number. Chi-square tests are only accurate when expected frequencies aren't too small. Glossary →
Definition Hypergeometric Distribution
The probabilities of every possible count when a fixed number of items is drawn without replacement, like dealing cards from a deck. For a 2 × 2 table with its marginal totals fixed, it gives the exact chance of each possible table if the two variables are unrelated: the “yes” cases are spread over the groups as if by a random draw. Glossary →
Definition Odds Ratio (\text{OR})
One group's odds of an outcome divided by another group's. 1 means the odds are the same, 2 means the first group's odds are twice as high, and 0.5 means half as high; 0.5 and 2 are equally strong, in opposite directions. It's the usual effect size for a 2 × 2 table of two separate groups and what logistic regression reports. When the same people answer twice, as in McNemar's test, the paired odds ratio is different: it compares the people who switched one way with those who switched the other. It compares odds, not chances: when an outcome is common, the odds ratio is further from 1 than the ratio of the two proportions. A single zero cell, with the other counts positive, makes it 0 or infinite; more than one zero can leave it undefined. Glossary →
Assumptions and Inference
1. Independent Observations (for the p-Value and Interval) The people (or other units) in your study don't influence each other.
- What It Means
- Each person's data comes from a separate, unconnected source, so knowing one person's scores tells you nothing about anyone else's. In designs that measure people more than once, their own scores are meant to be related; it's different people who must be independent. Methods built for clustered data, such as multilevel models and GEE, also allow members of the same group to be related, as long as the analysis names the grouping; then it's the groups that must be independent.
- Applies To
- Observations
- How to Check
- By design, not by a test. Did each person contribute their own data, with no clusters such as roommates, couples, therapy groups or classrooms whose members influence each other? If there are clusters, does the analysis model every one of them?
- How Much It Matters
- A lot. The table's probabilities assume each count is a separate person. People counted twice, or clustered in a way that makes their outcomes alike (members of one therapy group), make p come out too small.
What to Do
- Design Change Make sure each person appears once, in one group, with one outcome.
- Alternative Test McNemar's Test. If the same people were measured twice, their paired yes/no answers need McNemar's test.
- Alternative Test Multilevel Logistic Regression. If people come in clusters, a multilevel logistic regression accounts for the clustering.
2. Conditioning on the Observed Totals (for the p-Value) The test works out exact probabilities while holding the observed row and column totals fixed. The study doesn't have to fix both in advance: in our trial the group sizes were planned, but the eight relapses were observed.
- What It Means
- The test works out its probabilities with both sets of totals held at their observed values: the group sizes and the total number with the outcome. In a randomized study that's justified: if the treatment changed no one's outcome, the same people would have the outcome whichever group they were assigned to, so that total is fixed and only the split is left to chance. In other designs, holding the outcome total fixed is a standard way to set aside the overall outcome rate, which says little about the relationship, though statisticians still debate it (Agresti, 1992).
- Applies To
- Observations
- How to Check
- By design: were people randomly assigned to the groups? Then fixing the totals follows from the null hypothesis. If not, the test is still standard; just know it conditions on totals the study didn't set.
- How Much It Matters
- Not in the risky direction. Holding the totals fixed leaves only a few possible tables, so p can take only a few values and the real false-positive rate usually sits below α (here .035 at α = .05). The cost is power, not false positives (Agresti, 1992).
What to Do
- Proceed with Caveat The standard choice. Say the test is conservative, and let the odds ratio and its interval carry the size of the effect.
- Correction Count only half the probability of tables exactly as likely as yours (the mid-p value). That smooths over the few possible values of p and brings the false-positive rate closer to α (Agresti, 1992), but it no longer guarantees staying under it.
- Alternative Test An unconditional exact test that fixes only the group sizes, so far more tables are possible and p can take many more values. It's usually more powerful for a 2 × 2 table (scipy's boschloo_exact).
Limitations
This Is Not Your Test If…
- You measured the same people twice (yes/no, before and after) McNemar's Test →
- Your table is bigger than 2 × 2, with adequate expected counts Pearson Chi-Square Test →
- Your outcome is a score, not a category t-Tests →
- You need to adjust for other variables Logistic Regression →
- You're comparing one group's rate with a fixed value Binomial Test →
- Your people come in clusters, like therapy groups Multilevel Logistic Regression →
What It Doesn't Tell You
- How big. The test says a split this uneven would be rare if boosters made no difference; the interval (an odds ratio anywhere from 1.27 to 118.36) says the data can't pin down how big the benefit is.
- Whether it matters. Significance doesn't make one relapse in 15 versus seven in 15 a dependable clinical benefit. That takes a larger trial and a judgment about cost and burden.
- Who else. Thirty volunteers from one pilot represent people like them, recently recovered and willing to join a trial, not everyone with depression.
- That there's no effect, if p had been above .05. With 15 per group, even a sizable real benefit often comes out non-significant (see Power and Sample Size below), so a non-significant pilot would have been inconclusive.
Common Mistakes
-
Don'tRun both Fisher's test and a chi-square test and report whichever p is smaller.
InsteadChoose the test from the design and the expected counts before you look at p.
-
Don'tSwitch to a one-sided p because the result went the way you hoped.
InsteadUse a one-sided test only if you fixed the direction before collecting data and a result in the other direction wouldn't count toward your claim, and say so. In a clinical trial, harm usually matters even when you expect benefit, so two-sided is the default, as here.
-
Don'tDouble a one-sided Fisher's p to get the two-sided one.
InsteadReport the two-sided p your software computes; the two tails aren't always the same size.
-
Don'tReport only p from a small study.
InsteadReport the counts, both percentages and the odds ratio with its interval, which shows how imprecise it is.
-
Don'tRead an odds ratio of 3 as “three times as likely.”
InsteadSay “three times the odds,” and give the two percentages so readers can see the actual chances.
-
Don'tRead a p-value as the chance that the null hypothesis is true.
InsteadRead it as: if the null were true, how often data at least this extreme would turn up.
Result Decoder
Significance and Effect Size Guidelines
Benchmarks Significance (p Value)
-
p < .001
Very strong evidence against the null hypothesis.
-
.001 ≤ p < .01
Strong evidence against the null hypothesis.
-
.01 ≤ p < .05
Statistically significant at α = .05. Moderate evidence against the null hypothesis.
-
.05 ≤ p < .10
Not significant. Weak evidence; sometimes called a “trend.” Treat it as inconclusive.
-
p ≥ .10
Not significant. Little evidence against the null, which is not the same as evidence of no effect.
These evidence labels are one common convention for describing p in graded language rather than as significant or not; the boundaries are rough guides, not rules, and other authors draw them differently. Muff et al. (2022) argue for this kind of language of evidence over a single cutoff. α is chosen before the analysis, and p never says how big or important an effect is.
Benchmarks Effect Size (Odds Ratio)
-
OR = 1
No Difference
Both groups have the same odds of the outcome.
-
OR > 1
Higher Odds
The group in the numerator (here usual care) has higher odds of the outcome.
-
0 < OR < 1
Lower Odds
The group in the numerator has lower odds. Flip the comparison and it becomes 1 ÷ OR: 0.08 and 12.25 are the same result.
-
Further from 1, multiplicatively
Stronger Difference in Odds
Values like 4 and 0.25 represent equally strong differences in opposite directions. The size of the difference in actual risk still depends on the two probabilities.
Odds ratios have no generally accepted small, medium and large cutoffs: what an odds ratio means in practice depends on the baseline risk and the setting. Chen, Cohen and Chen (2010) matched 1.68, 3.47 and 6.71 to Cohen's d = 0.2, 0.5 and 0.8, but only when 1% of the comparison group has the outcome; they aren't general odds-ratio standards. Read the size from the two percentages.
How It's Reported
Equation Form
1 of 15 (7%) vs. 7 of 15 (47%) relapsed, OR = 12.25, 95% CI [1.27, 118.36], Fisher's exact p = .035
Full Text (APA Style)
One of the 15 patients who received booster sessions (7%) relapsed within a year, compared with 7 of the 15 in usual care (47%). The odds of relapse were 12.25 times as high under usual care, 95% CI [1.27, 118.36]. A two-sided Fisher's exact test showed the difference was statistically significant, p = .035.
- Give the counts and percentages for both groups. In a study this small, the table is the result.
- Say which way the odds ratio runs: usual care relative to boosters (12.25), or boosters relative to usual care (0.08).
- Name the test and the kind of p (two-sided Fisher's exact). There's no test statistic or df to report.
- Say how the interval was computed. This page uses Woolf's log method; R reports a different, exact interval. Neither is guaranteed to agree with Fisher's p about whether 1 is plausible, so if yours doesn't, say so.
Reading Each Piece
The equation form above, piece by piece, in this order: how big, how certain, then how surprising.
| OR = 12.25 | The odds of relapse were 12.25 times as high under usual care as with booster sessions (read the other way, 0.08). That's far from 1, but odds ratios run far from 1 when an outcome is common. Relapse was 7 times as likely (47% vs. 7%), not 12 times, so lean on the percentages for size. With 30 patients it's a rough estimate anyway, as the interval shows. Benchmarks ↑ |
| 95% CI [1.27, 118.36] | The true odds ratio could plausibly be anything from 1.27 (barely above 1) to 118.36. The whole range is above 1, so the data favor boosters, but they can't tell a slight benefit from a huge one. This is Woolf's approximate interval; with a single relapse among the boosters its coverage may be unreliable, and an exact conditional interval ([1.13, 588.26]) is another option. Say which you used. |
| p = .035 | If boosters made no difference, the 8 relapses would split between the groups at least this unevenly (in either direction) about 3.5% of the time. That's below .05, so the result is statistically significant. But the effect is poorly estimated. The study gives evidence of a difference while leaving a lot of uncertainty about how large it is, as the odds ratio's wide interval shows. Benchmarks ↑ |
Calculations
The Running Example
The relapse study: 30 adults recently recovered from depression, 15 given monthly booster sessions and 15 usual care, each recorded as relapsed or not within a year.
- Null Hypothesis:
- \text{OR} = 1
- Alternative (Two-Sided):
- \text{OR} \neq 1
\text{OR} is the population odds ratio, the odds of relapse under usual care divided by the odds with booster sessions. 1 means boosters make no difference to relapse. Our sample's 12.25 estimates it.
What Your Data Should Look Like
One row per person, with two category columns: which group they were in and whether the outcome happened (here coded 1 = relapsed, 0 = stayed well). Software counts the rows into a 2 × 2 contingency table; the group averages of a 0/1 column are the shares who relapsed. The relapse study's 30 rows count up to:
| Relapsed | Stayed Well | Total | |
|---|---|---|---|
| Booster sessions | 1 | 14 | 15 |
| Usual care | 7 | 8 | 15 |
| Total | 8 | 22 | 30 |
| participant | group | relapsed |
|---|---|---|
| 1 | booster | 0 |
| 2 | booster | 0 |
| 3 | booster | 0 |
| 4 | usual_care | 0 |
| 5 | booster | 0 |
| 6 | usual_care | 1 |
| … 24 more rows | ||
Napkin Math
The whole test, one idea at a time. Under each heading, a line says why the step matters, and the green note reads the equation in plain English with the relapse study's numbers. Collapse all to read just the headings: they tell the whole story on their own.
-
1. Find the Share of Each Group Who Relapsed
Start with the plain comparison, what fraction of each group relapsed. Everything after this asks how big that gap is and whether chance could explain it.
\hat{p} = \dfrac{\text{relapsed}}{n} =\dfrac{1}{15} \text{ and } \dfrac{7}{15}\hat{p}_{\text{booster}} = .07
\hat{p}_{\text{usual}} = .47
\hat{p} is a group's share who relapsed and n is its 15 patients. 1 ÷ 15 = .07 with boosters and 7 ÷ 15 = .47 with usual care, a gap of 40 percentage points.
-
2. Work Out How Many Relapses We'd Expect If Boosters Made No Difference
If boosters didn't matter, the 8 relapses would tend to split evenly between the two equal groups, not 1 and 7 as we observed. Expected counts this small are why many researchers prefer exact probabilities to an approximation.
E = \dfrac{\text{row total} \times \text{column total}}{N} =\dfrac{15 \times 8}{30}= 4.00
The row total is a group's 15 patients, the column total is all 8 relapses, and N is our 30 patients. 15 × 8 ÷ 30 = 4 expected relapses per group, below the traditional rule of 5 for the chi-square test. (The stayed-well cells expect 15 × 22 ÷ 30 = 11.)
-
3. Turn Each Group's Relapse Rate into Odds
The standard effect size for a 2 × 2 table compares odds rather than percentages. Odds count how many relapsed for every one who stayed well.
\text{odds} = \dfrac{\hat{p}}{1 - \hat{p}} =\dfrac{1}{14} \text{ and } \dfrac{7}{8}\text{odds}_{\text{booster}} = 0.071
\text{odds}_{\text{usual}} = 0.875
\hat{p} / (1 - \hat{p}) is the same as relapsed ÷ stayed well. With boosters that's 1 ÷ 14 = 0.071, or 1 to 14. With usual care it's 7 ÷ 8 = 0.875, or 7 to 8.
-
4. Compare the Two Groups' Odds
Dividing one group's odds by the other's gives a single number for how strongly group and relapse are linked. An odds ratio of 1 would mean no difference.
\text{OR} = \dfrac{\text{odds}_1}{\text{odds}_2} =\dfrac{7/8}{1/14} = \dfrac{7 \times 14}{8 \times 1}= 12.25
\text{odds}_1 is usual care's 7 to 8 and \text{odds}_2 is the boosters' 1 to 14. 98 ÷ 8 = 12.25, so the odds of relapse were about 12 times as high without boosters.
-
5. Give a Range of Plausible Values for the True Odds Ratio
Eight relapses is very little information, so the estimate is imprecise. The range is built on the log scale, where odds ratios are symmetric, and then turned back.
\exp\!\left(\ln \text{OR} \pm 1.96\sqrt{\tfrac{1}{a} + \tfrac{1}{b} + \tfrac{1}{c} + \tfrac{1}{d}}\right) =\exp\!\left(2.506 \pm 1.96\sqrt{\tfrac{1}{1} + \tfrac{1}{14} + \tfrac{1}{7} + \tfrac{1}{8}}\right)= [1.27, 118.36]
\ln \text{OR} is ln 12.25 = 2.506, and a to d are our four counts, 1, 14, 7 and 8, whose square-root term is 1.157. 1.96 is the multiplier for 95% confidence from the normal curve. 1.96 × 1.157 = 2.268, so the log range is 0.237 to 4.774, and exp turns it into 1.27 to 118.36. A ± range works on the log scale because there odds ratios of 0.5 and 2 become −0.69 and 0.69, equally far from 0 (no difference); on the ordinary scale they aren't.
-
6. Fix the Totals and List Every Table That Could Have Happened
Fisher's idea is to keep the group sizes and the total number of relapses exactly as observed, and ask only how those relapses could have been split between the groups. We didn't know in advance which patients, or how many, would relapse. For the test, we keep the eight relapses that happened and ask all the ways they could have been shared between the two groups of 15.
x \in \{0, 1, 2, \dots, 8\}\text{tables} = 9
x is the number of relapses in the booster group. With 8 relapses in all and 15 patients per group, x could be anything from 0 to 8, so there are 9 possible tables. We saw x = 1.
-
7. Work Out How Likely Each Table Is If Boosters Made No Difference
If boosters didn't matter, which 8 patients relapsed is like drawing 8 names at random from all 30. Counting the ways to draw each split gives its exact probability, the hypergeometric distribution.
P(x) = \dfrac{\binom{n_1}{x}\binom{n_2}{m - x}}{\binom{N}{m}} =\dfrac{\binom{15}{1}\binom{15}{7}}{\binom{30}{8}} = \dfrac{15 \times 6435}{5{,}852{,}925}P(x = 1) = .0165
\binom{15}{1} = 15 ways to pick the one booster relapse, times \binom{15}{7} = 6,435 ways to pick usual care's 7, out of \binom{30}{8} = 5,852,925 ways to pick any 8. 96,525 ÷ 5,852,925 = .0165, about 1 in 61.
-
8. Add Up Every Table at Least as Unlikely as Ours
p is the chance of a table as surprising as ours or more so. “As surprising” means no more likely than ours, in either direction. We don't simply double our table's probability: we add up every possible table that is no more likely than ours, on either side.
p = \sum_{P(\text{table}) \,\le\, P(\text{observed})} P(\text{table}) =P(0) + P(1) + P(7) + P(8)= .035
The tables no more likely than our .0165 are x = 0 and 1 (boosters did as well or better) and x = 7 and 8 (boosters did just as much worse). .0011 + .0165 + .0165 + .0011 = .035, about 1 in 28.
Run It in Software
The code below reads the running example's data from data.csv; save it in the same folder you run the code from.
SPSS (version 30, as documented by IBM)
- Analyze → Descriptive Statistics → Crosstabs.
- Move
groupinto Row(s) andrelapsedinto Column(s). - Click Statistics, check Chi-square and Risk, and click Continue.
- Click Cells, check Observed and Expected counts and Row percentages, and click Continue. Click OK.
For a 2 × 2 table, checking Chi-square is enough: SPSS adds a Fisher's Exact Test row automatically.
Or paste this syntax:
CROSSTABS /TABLES=group BY relapsed /FORMAT=AVALUE TABLES /STATISTICS=CHISQ RISK /CELLS=COUNT EXPECTED ROW /COUNT ROUND CELL.
Reading the Output
Read the tables in this order: the Crosstabulation (counts and percentages), the Odds Ratio in Risk Estimate, then the Fisher's Exact Test row of Chi-Square Tests, Exact Sig. (2-sided).
group * relapsed Crosstabulation
| group | relapsed = 0 | relapsed = 1 | Total | |
|---|---|---|---|---|
| booster | Count | 14 | 1 | 15 |
| Expected Count | 11.0 | 4.0 | 15.0 | |
| % within group | 93.3% | 6.7% | 100.0% | |
| usual_care | Count | 8 | 7 | 15 |
| Expected Count | 11.0 | 4.0 | 15.0 | |
| % within group | 53.3% | 46.7% | 100.0% | |
| Total | Count | 22 | 8 | 30 |
Risk Estimate
| Value | 95% CI Lower | Upper | |
|---|---|---|---|
| Odds Ratio for group (booster / usual_care) | 12.250 | 1.268 | 118.362 |
| For cohort relapsed = 0 | 1.750 | 1.070 | 2.863 |
| For cohort relapsed = 1 | .143 | .020 | 1.024 |
SPSS's odds ratio is for the first column, relapsed = 0: the boosters' odds of staying well over usual care's. That's the same 12.25 as the page's odds of relapse, usual care over boosters, with the same Woolf interval.
Chi-Square Tests
| Value | df | Asymptotic Significance (2-sided) | Exact Sig. (2-sided) | Exact Sig. (1-sided) | |
|---|---|---|---|---|---|
| Pearson Chi-Square | 6.136ᵃ | 1 | .013 | ||
| Continuity Correctionᵇ | 4.261 | 1 | .039 | ||
| Likelihood Ratio | 6.719 | 1 | .010 | ||
| Fisher's Exact Test | .035 | .018 | |||
| Linear-by-Linear Association | 5.932 | 1 | .015 | ||
| N of Valid Cases | 30 |
a. 2 cells (50.0%) have expected count less than 5. The minimum expected count is 4.00. b. Computed only for a 2x2 table
Footnote a flags small expected counts: by the traditional rule of 5, the uncorrected Pearson chi-square may be somewhat liberal here. Continuity Correction is Yates's adjusted chi-square; it's usually more conservative than it needs to be, so don't use it as a stand-in for Fisher's test. The Linear-by-Linear Association row is the “N − 1” chi-square, which holds up better with small counts (Campbell, 2007). If you chose Fisher's test, read only its row, and use its two-sided value unless you predicted the direction in advance.
Output laid out from this page's computed results, not captured from a live run; labels and layout may differ slightly in your version.
R
relapse <- read.csv("data.csv")
tab <- table(relapse$group, relapse$relapsed)
tab
fisher.test(tab)
0 1
booster 14 1
usual_care 8 7
Fisher's Exact Test for Count Data
data: tab
p-value = 0.03518
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
1.125376 588.264466
sample estimates:
odds ratio
11.26219
The p matches. The odds ratio doesn't: R reports the conditional estimate (11.26) with an exact interval [1.13, 588.26], not the sample odds ratio (12.25) with Woolf's interval. The upper limit is poorly determined with a cell count of 1, so it can differ slightly between R versions. Both are legitimate; say which one you report. For the sample odds ratio, compute (14 * 7) / (1 * 8).
Output from a real run: R 4.6.1, run 2026-10-03.
Python
import pandas as pd
from scipy import stats
from scipy.stats.contingency import odds_ratio
relapse = pd.read_csv("data.csv")
table = pd.crosstab(relapse["group"], relapse["relapsed"]).to_numpy()
# [[14, 1],
# [ 8, 7]]
result = stats.fisher_exact(table)
result.statistic # 12.25 (sample odds ratio)
result.pvalue # 0.03518
odds_ratio(table, kind="sample").confidence_interval()
# (1.2678, 118.3615) Woolf's log method
Output from a real run: Python 3.9.6 (scipy 1.13.1, pandas 2.3.3), run 2026-10-03.
Impact
Effect Size
The odds ratio compares one group's odds of an outcome with another's, and it's what logistic regression reports. It doesn't depend directly on the total sample size, but its value depends on which group and which outcome are the reference: flip either and it becomes its reciprocal (12.25 becomes 0.08). Odds ratios from other studies are comparable only when those definitions and the populations are, and different baseline risks can still complicate the comparison.
Usual care's odds of relapse, 7 to 8, are about 12 times the boosters' 1 to 14. Read the other way, boosters cut the odds of relapse to 0.08 of usual care's.
Odds aren't chances. Relapse was 7 times as likely under usual care (47% vs. 7%), not 12 times. When an outcome is common, the odds ratio sits further from 1 than the ratio of the percentages, so say “odds” and give the percentages too.
Zero cells. A single zero cell, with the other counts positive, makes the odds ratio 0 or infinite; more than one zero can leave it undefined. If the one booster patient who relapsed had stayed well, the boosters' odds would be 0 and the odds ratio infinite, with no log-scale interval. Fisher's p still works (it would be .006). A common fix for the estimate is to add 0.5 to every cell (Haldane, 1956), which would give 27.35 here; say so if you do.
Which interval. The headline interval uses Woolf's method because it can be worked by hand, but it's a large-sample approximation, which sits awkwardly on a page about avoiding them: with a cell holding a single patient it's especially imprecise and its coverage may be unreliable. R also prints a different point estimate, the conditional maximum-likelihood odds ratio (11.26), not the sample odds ratio (12.25). The exact (conditional) interval R prints, [1.13, 588.26], uses the same hypergeometric probabilities as Fisher's test, but it's built from two one-sided tests, so it doesn't always agree with the two-sided p: with small or unequal groups it can include 1 while p is below .05, or the reverse. Here every interval excludes 1. Report the interval you planned to, and if it disagrees with p, say so.
Odds ratios have no generally accepted small, medium and large cutoffs. The ones sometimes quoted (1.68, 3.47 and 6.71; Chen, Cohen & Chen, 2010) were matched to Cohen's d for an outcome that 1% of the comparison group has, so they don't carry over to a common outcome like relapse. An odds ratio further from 1, counted multiplicatively (4 and 0.25 are equally far, in opposite directions), means a stronger difference in odds, not necessarily a bigger difference in risk: here 12 times the odds is 7 times the risk. The percentages, 7% against 47%, are the clearer guide to size. Whether cutting relapse from about half to 1 in 15 is worth monthly sessions is a clinical question, and with 30 patients the interval says the true benefit could be far smaller.
Benchmarks Odds Ratio at a Glance
Statistical Significance
p answers one narrow question: if group and outcome were unrelated, and the marginal totals were fixed as observed, how often would the counts split at least this unevenly? Fisher's test is an exact test: it answers the question by listing every table with those totals and adding up their probabilities from the hypergeometric distribution, instead of approximating with the chi-square distribution.
With 15 patients per group and 8 relapses in all, the relapse study could have produced 9 tables:
| Booster Relapses | Usual Care Relapses | Probability | Counted in p |
|---|---|---|---|
| 0 | 8 | .0011 | Yes |
| 1 (ours) | 7 | .0165 | Yes |
| 2 | 6 | .0898 | |
| 3 | 5 | .2334 | |
| 4 | 4 | .3183 | |
| 5 | 3 | .2334 | |
| 6 | 2 | .0898 | |
| 7 | 1 | .0165 | Yes |
| 8 | 0 | .0011 | Yes |
The four tables no more likely than ours add up to .035. If boosters made no difference, the 8 relapses would split between the groups at least this unevenly (in either direction) about 1 time in 28. That's below .05, so it's significant.
Which two-sided p. This page, R, SPSS and scipy all use the same rule: count every table whose probability is no bigger than the observed table's. Other rules exist and can disagree when the distribution is lopsided (Agresti, 1992). Here the groups are the same size, so the distribution is symmetric and the two-sided p is exactly twice the one-sided .018.
A cautious test. Only 9 tables are possible, so p can only take a handful of values, and the real chance of a false positive is usually below .05. That makes Fisher's test conservative: safe, but a little less likely to catch a real effect. The ordinary chi-square test on the same table gives p = .013, and the “N − 1” version, which holds its error rate well in 2 × 2 tables with expected counts as small as 1 (Campbell, 2007), gives .015. With expected counts of 4, either is defensible; the point is to pick one test before seeing the results.
p is not the probability that the null hypothesis is true, and it says nothing about how big the benefit is. That's what the odds ratio and its interval are for.
Benchmarks p at a Glance
Strength of evidence against the null hypothesis.
Power and Sample Size
Power is the chance that a study detects an effect that's really there. For Fisher's test it depends on the two true proportions (not just the odds ratio between them), the group sizes and α. Because the test is exact and cautious, its power is lower than a chi-square or z-test formula suggests, and in small samples the gap is large: in the scenario below, the usual formula promises 58% power with 15 per group, where Fisher's test has 43%. There's no simple formula of its own: power comes from working through every outcome the study could produce, or from simulation.
Suppose boosters truly cut relapse from 45% to 10%. With 15 per group, as in our pilot, Fisher's test would come out significant only about 43% of the time. It takes about 29 per group to reach 80%.
Researchers usually aim for at least 80% power. Plan it before collecting data, from the two proportions you expect and the smallest difference that would matter. For small samples, compute power for Fisher's test itself rather than borrowing a large-sample formula. Its steps are uneven: adding a person can even lower power slightly (with these rates, 25 per group has a little less than 24). There's no calculator for this test yet.
Other Info
Follow-Up and Post Hoc Tests
None needed. This test answers a single question, so there are no planned contrasts or post hoc tests to run.
References
-
Fisher, R. A. (1935). The logic of inductive inference. Journal of the Royal Statistical Society, 98(1), 39–82.
https://doi.org/10.2307/2342435
“The test of significance is therefore direct, and exact for small samples.” (p. 50)
-
Agresti, A. (1992). A survey of exact inference for contingency tables. Statistical Science, 7(1), 131–153.
https://doi.org/10.1214/ss/1177011454
“For some basic analyses of contingency tables, it is unnecessary to use large-sample approximations to sampling distributions when their adequacy is in doubt.” (Abstract)
“Different approaches can give different results because of the discreteness and potential skewness of the hypergeometric distribution.” (p. 135)
“Other methods for 2 × 2 tables have been motivated by the controversy about the conditioning argument and the conservativeness of Fisher's exact test.” (p. 147)
-
Campbell, I. (2007). Chi-squared and Fisher–Irwin tests of two-by-two tables with small sample recommendations. Statistics in Medicine, 26(19), 3661–3675.
https://doi.org/10.1002/sim.2832
“The optimum test policy was found to be analysis by the 'N−1' chi-squared test when the minimum expected number is at least 1, and otherwise, by the Fisher–Irwin test by Irwin's rule” (Abstract)
- Woolf, B. (1955). On estimating the relation between blood group and disease. Annals of Human Genetics, 19(4), 251–253. https://doi.org/10.1111/j.1469-1809.1955.tb01348.x
- Haldane, J. B. S. (1956). The estimation and significance of the logarithm of a ratio of frequencies. Annals of Human Genetics, 20(4), 309–311. https://doi.org/10.1111/j.1469-1809.1955.tb01285.x
- Chen, H., Cohen, P., & Chen, S. (2010). How big is a big odds ratio? Interpreting the magnitudes of odds ratios in epidemiological studies. Communications in Statistics—Simulation and Computation, 39(4), 860–864. https://doi.org/10.1080/03610911003650383
-
Muff, S., Nilsen, E. B., O'Hara, R. B., & Nater, C. R. (2022). Rewriting results sections in the language of evidence. Trends in Ecology & Evolution, 37(3), 203–210.
https://doi.org/10.1016/j.tree.2021.10.009
“we suggest language of evidence that allows for a more nuanced approach to communicate scientific findings as a simple and intuitive alternative to statistical significance testing” (Abstract)
Spot an error? Something still confusing? Tell us at support@statsforpsychology.com.