Multiple Testing Simulator

The learner reruns many simulated studies, each testing a family of hypotheses (some true nulls, some real effects, optionally correlated), and compares unadjusted testing with Bonferroni, Šidák, Holm, Hochberg, Benjamini–Hochberg and Benjamini–Yekutieli on FWER, false rejections, FDR and power. Views show one study's sorted p-values against each procedure's threshold, the pooled p-value histogram, error-rate bars with exact values, and FWER against m; further scenarios simulate planned versus post-hoc pairwise comparisons and choosing the tail or the level after seeing the data.

Used in: Introduction to Statistics

Props

PropTypeDefaultDescription
titlestring—Title bar text. Default depends on the scenario.
scenariostring"tests"tests: m tests per study with m0 true nulls; pairs: all pairwise comparisons of k group means (planned pair vs largest-vs-smallest); direction: one z test whose one-sided direction is chosen after seeing z; levels: one test whose level is chosen after seeing p.
mnumber20tests: hypotheses per study (1 to 10000; the plot shows the 400 smallest p-values).
nullSharenumber0.8tests: share π0 of the m hypotheses that are true nulls (m0 = round(π0 m)).
m0number—tests: exact number of true nulls; overrides nullShare unless nullShare has a slider.
effectZnumber3 (tests), 0 (direction, levels)Mean of the z statistic under a real effect (standard-error units). direction/levels: 0 means H0 is true.
powernumber—tests: instead of effectZ, the power of one unadjusted level-α test against each real effect; effectZ is solved from it.
teststring"two-sided"tests: two-sided or one-sided (upper) z tests.
alphanumber0.05Significance level; also the FDR level q for BH and BY.
correlationnumber0tests: correlation ρ between every pair of test statistics in a study (0 to 0.99).
proceduresstring[]["none", "bonferroni", "holm", "bh"] (pairs: ["bonferroni"])Procedures compared: none, bonferroni, sidak, holm, hochberg, bh, by (aliases such as benjamini-hochberg, unadjusted are accepted). pairs: applied to all k(k−1)/2 pairs, in addition to the planned and post-hoc rules. The learner can toggle them.
groupsnumber5pairs: number of groups k (2 to 10).
nPerGroupnumber10pairs: observations per group (σ = 1 known).
groupMeansnumber[]all 0pairs: true group means in σ units; padded with 0 or cut to k.
plannedPairnumber[][1, 2]pairs: the two groups (1-based) of the comparison fixed in advance.
levelsnumber[][0.01, 0.05, 0.1]levels: the conventional levels the post-hoc analyst picks from.
viewstringfirst of viewsInitial view: study (one study), histogram (pooled p-values; z for direction), rates (error-rate bars), curve (FWER against m; tests only).
viewsstring[]all views of the scenarioViews offered in the toggle (tests: study, histogram, rates, curve; pairs: study, rates; direction and levels: histogram, rates).
metricstring"fwer" (direction, levels: "rate")Initial bar metric in the rates view: fwer, falseRejections, fdr, power, rate.
readoutstring[]fwer, falseRejections, fdr, power, exact (as relevant)Table columns (tests, pairs): fwer, falseRejections, pcer, fdr, power, nullShareOfRejections, rejections, perTestLevel, exact.
studiesnumbertests: 40000/m clamped to 200..2000; pairs, direction, levels: 2000Studies simulated at first; the learner adds more. Capped so that studies × m stays under 400,000.
parametersarraytests: m, nullShare, effectZ (power instead of effectZ when power is set); pairs: groups; direction: alpha, effectZ; levels: effectZSliders as [{name, min, max, initial, step?, label?}], name one of m, nullShare, effectZ, power, alpha, correlation, groups, nPerGroup. [] shows no sliders.
seednumber | string1Random seed; the same seed gives the same studies.
controlsstring[]all controls shownRegistry ids of the procedure buttons, view tabs, metric options and table columns to show (core ones always show). Absent shows everything. Fitted by tooling from the props and what the lecture has taught; authors do not pick it by hand.