Skip to content

Add vignette on group sequential testing with rpact - #113

Merged
xidongdxi merged 2 commits into
rpact-enginefrom
rpact-vignette
Oct 15, 2026
Merged

xidongdxi merged 2 commits into
rpact-enginefrom
rpact-vignette

Conversation

@xidongdxi

@xidongdxi xidongdxi commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Adds vignettes/group-sequential-testing-rpact.Rmd — "Graphical Approaches in Group Sequential Design: Combining graphicalMCP and rpact" — the rpact counterpart of the gsDesign vignette, mirroring it section for section. Targets the rpact-engine branch, where graph_test_shortcut_rpact() lives.

Contents

Reproduces both case studies of the group sequential testing vignette with graph_test_shortcut_rpact() and shows how rpact is used inside the function:

  • Spending and boundaries from getDesignGroupSequential() (alphaSpent, criticalValues, stageLevels), with the mapping of graphicalMCP's spending functions to rpact's design types.
  • Repeated p-values as the root of c_k(alpha) = Z_k on the design's critical values, shown with uniroot() and compared with rpact::getRepeatedPValues() (agree to 8.5e-7); sequential p-values as the cumulative minimum.
  • Diabetes case study (Maurer & Bretz 2013, 2 of 3 analyses, look_back = FALSE), including why a schedule may end before full information for alpha spending designs but not for the classical boundary families, the key inequality, test_values, and the boundary table.
  • Oncology case study (1–3 analyses per hypothesis, look_back = TRUE), per-hypothesis look_back, and the "when look_back makes a difference" scenario.
  • Spending time via the two-step "asUser" construction, monitoring under changed final information with the three-scenario boundary comparison done in pure rpact, and the equivalence of over-running information fractions.
  • Additional examples: design types per hypothesis, rpact's alpha spending types on the diabetes trial, the classical families ("OF", "P", "WT") on the oncology trial (whose schedules run to 1), and user-defined spending via "asUser" — including an explicit demonstration of its limit for spending functions whose shape depends on the level, with a comparison against graph_test_shortcut_gsd().

Also registers the vignette in _pkgdown.yml and NEWS.md, and adds rpact's, graphicalMCP's, Cham to inst/WORDLIST.

Verification

  • Renders without warnings or errors (rmarkdown::render under pkgload::load_all).
  • Every example was cross-checked against the mvtnorm engine (graph_test_shortcut_gsd()): identical rejections and decision analyses, repeated/adjusted p-values agreeing to about 1e-6, boundaries to 1e-5 or better — except the "asUser" piecewise example, where the difference is the point being made.
  • devtools::spell_check(): the only words flagged in the new vignette are ge/le from LaTeX \ge/\le, which are flagged identically in the existing gsDesign and main vignettes.

Wording of the classical-family requirement

The classical boundary families need the final information fraction to be exactly 1 because their boundary constant is calibrated over the whole planned schedule — a property of the designs, not an rpact rule (graphicalMCP's own spending_wt() imposes the same requirement). The second commit rewords the engine's error message, its documentation, and the vignette to say so.

Note

Writing the vignette surfaced a pre-existing bug unrelated to rpact: test_input_val() mishandles single-hypothesis graphs (weighting_strategy[, 1] drops to a vector, so nrow() is NULL) — warnings in graph_test_shortcut()/graph_test_closure(), a hard error in graph_test_shortcut_gsd(). The vignette avoids one-node graphs; the bug is tracked separately.

🤖 Generated with Claude Code

xidongdxi and others added 2 commits October 15, 2026 10:53
Add "Graphical Approaches in Group Sequential Design: Combining
graphicalMCP and rpact", the rpact counterpart of the gsDesign vignette.
It reproduces the Maurer and Bretz (2013) diabetes case study and the
oncology case study of the group sequential testing vignette with
graph_test_shortcut_rpact(), and shows how rpact is used inside the
function:

* spending and boundaries from getDesignGroupSequential() (alphaSpent,
  criticalValues, stageLevels), and the mapping of graphicalMCP's
  spending functions to rpact's design types;
* the repeated p-value as the root of c_k(alpha) = Z_k on the design's
  critical values, compared with rpact::getRepeatedPValues();
* why a schedule may end before full information for alpha spending
  designs but not for the classical boundary families;
* spending time and monitoring under changed final information through
  the two-step "asUser" construction, and the equivalence of over-running
  information fractions;
* rpact's design types per hypothesis, the classical families on the
  oncology trial, and the limits of "asUser" for spending functions
  whose shape depends on the level.

Register the vignette in _pkgdown.yml and NEWS.md and add the new words
to inst/WORDLIST. The vignette renders without warnings; every result
agrees with graph_test_shortcut_gsd() (rejections identical, p-values to
about 1e-6) except for the deliberately shown "asUser" caveat.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The classical boundary families ("OF", "P", "WT") are defined by a
boundary shape over the whole planned schedule, with a constant calibrated
so that the crossing probability over all planned analyses equals the
level. Without the final analysis the design is undefined, so the final
information fraction must be exactly 1. This is a property of the designs
themselves, which rpact enforces and which graphicalMCP's own
spending_wt() imposes as well.

Reword the error message of graph_test_shortcut_rpact(), its
documentation, and the two passages of the rpact vignette that attributed
the requirement to rpact, so that they describe it as inherent and point
to alpha spending designs for analyses conducted so far.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@xidongdxi
xidongdxi merged commit b822a37 into rpact-engine Oct 15, 2026
10 checks passed
@xidongdxi
xidongdxi deleted the rpact-vignette branch October 15, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant