name: op-overlay-chisq-row
kind: operator
category: OVERLAY
operator: OVERLAY_CHISQ_ROW
description: Per-row χ² goodness-of-fit test across the host crosstab's contingency table.
type: reference
applies_to: process
examples_tags: [overlay, cross-tabulation, hypothesis-test]
Overlays decorate the host; no Response.Components.
Use when
Chi-square test per crosstab row: checks whether each row’s spread across the columns departs from the table’s overall column mix.
Questions it answers:
- Which regions have an answer mix unlike the overall mix?
- Which product lines get a different spread of complaint types?
Use something else:
OVERLAY_CHISQ_COLwhen the groups are the columns rather than the rows.
Params
scope (enum, required) — must be row. ref (object, empty) — implicit-margin — leave empty. level/within must be 0.
Host shape
MATRIX crosstab (crosstab.matrix). Any cell aggregator; row-axis twin of the column χ².
Output
SERIES — payload.shape "series". One payload.series.entries[] entry per row key carrying summary.statistic (row χ²), summary.p_value, summary.parameters.df = cols - 1. Entries align with the host’s row_keys. summary.baseline unset.
Reading the output
summary.statistic: In each series entry (one per crosstab row): chi-square for that row’s counts against the counts its row total would give at the table’s overall column shares. 0 means the row’s mix matches the overall mix; read the entry’s p_value rather than the raw value.summary.p_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.
Contract
- Weight: weighted under
frequencyandprobabilityweights. - Multiplicity: a
multiplicitymethod addsp_adjustedandsignificant_adjustedbeside the raw p; familieslayer(default),request,compose(inside Compose). - Streaming: buffered only.
Gotchas
- An undefined (NaN) host cell is MISSING: read as an absent cell (an observation of 0), never into a total.
- Weighted host (both kinds, any source): cells are Σw; under probability each row is scaled to its margin’s Kish
n_eff(expected-low on the scaled row) — first-order Kish, not Rao-Scott. Each entry’ssummary.parametersadds that row’ssum_weights(+n_eff). Probability host with components disabled ⇒PROCESSING_CONFIG(non_effto scale by; predict AND runtime). - p-values equal every χ² test’s and overlay’s on the same contingency.
- Any
expected < 5in a row emits ONEPULSE_OVERLAY_EXPECTED_LOWper offending row. - A populated
refarm →PULSE_OVERLAY_REF_INCOMPATIBLE_WITH_SHAPE. - Reads cell values: a code cell (
AGG_MODEovercategorical_*/packed_bool— the modal dictionary index / truth value) →PROCESSING_CONFIG, reasoncategorical_code,slot: "crosstab.cell"(+field,field_type), predict and runtime. Use a count cell.