GARETH GRANTTECHNOLOGY · DATA · INNOVATION
Explore

26 / Inference

Multiple testing and false-discovery control

Testing many hypotheses creates many opportunities for a chance finding. Multiplicity procedures adjust the decision rule for the collection of tests. Benjamini–Hochberg targets the expected false-discovery proportion, while familywise methods address the chance of making any false rejection in a defined family.

AdvancedLive exploration + Python

The business question

How can a business investigate many effects without mistaking routine false positives for a list of winners?

  • Screen several product, branch or customer-segment hypotheses responsibly.
  • Analyse multiple planned marketing comparisons or experimental outcomes.
  • Separate exploratory leads from confirmatory decisions that require stronger error control.

How the method works

Define the family of hypotheses before selecting the interesting results. If six independent true null hypotheses are tested at 5% without adjustment, the chance of at least one false rejection is 1−0.95^6, about 26.5%. The precise risk changes with dependence, but the general problem remains: reporting only the smallest p-value hides the search that produced it.

Benjamini–Hochberg sorts m p-values from smallest to largest. Compare the value at rank i with i×q/m, find the largest passing rank, and reject all hypotheses up to it. Adjusted p-values provide an equivalent convenient report. Under independence or suitable positive dependence and valid original p-values, the procedure controls the expected false-discovery proportion at the selected level.

A 5% false-discovery target does not mean each selected result has a 5% probability of being false. It is a repeated-procedure property of the proportion of false rejections among discoveries, treating the proportion as zero when there are no discoveries. A particular small set can contain a larger fraction of errors. Independent confirmation, practical effect sizes and decision costs remain necessary.

The calculation

Sort p_(1)≤…≤p_(m); k = largest i with p_(i)≤i q/m; reject ranks 1…k. BH adjusted p_(i) = min[1, min_(j≥i)(m p_(j)/j)].
Read the symbols
SymbolMeaning
mNumber of hypotheses in the declared family.
qChosen false-discovery-rate target.
p_(i)The raw p-value at sorted rank i.
kLargest passing rank; no rejection if none passes.

A worked business example

ILLUSTRATIVE SCENARIO

Illustrative analyst screens six planned differences in order-processing outcomes.

Inputs

  • Raw p-values: 0.001, 0.010, 0.030, 0.040, 0.200 and 0.600.
  • All six tests belong to the same prespecified exploratory family.
  • Use Benjamini–Hochberg at q=0.05.

Work through the numbers

  1. The BH thresholds are approximately 0.00833, 0.01667, 0.02500, 0.03333, 0.04167 and 0.05000.
  2. The largest passing rank is 2: 0.010≤0.01667, while later ranks do not pass.
  3. The adjusted p-values are 0.006, 0.030, 0.060, 0.060, 0.240 and 0.600.
  4. Two results pass the adjusted 5% rule; four would pass an unadjusted p≤0.05 rule.
The adjustment reduces the illustrative candidate list from four apparent findings to two.

The remaining two are leads for effect-size review and confirmation, not automatically profitable improvements. The calculation assumes that the original tests and the chosen dependence conditions are appropriate.

Explore the decision

Control a family of discoveries. The live explorer has its own example inputs; it is separate from the worked calculation above.

Enable JavaScript to use this calculator. The worked example and executable Python remain available.

Apply it at work

  1. Declare the testing family, primary questions and error-control objective before examining outcomes.
  2. Use valid, appropriately designed individual tests and retain every p-value in the family.
  3. Apply the specified procedure and report raw and adjusted results with effect estimates.
  4. Confirm promising findings using fresh data or a clearly separated confirmatory study before costly rollout.

Check these assumptions

  • Each input p-value is valid under its own sampling design and null model.
  • The declared family includes the relevant comparisons rather than only favourable results.
  • BH’s independence or suitable positive-dependence conditions are defensible; arbitrary dependence needs another choice.
  • The procedure and stopping rules are not changed repeatedly in response to the results.

Common mistakes and how to avoid them

  • Defining the family after seeing the winners can defeat the purpose of adjustment.
  • FDR control is not the same as controlling the probability of even one false claim.
  • Adjusting p-values does not repair optional stopping, confounding, poor measurements or an inappropriate underlying test.

How this can help the business

  • A product team can prioritise a defensible set of experiments instead of investing in every noisy subgroup pattern.
  • A quality team can distinguish broad exploratory monitoring from a high-consequence confirmatory release decision.
A decision rule to adapt

Choose familywise control for decisions where any false claim is costly, or a justified FDR procedure for screening; always check practical benefit and validate selected findings.

When to use another approach

Consider Holm or Bonferroni familywise procedures, Benjamini–Yekutieli for more general dependence, or a prespecified hierarchical testing plan.

Reproduce the worked example in Python

The code is self-contained for this example. Dependencies and run instructions are included with the downloadable notebook.

Show executable code and recorded output
import numpy as np
from scipy.stats import false_discovery_control
p_values = np.array([0.001,0.01,0.03,0.04,0.2,0.6])
adjusted = false_discovery_control(p_values, method="bh")
print("Raw p-values:", p_values.tolist())
print("BH adjusted p-values:", np.round(adjusted, 4).tolist())
print("Reject at 5% FDR:", (adjusted <= 0.05).tolist())

Recorded output

Raw p-values: [0.001, 0.01, 0.03, 0.04, 0.2, 0.6]
BH adjusted p-values: [0.006, 0.03, 0.06, 0.06, 0.24, 0.6]
Reject at 5% FDR: [True, True, False, False, False, False]
Download all worked examples

Sources and further reading

Concepts are linked to primary teaching or technical sources. The business examples are illustrative applications, not reported client results.