Repository navigation
Add vignette on group sequential testing with rpact - #113
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 therpact-enginebranch, wheregraph_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:getDesignGroupSequential()(alphaSpent,criticalValues,stageLevels), with the mapping of graphicalMCP's spending functions to rpact's design types.c_k(alpha) = Z_kon the design's critical values, shown withuniroot()and compared withrpact::getRepeatedPValues()(agree to 8.5e-7); sequential p-values as the cumulative minimum.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.look_back = TRUE), per-hypothesislook_back, and the "when look_back makes a difference" scenario."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."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 againstgraph_test_shortcut_gsd().Also registers the vignette in
_pkgdown.ymlandNEWS.md, and addsrpact's,graphicalMCP's,Chamtoinst/WORDLIST.Verification
rmarkdown::renderunderpkgload::load_all).mvtnormengine (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 arege/lefrom 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, sonrow()isNULL) — warnings ingraph_test_shortcut()/graph_test_closure(), a hard error ingraph_test_shortcut_gsd(). The vignette avoids one-node graphs; the bug is tracked separately.🤖 Generated with Claude Code