name: op-overlay-fisher-exact-cell
kind: operator
category: OVERLAY
operator: OVERLAY_FISHER_EXACT_CELL
description: Per-cell Fisher's exact two-sided p-value over a 2×2 contingency formed from each host crosstab cell + its margins.
type: reference
applies_to: process, compose
examples_tags: [overlay, cross-tabulation, hypothesis-test, exact-test, small-sample]
Overlays decorate the host; no Response.Components.
Use when
Fisher’s exact test for every crosstab cell: checks whether being in that row goes with being in that column more or less than expected.
Questions it answers:
- Which answer-by-segment cells stand out in this banner table?
- In a small table, which cells hold more cases than the margins predict?
Use something else:
OVERLAY_CHISQ_MATRIXwhen you want one test for the whole table.
Params
Scope must be cell. Ref (object, empty) — implicit-margin — leave empty. Level/Within must be 0.
multiplicity— optional{method, family, alpha}; addsp_adjustedfigures, raw p untouched (multiplicity-correction).
Host shape
MATRIX crosstab. Implicit-margin family (no Ref). Canonical low-count χ² backstop — the correct surface when expected < 5 breaks χ² approximation.
Output
MATRIX — Cells[r][c].Value = two-sided p-value as float64. Mirrors host RowKeys / ColumnKeys. Absent host cells stay absent on the overlay. Layer Baseline unset (inferential).
Reading the output
cells.value: a p-value. Below alpha (0.05 unless the request sets another) the result is called significant; that is not the same as important, so read the effect size for how big it is.- Caveat: Each cell holds the two-sided exact p-value of its own 2x2 table: this row versus the rest, by this column versus the rest.
- Caveat: It does not say which way or how far the cell departs: compare the cell’s count with what its row and column totals predict (or an OVERLAY_INDEX_VS_MARGIN layer) for direction and size.
Gotchas
- Frequency-only: on a frequency-weighted host the exact test runs on the integer Σw table and
Summary.Parametersaddssum_weights; a probability weight — on the overlay slot OR only on the host cell — isPULSE_WEIGHT_UNSUPPORTEDnaming the kind (predict AND runtime). - 2×2 contingency:
[cell, row_margin-cell; col_margin-cell, grand-row_margin-col_margin+cell]. ReuseslogHypergeometric— byte-equal to the Fisher exact test on the same 2×2. - Cochran rule: any of four expected counts
< 1OR>= 20%of expected< 5→ ONEPULSE_OVERLAY_EXPECTED_LOWper offending cell. Advisory only — Fisher stays exact. grand_total <= 0→ absent cells everywhere + ONEPULSE_OVERLAY_REF_ZERO.- Populated
Refarm →PULSE_OVERLAY_REF_INCOMPATIBLE_WITH_SHAPE. - Buffered (inherent).