We simulate data from a discrete distribution for the Rankin scores, which are ordinal integers from 0 to 6 in the following simulations. So we define a few scenarios.
library(ASSISTant)
null.uniform <- rep(1, 7L) ## uniform on 7 support points
hourglass <- c(1, 2, 2, 1, 2, 2, 1)
inverted.hourglass <- c(2, 1, 1, 2, 1, 1, 2)
bottom.heavy <- c(2, 2, 2, 1, 1, 1, 1)
bottom.heavier <- c(3, 3, 2, 2, 1, 1, 1)
top.heavy <- c(1, 1, 1, 1, 2, 2, 2)
top.heavier <- c(1, 1, 1, 2, 2, 3, 3)
ctlDist <- null.uniform
trtDist <- cbind(null.uniform, null.uniform, null.uniform,
hourglass, hourglass, hourglass)
##d <- generateDiscreteRankinScores(rep(1, 6), 10, ctlDist, trtDist)
This is the null setting.
data(LLL.SETTINGS)
designParameters <- list(prevalence = rep(1/6, 6),
ctlDist = ctlDist,
trtDist = trtDist)
designA <- ASSISTDesign$new(trialParameters = LLL.SETTINGS$trialParameters,
designParameters = designParameters, discreteData = TRUE)
print(designA)
## Design Parameters:
## Number of Groups: 6
## Prevalence:
##
## Group1 Group2 Group3 Group4 Group5 Group6
## ---------- ---------- ---------- ---------- ---------- ----------
## 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667 0.1666667
##
## Using Discrete Rankin scores? TRUE
##
## Null Rankin Distribution:
##
## Prob.
## --- ----------
## 0 0.1428571
## 1 0.1428571
## 2 0.1428571
## 3 0.1428571
## 4 0.1428571
## 5 0.1428571
## 6 0.1428571
## Null Distribution Mean: 3.000000, SD: 2.000000
##
## Alternative Rankin Distribution:
##
##
## Group1 Group2 Group3 Group4 Group5 Group6
## --- ---------- ---------- ---------- ---------- ---------- ----------
## 0 0.1428571 0.1428571 0.1428571 0.0909091 0.0909091 0.0909091
## 1 0.1428571 0.1428571 0.1428571 0.1818182 0.1818182 0.1818182
## 2 0.1428571 0.1428571 0.1428571 0.1818182 0.1818182 0.1818182
## 3 0.1428571 0.1428571 0.1428571 0.0909091 0.0909091 0.0909091
## 4 0.1428571 0.1428571 0.1428571 0.1818182 0.1818182 0.1818182
## 5 0.1428571 0.1428571 0.1428571 0.1818182 0.1818182 0.1818182
## 6 0.1428571 0.1428571 0.1428571 0.0909091 0.0909091 0.0909091
## Alternative Mean and SD
##
## Group1 Group2 Group3 Group4 Group5 Group6
## ----- ------- ------- ------- --------- --------- ---------
## mean 3 3 3 3.000000 3.000000 3.000000
## sd 2 2 2 1.858641 1.858641 1.858641
##
## Trial Parameters:
## List of 5
## $ N : num [1:3] 300 400 500
## $ type1Error: num 0.05
## $ eps : num 0.5
## $ type2Error: num 0.2
## $ effectSize: num 0.0642
##
## Boundaries:
##
##
## btilde b c
## ---------- --------- ---------
## -1.460993 2.390404 2.491775
result <- designA$explore(numberOfSimulations = 5000, showProgress = FALSE)
analysis <- designA$analyze(result)
print(designA$summary(analysis))
## P(Reject H0_ITT) = 0.016800; P(Reject H0_subgp) = 0.023000; P(Reject H0) = 0.039800
## P(Early stop for efficacy [futility]) = 0.025400 [0.555200]
## Mean [SD] Randomized N = 421.740000 [75.779423]
##
## Stage at exit (proportion)
##
##
## exitStage proportion
## ---------- -----------
## 1 0.2020
## 2 0.3786
## 3 0.4194
##
## Mean [SD] Lost N = 181.395400 [92.385183]
## Mean [SD] Analyzed N = 240.344600 [99.145577]
##
## Mean loss by futility stage and subgroup
##
##
## FutilityStage selectedGroup mean sd
## -------------- -------------- ---------- ----------
## 1 1 249.97900 6.372633
## 1 2 199.85776 8.041504
## 1 3 150.07692 8.570802
## 1 4 99.69504 8.147290
## 1 5 50.15759 6.558217
## 2 1 331.72993 7.298775
## 2 2 267.16071 8.749315
## 2 3 200.20779 10.050318
## 2 4 133.50926 9.183992
## 2 5 65.96571 7.512363
## 3 1 417.64085 8.449551
## 3 2 332.59836 10.244660
## 3 3 249.78030 9.816106
## 3 4 166.43333 11.670571
## 3 5 83.14793 8.661899
##
## Chance of each subpopulation rejected
##
##
## group count proportion
## ------ ------ -----------
## 1 45 0.0090
## 2 28 0.0056
## 3 15 0.0030
## 4 21 0.0042
## 5 6 0.0012
## 6 84 0.0168
##
## Counts by futility stage and subgroup choice
##
##
## FutilityStage G1 G2 G3 G4 G5
## -------------- ----- ---- ---- ---- ----
## 1 1286 689 481 423 514
## 2 137 112 77 108 175
## 3 142 122 132 180 338
##
## CI Statistics:
## Overall coverage and coverage for rejections:
##
## overall rejection
## -------- ----------
## 1 1
##
## P(theta_test is in the confidence interval)
##
##
## coverage selectedCount rejectedCount
## --------- -------------- --------------
## 1 1565 45
## 1 923 28
## 1 690 15
## 1 711 21
## 1 1027 6
## 1 84 84
## NULL