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-zscore-vs-pop
kind: operator
category: OVERLAY
operator: OVERLAY_ZSCORE_VS_POP
description: Per-value population-comparison z-score for a facet host — (subset_freq − pop_freq) / sd_pop.
type: reference
applies_to: facet
examples_tags: [overlay, facet, outlier-detection, streaming-friendly]

Rides on facet overlays. Overlays decorate the host; no Response.Components.

Use when

Puts each category’s share gap with a comparison population on a z-score scale; for numeric bins it says nothing about the subset.

Questions it answers:

  • Which answers does this segment pick more or less often than the comparison population, relative to how much answer shares vary?
  • Which categories stand out in this region compared with the whole business?

Params

NameTypeDefaultDescription
fieldstring—The facet fields entry to score; required with two or more (else PULSE_OVERLAY_PARAM_MISSING); an unlisted one → PULSE_OVERLAY_FIELD_UNKNOWN.

scope must be group. ref.population.cohort (string, required) — comparison-population cohort name. level/within must be 0. Other ref arms → PULSE_OVERLAY_REF_INCOMPATIBLE_WITH_SHAPE.

Host shape

FACET — a discrete field, or a numeric one with include_histogram: true. Streamable, as the population index.

Output

SERIES — one entry per host value (or histogram bin) in payload order, the z-score on summary.statistic. Layer summary.baseline = 0.

Reading the output

  • summary.statistic: In each series entry, for a categorical field: the category’s share in the subset minus its share in the population, divided by the standard deviation of the population’s shares across categories. For a numeric field: a histogram bin’s centre against the population’s mean, in population standard deviations.
    • Sign: positive means the value sits above its centre; negative means the value sits below its centre.

Contract

  • Weight: not read; a weight in force is skipped.
  • Streaming: streamable.

Gotchas

  • Discrete: (subset_freq − pop_freq) / sd_pop, sd_pop the population SD across the population’s per-category frequencies.
  • Numeric: each bin centre standardised against the population’s mean and SD; without a histogram, zero entries.
  • sd_pop == 0 → ONE PULSE_OVERLAY_REF_ZERO per affected entry + no statistic on it. An absent population entry reads as pop_freq = 0 and IS emitted, no warning.
  • Streamable (a fold after the facet finalizes).

See