.claude/skills/graphicalMCP-gsDesign2/SKILL.md
Guide users through group sequential design with graphical multiplicity control using the graphicalMCP and gsDesign2 R packages. Use this skill whenever the user asks about: group sequential designs with multiple hypotheses, graphical multiplicity testing, sequential p-values with gsDesign2, combining graphicalMCP with gsDesign2, clinical trial designs with multiple endpoints and populations, Maurer-Bretz procedures, alpha-spending with multiplicity graphs, or adapting the gMCPLite vignette template. Also trigger when users mention spending time, information fraction, or sequential p-values in the context of group sequential or graphical testing.
npx skillsauth add keaven/gsDesignSkills graphicalMCPgsd2Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill helps users design and analyze clinical trials that combine graphical multiplicity control (graphicalMCP) with group sequential designs (gsDesign2). The workflow follows the Maurer-Bretz (2013) framework.
library(dplyr)
library(tibble)
library(gsDesign)
library(gsDesign2)
library(graphicalMCP)
gsDesign2 must export sequential_pval(). Install from GitHub if needed:
remotes::install_github("Merck/gsDesign2")
The workflow has 4 phases:
graphicalMCP::graph_create().gsDesign2::gs_design_ahr() targeting the desired power (e.g., 90%). Use info_frac = NULL and specify analysis_time as calendar months; gsDesign2 derives the information fraction from the enrollment/failure rate assumptions and analysis timing.rate_complement = rate_sub * (1 - prevalence) / prevalence. Build stratified enrollment for overall population designs using define_enroll_rate() with stratum columns.gsDesign2::gs_power_ahr() with the derived enrollment rates. Pass event = NULL so analysis_time drives the design. For overall population, use stratified fail_rate with different HRs per stratum.gsDesign2::fixed_design_rd() with sample sizes derived from the driving hypothesis. These get NULL in the design list.NULL for non-GSD hypotheses.events / max(events) using the subgroup information fraction. The spending time must reach 1 at the final analysis of each hypothesis.gsDesign2::sequential_pval() for each group sequential hypothesis. For non-GSD hypotheses, the nominal p-value is the sequential p-value.graphicalMCP::graph_test_shortcut() with the sequential p-values and total FWER alpha.graphicalMCP::graph_update() to see the multiplicity graph at each rejection step.gsDesign2::gs_update_ahr().For detailed code templates covering each phase, read references/code_patterns.md.
illness-death skill.gs_design_ahr() to determine enrollment rates and sample sizes. All other hypotheses derive their enrollment from H1 using gs_power_ahr() (time-to-event) or fixed_design_rd() (binary).define_enroll_rate() and define_fail_rate() with separate stratum rows (e.g., "BM+" and "BM-") and stratum-specific HRs or rates.gs_power_ahr() API: Does not accept info_frac. Use event = NULL with analysis_time to let timing drive the design. If event is not set to NULL, the default c(30, 40, 50) may cause length mismatches for designs with fewer analyses.fixed_design_rd() output: Returns a fixed_design object. Wrap with summary() before piping to gt() or kable().binding = FALSE so efficacy bounds are computed ignoring the futility bound, preserving Type I error control even if the trial continues past a futility crossing. Theoretical basis: Liu & Anderson (2008) Theorem 1.sfLDOF) is a common default.pmin(planned_IF, actual_IF) at interim analyses to protect against over-spending. Align spending time across populations (H2 uses H1's spending time). At final analysis, spending time = 1.gs_power_rd() with weight = "invar" for stratified overall population ORR, not fixed_design_rd().testing
Guide users through weighted parametric group sequential design using the wpgsd R package. Use this skill when the user asks about: correlated test statistics across hypotheses, generate_bounds, closed_test, correlation matrices for nested populations, or parametric multiplicity adjustment with group sequential designs.
tools
Guide users through clinical trial simulation using the simtrial R package. Use this skill when the user asks about: simulating survival trials, simfix, sim_pw_surv, cutting data at calendar or event times, weighted logrank tests, MaxCombo tests, or simulation-based power.
tools
Guide users through confirmatory adaptive clinical trial design and analysis using the rpact R package. Use this skill when the user asks about: adaptive designs, sample size reassessment, conditional power, inverse normal combination test, Fisher combination test, multi-stage designs, or rpact design objects.
tools
Guide users through multi-endpoint group sequential trial simulation with multiplicity-controlled testing. Use this skill when the user asks about: simulating trials with OS, PFS, and ORR endpoints, illness-death model simulation with gsDesign bounds, sequential p-values in simulation loops, combining graphicalMCP with gsDesign for simulation-based operating characteristics, cumulative rejection probabilities, or building a full pipeline from design through simulation to multiplicity-adjusted testing.