.claude/skills/multi-endpoint-sim/SKILL.md
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.
npx skillsauth add keaven/gsDesignSkills multi-endpoint-simInstall 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 cross-package skill covers the full pipeline for simulating multi-endpoint trials with group sequential bounds and graphical multiplicity control.
library(gsDesign) # Group sequential design and sequential p-values
library(gMCPLite) # Illness-death model (sim_illness_death, cut_illness_death)
library(graphicalMCP) # Multiplicity graph and graph_test_shortcut
library(simtrial) # wlr() for logrank Z-statistics
library(parallel) # mclapply for simulation
gsDesign::sequentialPValue() in simulation loopsgsDesign::gsSurvCalendar() for the sample-size-driving endpoint (OS),
gsDesign::gsSurvPower() for secondary time-to-event (PFS), and
gsDesign::nBinomial() for binary endpoints (ORR).graphicalMCP::graph_create() allocating alpha across hypotheses.build_transition_rates(), modify for piecewise hazards.sim_illness_death() + cut_illness_death() to generate ADTTE data at each analysis time.simtrial::wlr() for TTE endpoints, gsDesign::testBinomial() for binary.gsDesign::sequentialPValue(), then
test with graphicalMCP::graph_test_shortcut() at each analysis.For detailed code templates, read references/code_patterns.md.
Topics covered:
gsSurvCalendar, sfExtremeValue2, testLower, sequentialPValue). Sequential p-value theory: Liu & Anderson (2008).wlr() for logrank Z-statisticsgraph_create() and graph_test_shortcut() for multiplicity testingTheoretical basis: The per-trial sequential testing loop implements Algorithm 1 of Maurer & Bretz (2013). Sequential p-values from sequentialPValue() (Liu & Anderson, 2008) are passed to graph_test_shortcut() at each analysis to control FWER.
Sign conventions: wlr() returns positive Z when experimental is better. testBinomial(x1=exp, x2=ctrl) returns positive Z when experimental is better. Both conventions must match for sequentialPValue() (which expects positive Z = favorable).
Spending time in simulation: Use pmin(planned_events, actual_events) / planned_final_events at interim analyses and spending time = 1 at final analyses. This prevents over-spending when simulated events exceed planned.
ORR is not group sequential: ORR is tested at a single analysis (e.g., IA2). Use the nominal p-value pnorm(-z_orr) directly rather than a sequential p-value.
Separate design vs simulation effects: Use the design HR for sample size and bounds (e.g., 0.75), but weaker simulation HR (e.g., 0.80) for realistic operating characteristics.
Graph carries forward: Use the same graph_test_shortcut() call at each analysis with updated sequential p-values. The graph handles alpha reallocation from rejected hypotheses.
Track first rejection: Record the first analysis at which each hypothesis is rejected. Use this to compute cumulative rejection probabilities by analysis.
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 simulating clinical trials using the illness-death model with response. Use this skill when the user asks about: multi-state models for oncology trials, simulating correlated OS/PFS/ORR endpoints, transition rates between disease states, illness-death model calibration, building ADTTE datasets from simulation, analysis cut date determination, or theoretical survival curves from transition rates.