Implements multiplicity control for confirmatory clinical trials using closed testing, graphical procedures (Bretz-Maurer-Hommel), gatekeeping (parallel, serial, mixed), and step-down/step-up procedures (Holm, Hochberg, Hommel). Covers FDA Multiple Endpoints Final Guidance (October 2022) and the Goeman 2021 admissibility result that all valid procedures are closed tests.
install.packages(c('gMCP', 'graphicalMCP', 'multcomp', 'gatekeeper'))
For Python (basic FDR/FWER methods):
pip install statsmodels
Tell your AI agent what you want to do: - "Design a graphical procedure for primary endpoint + 2 key secondary endpoints in gMCP" - "Apply Holm step-down to my 5 endpoint p-values" - "Choose between Hochberg and Holm given my endpoint correlation structure" - "Set up serial gatekeeping (hierarchical) for co-primary then 3 secondary tiers" - "Allocate a small alpha budget (~20% convention) to a discovery subgroup analysis, pre-specified per Dane 2019"
"Pivotal trial with primary endpoint A and two key secondary endpoints B and C, both supporting labeling claims. Design a graph in gMCP: primary at full alpha; if rejected, alpha propagates 50/50 to B and C; if B rejects, weight returns to C, vice versa. Generate the gMCP code and matrix2graph specification."
"My SAP has hierarchical primary (A) then key secondary (B) then exploratory secondaries (C, D). Implement as Bretz-Maurer 2009 graph with full sequential transitions."
"Co-primary endpoints A1 and A2 (both must reach significance). If both reject, test family of 3 secondary endpoints with Holm. Implement as mixed gatekeeping per Dmitrienko-Tamhane 2008."
"Parallel gatekeeping: secondary family tested only if at least one of primary family rejects. Implement in gMCP."
"Five correlated endpoint p-values: 0.018, 0.042, 0.038, 0.015, 0.029. Endpoints are positively correlated. Should I use Hochberg or Holm? Provide reasoning and both adjusted p-values."
"My two endpoints are LDL-C and HDL-C, which move in opposite directions. Is Hochberg valid? Provide PRDS check and recommendation."
"Justify my multiplicity strategy per FDA 2022 Multiple Endpoints Final Guidance. Distinguish co-primary (all-win), multiple primary (any-wins), and key secondary."
"Allocate alpha across primary endpoint (60%), key secondary (30%), and pre-specified discovery subgroup (10%); design the graph with disciplined subgroup pre-specification per Dane 2019 EFSPI white paper."
statsmodels.stats.multitest.multipletests default is method='hs' (Holm-Sidak) -- always specify method='holm', 'hommel', or 'bonferroni' explicitly.