name: op-test-anova-welch
description: Heteroscedasticity-robust one-way ANOVA with Welch-Satterthwaite df correction; streamable per-group Welford.
kind: operator
category: TEST
operator: TEST_ANOVA_WELCH
type: reference
applies_to: process, compose, predict
examples_tags: [hypothesis-test, tier-1-test, parametric, k-sample, comparison, streaming-friendly]
Tests emit statistic / p-value / effect size; no Response.Components.
Use when
Checks whether the average of a numeric measure differs across groups when the groups may have unequal spread.
Questions it answers:
- Does average response time differ across regions whose variability is very different?
- Do the store formats differ in average basket size, given some formats are far more variable?
Use something else:
TEST_KRUSKAL_WALLISwhen the measure is heavily skewed or only ordered.
Params
alpha is a top-level key; the rest go in params.
| Name | Type | Default | Description |
|---|---|---|---|
alpha | float | 0.05 | Significance level in (0, 1); reject_null when p < alpha. |
n_col | string | (required) | Post-test (summary) form only, required there: the result column holding each group’s n. |
variance_col | string | (required) | Post-test form only, required there: the column holding each group’s sample variance. |
partition_by | list | — | Post-test over 2+ groupers: one run per partition, the rows sharing these leading group keys (default all but the last; [] = one run). |
weight— per-group moments on w*,weights= N*_j/s²_j, df on N*_j−1 (Σw or Kish n_eff).detailsaddsum_weights(+n_eff, probability) shaped liken(raw rows); n_eff < 2 warnsPULSE_WEIGHT_LOW_NEFF.
Inputs
field (required) — numeric (decimal128 as its float64 echo, packed_bool as 0/1). split_by (required, ≥ 2 groups) — categorical (packed_bool levels "0"/"1").
Output
statistic = Welch F*; df = k−1; p_value via F survival. details: groups, n, group_means, group_variances, weights, weighted_mean, df_between, df_within (Welch df). effect_size.omega_squared = df_b(F*−1)/(df_b(F*−1)+N) clamped ≥ 0 (Lakens 2013).
Reading the output
statistic: Welch’s F compares the spread of the group averages with the noise inside groups, weighting each group by its own variance; larger values are stronger evidence that the averages differ by more than that noise; the p-value says whether this F is large enough to be surprising.- Caveat: It says whether some groups differ, not which ones.
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
- Types (
field):date,datetime,decimal128,f32,f64,packed_bool,u16,u32,u4,u64,u8; any other scalar type isPULSE_TEST_FIELD_NOT_NUMERIC. - Types (
split_by):categorical_*,packed_bool; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED. - Weight: weighted under
frequencyandprobabilityweights. - Multiplicity: a
multiplicitymethod addsp_adjustedandsignificant_adjustedbeside the raw p; familiesrequest(default),compose(inside Compose). - Streaming: streamable.
Gotchas
- Streamable — same per-group Welford as classic one-way ANOVA; only the statistic + denominator change.
- Use when group spreads may differ.
- Tier-2
welch_one_way_postreads per-group{mean, variance, n}; same keys. A group row with a null in a used column drops (listwise, R’s NA default). - Post-hoc: Tukey HSD assumes equal variance; for unequal fall back to pairwise
TEST_WELCHwith amultiplicityblock. - Constant
fieldwithin a group →PULSE_TEST_VARIANCE_ZERO.
See
pulse_examples_search tags=[k-sample]- Skills:
statistical-testing,op-test-anova-f,op-test-brown-forsythe,op-test-tukey-hsd