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-test-welch
description: Explicit two-sample Welch t-test on a numeric field across a categorical split_by partition.
kind: operator
category: TEST
operator: TEST_WELCH
type: reference
applies_to: process, compose, predict
examples_tags: [hypothesis-test, t-test, tier-1-test, parametric, two-sample, welch, streaming-friendly]

Tests emit statistic / p-value / effect size; no Response.Components.

Use when

Checks whether the average of a numeric field differs between two groups, without assuming they have equal spread.

Questions it answers:

  • Do customers in the two pricing arms spend different amounts on average?
  • Is average delivery time different between the two depots?

Use something else:

  • TEST_PAIRED_T when the same subjects are measured twice, such as before and after.

Params

alpha is a top-level key; the rest go in params.

NameTypeDefaultDescription
alphafloat0.05Significance level in (0, 1); reject_null when p < alpha.
referencestring—The baseline split_by level, by value: diff = other − reference (default: the alphabetically second level, so diff = first − second). Codes: test-variant-options.
covariatestring—A numeric pre-period field (CUPED): the test runs on y − θ(x − x̄); needs split_by. Detail: test-variant-options.
  • weight — per-group moments on w*, Welch–Satterthwaite df on N*_g (Σw frequency, Kish n_eff probability; fractional). details add sum_weights (+ n_eff, probability) shaped like n (raw rows); n_eff < 2 warns PULSE_WEIGHT_LOW_NEFF.

Inputs

field (required) — numeric (decimal128 as its float64 echo, packed_bool as 0/1). split_by (required, exactly 2 groups) — categorical (packed_bool levels "0"/"1").

Output

statistic = t on the unpooled SE √(s²_a/n_a + s²_b/n_b); df = Welch-Satterthwaite; p_value two-sided Student-t (R t.test(var.equal = FALSE)). details: groups, per-arm n / mean / variance (sample, n − 1), diff, ci_low/ci_high on diff, pooled-SD effect_size.cohens_d.

Reading the output

  • statistic: Welch’s t: the first group’s mean minus the second’s, in standard errors computed from each group’s own variance. Values far from 0 in either direction are unlikely if the true gap is zero.
  • 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.
  • details.diff: The first group’s mean minus the second’s, in the field’s own units.

Contract

  • Types (field): date, datetime, decimal128, f32, f64, packed_bool, u16, u32, u4, u64, u8; any other scalar type is PULSE_TEST_FIELD_NOT_NUMERIC.
  • Types (split_by): categorical_*, packed_bool; any other scalar type is PULSE_FIELD_TYPE_UNSUPPORTED.
  • Weight: weighted under frequency and probability weights.
  • Multiplicity: a multiplicity method adds p_adjusted and significant_adjusted beside the raw p; families request (default), compose (inside Compose).
  • Streaming: streamable.

Gotchas

  • Identical math to TEST_T with split_by; this alias documents intent.
  • Welch denominator never assumes equal variance — the safe default when spreads may differ.
  • The Welford triple is byte-equal to the Welford aggregate’s on the same inputs — reuse via OVERLAY_T_CELL on crosstabs.
  • Constant field within a group → PULSE_TEST_VARIANCE_ZERO.
  • No split_by → PROCESSING_CONFIG (predict too).

See