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

Multiple-Comparison Correction

Run many tests and some will come out significant by luck. A multiplicity block adds corrected p-values beside the raw ones, so a reader can tell a real hit from one the number of tests made likely. Raw p_value / reject_null never change, and a request with no block (the default) gets no corrected figures.

{
  "cohort": {"filename": "experiment.pulse"},
  "tests": [
    {"type": "TEST_T", "field": "revenue", "split_by": "treatment"},
    {"type": "TEST_PROP_Z", "field": "converted", "split_by": "treatment",
     "params": {"success": "yes"}}
  ],
  "multiplicity": {"method": "holm"}
}

The block

multiplicity: {method, family, alpha}, every key optional.

KeyValuesMeaning
methodnone, bonferroni, holm, bh, bythe procedure; matches R p.adjust (bh / by are R’s BH / BY)
familylayer, row, column, request, compose, matrixwhich p-values are corrected together
alphaa number in (0, 1), default 0.05the level an overlay’s significant_adjusted reads (a test uses its own alpha)

bonferroni and holm control the family-wise error rate (the chance of any false positive in the family); bh and by control the false discovery rate (the expected share of false positives among the hits), by under any dependence. {"method": "none"} is the explicit opt-out.

It rides on the Request, each tests[] / post_tests[] entry, each overlay spec, each MAT_CORRELATION / MAT_PARTIAL_CORRELATION matrices[] spec (where it implies params.inference), each regressions[] spec (with an optional coefficients list), the ComposedRequest, its overlay specs and its compare entries, and engine-wide as Options.DefaultMultiplicity. Each key falls through on its own: slot, request, ComposedRequest, engine default, none.

Families

FamilyCorrects togetherWhere
layerone overlay layeroverlays (the overlay default)
row / columneach row / column of one layer’s matrixoverlays with a MATRIX payload
requestthe request’s tests, post-tests, request-family overlays and member regression coefficientstests and regressions (their default), request overlays
composeevery compose member across all slots, Compose-host layers and nested-model comparisonsinside Compose; the only family a compare entry offers (its default)
matrixone matrix result’s distinct pairs (the upper triangle: m = k(k − 1)/2 for k members), one family per group bucketmatrix specs (the matrix default; request also offered)

An inherited family the surface does not offer takes the surface default; an explicit one is refused (PULSE_MULTIPLICITY_INVALID): row / column on a non-matrix kind, compose outside Compose, request on a Compose-host overlay, request / compose on a facet overlay, matrix anywhere but a matrix spec and anything but matrix / request on one, and a block on a matrix operator that emits no p-values. An inherited block corrects only a matrix spec that already sets params.inference: true. Members of one request / compose family that resolve to different methods are PULSE_MULTIPLICITY_CONFLICT. alpha on a test’s own block is refused (the test’s alpha is used), and so is an explicit correction on Tukey HSD, which is already family-wise and never joins a family.

A regression joins a family only through its OWN block: a request-level or engine-default block never reaches a regression without one (its fields still fill the own block’s empty ones). Its members are the coefficients its coefficients list names (a predictor or (intercept); an unknown or repeated name is refused), by default every predictor that reports a p-value. A named coefficient the fit reports no p-value for (dropped by selection) stays a member with an undefined p. REG_BAYES_LINEAR emits no p-values, so a block resolving to any method but none on it is refused (PULSE_MULTIPLICITY_INVALID, by predict too).

row and column build one family per row or column index of the layer’s own matrix, purely by coordinate: a pairwise overlay’s rows are the compared groups, and every element of a panel cell joins its cell’s family. Families never cross layers.

Outputs

Present only when a correction ran:

  • Tests: p_adjusted, significant_adjusted and multiplicity {method, family, alpha, m} beside p_value.
  • Overlay summaries: p_adjusted / significant_adjusted beside the raw figure (p_value, or the statistic that the t / z-versus-reference kinds carry their p in).
  • Overlay matrices: parallel payload.p_adjusted / payload.significant_adjusted matrices on identical headers and coordinates; a panel cell’s vector maps element for element.
  • Overlay layers: a multiplicity echo, with m_per for row / column (each family’s size, aligned with the rows or columns).
  • Pairwise significance letters: a pairwise overlay with params.letters recomputes its payload.parts.letters after the correction, so each cell’s above follows significant_adjusted (an explicit letters.alpha compares p_adjusted against that alpha instead).
  • Correlation matrices: auxiliary.p_adjusted and auxiliary.significant_adjusted (1 below the block’s alpha, else 0) beside auxiliary.p, in its encoding, mirrored into both triangles with a null diagonal, plus a multiplicity echo on the matrix result.
  • Regressions: p_adjusted (a map keyed like p_values, one entry per member coefficient) and significant_adjusted (against the block’s alpha, 0.05 by default) beside p_values, plus a multiplicity echo on the regression result. A regression with a margins block corrects its marginal effects as a family of their own, one per regression (one p-value per term; family margins, never pooled into request or compose), so adding margins never moves a coefficient’s p_adjusted: margins.p_adjusted / margins.significant_adjusted beside margins.p_values, plus a margins.multiplicity echo (family: "margins", m the terms). margins is an echo-only family: a block naming it is PULSE_MULTIPLICITY_INVALID.
  • Nested-model comparisons (ComposedRequest.compare): one hypothesis each, inheriting like a test (own block → the ComposedRequest’s → engine default), in the batch’s compose family: p_adjusted / significant_adjusted (against the resolved alpha) beside p_value, plus a multiplicity echo. A comparison that failed on its data joins no family.

m is the number of defined p-values corrected together. An undefined (NaN) p is left out of m and shows p_adjusted: null. Field shapes: Payload JSON Schema.

Where it runs

  • Process: every arm (serial, streaming, fused or buffered crosstab, join, shard, parallel decode) corrects in one place after the result is built.
  • Compose: after all slots and Compose-host overlays finish. Serial and ComposeParallel agree byte for byte; --stream emits slot rows only, with no corrections; a failed slot aborts before the fold.
  • ProcessChain: each stage corrects its own request; no family spans stages, and the whole-chain overlays take no block.
  • Facet: each overlay layer corrects on its own.

Predict

Predict (Pulse.Predict, pulse api predict, pulse_predict) applies the same rules to a request without running it and reports p_values {total, uncorrected, basis, threshold}: how many inferential p-values the request emits (a REG_OLS / REG_GLM regression counts one per non-intercept predictor, none on an l1 / elasticnet fit without resample, whose p-values are null, plus one per margins term) and how many no block reaches. threshold is 10 (descriptor.MultiplicityTriggerThreshold); an uncorrected count at or above it is the cue to add a block. basis is exact, dictionary (assumes every dictionary entry of a category axis becomes a bucket, so it can over- or under-count) or lower_bound (an axis it cannot size counts as one). Request predict reports it; facet predict counts its inferential overlays (one p-value each) and compose predict counts its own overlays, always as a lower_bound, beside each slot’s advisories. Chain predict reports none.

Feature profiles

The block is the feature capability:multiplicity. On an instance that hides it, the key is refused as an unknown field, it is absent from the payload schema, and predict omits p_values. See Feature Profiles.

Not corrected

A p-value no block claims stays raw. An extension TEST_* joins families like a built-in (Extension Points).