Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

name: op-overlay-chisq-col
kind: operator
category: OVERLAY
operator: OVERLAY_CHISQ_COL
description: Per-column χ² 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 column: checks whether each column’s spread across the rows departs from the table’s overall row mix.

Questions it answers:

  • Which banner columns have an answer mix unlike the total?
  • Which months have a spread of order types unlike the whole year?

Use something else:

  • OVERLAY_CHISQ_ROW when the groups are the rows rather than the columns.

Params

scope (enum, required) — must be column. ref (object, empty) — implicit-margin — leave empty. level/within must be 0. Other ref arms → PULSE_OVERLAY_REF_INCOMPATIBLE_WITH_SHAPE.

Host shape

MATRIX crosstab (crosstab.matrix). Any cell aggregator; observed vs expected from the row / column margins.

Output

SERIES — payload.shape "series". One payload.series.entries[] entry per column key carrying summary.statistic (χ² value), summary.p_value, summary.parameters.df = rows - 1. summary.baseline unset (inferential).

Reading the output

  • summary.statistic: In each series entry (one per crosstab column): chi-square for that column’s counts against the counts its column total would give at the table’s overall row shares. 0 means the column’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 frequency and probability weights.
  • Multiplicity: a multiplicity method adds p_adjusted and significant_adjusted beside the raw p; families layer (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 column is scaled to its margin’s Kish n_eff (expected-low on the scaled column) — first-order Kish, not Rao-Scott. Each entry’s summary.parameters adds that column’s sum_weights (+ n_eff). Probability host with components disabled ⇒ PROCESSING_CONFIG (no n_eff to scale by; predict AND runtime).
  • p-values equal every χ² test’s and overlay’s on the same contingency.
  • Any expected < 5 in a column emits ONE PULSE_OVERLAY_EXPECTED_LOW per offending column.
  • Reads cell values: a code cell (AGG_MODE over categorical_* / packed_bool — the modal dictionary index / truth value) → PROCESSING_CONFIG, reason categorical_code, slot: "crosstab.cell" (+ field, field_type), predict and runtime. Use a count cell.

See