Skip to content

Commit f9b1038

Browse files
Merge pull request #94 from openpharma/modify_rpact_wording
Modify rpact wording
2 parents 7c5ec68 + c106485 commit f9b1038

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

vignettes/group-sequential-testing.Rmd

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,34 @@ directly wrapped for use with `graph_test_shortcut_gsd()`. However,
11891189
`gsDesign` and `rpact` implement the same standard spending function
11901190
formulas, so `gsDesign` wrappers can be used to achieve equivalent results.
11911191

1192+
However, it would be possible to use `rpact` if the `graphicalMCP` package functions interface
1193+
differently with `rpact` compared to `gsDesign`. In particular, this code snippet shows how to obtain the
1194+
repeated p-values from `rpact` shown in the above repeated p-values example:
1195+
1196+
```{r rpact-snippet}
1197+
rpact::setLogLevel("DISABLED")
1198+
repP <- function(pVals){
1199+
cum_n <- seq_along(pVals) * 2
1200+
design <- rpact::getDesignGroupSequential(typeOfDesign = "asOF", kMax = 3)
1201+
data <- rpact::getDataset(
1202+
cumMeans = c(qnorm(1 - pVals) / sqrt(cum_n)),
1203+
cumStDevs = rep(1, length(pVals)),
1204+
cumN = cum_n
1205+
)
1206+
stage_res <- rpact::getStageResults(design, data, normalApproximation = TRUE)
1207+
rpact::getRepeatedPValues(stage_res)
1208+
}
1209+
1210+
repP(c(0.0062, 0.0002))
1211+
repP(c(0.0170, 0.0035))
1212+
repP(c(0.0090, 0.0020))
1213+
repP(c(0.1300, 0.0600))
1214+
```
1215+
1216+
It would be more beneficial to use the built-in `rpact` integration routines to obtain these
1217+
repeated p-values, because this would provide an alternative computation method.
1218+
Merely supplying another implementation of the same simple spending function formulas
1219+
would not provide a meaningful alternative.
11921220
### User-Defined Spending Functions
11931221

11941222
Users can define entirely custom spending functions as long as they accept

0 commit comments

Comments
 (0)