View source: R/rdsim_seamless.R
| rdsim_seamless | R Documentation |
Simulate phase 2/3 seamless design testing for risk difference.
rdsim_seamless(
M = 2,
K = 1,
rankp0 = 1,
criticalValues = NA,
futilityBounds = NULL,
riskDiffH0s = 0,
allocations = 1,
pis = NULL,
nullVariance = TRUE,
n = NA,
plannedSubjects = NA,
maxNumberOfIterations = 1000,
seed = 0,
nthreads = 0
)
M |
Number of active treatment arms in Phase 2. |
K |
Number of sequential looks in Phase 3. |
rankp0 |
Integer rank in phase 2 used to select the active arm.
|
criticalValues |
Numeric vector of length
|
futilityBounds |
Numeric vector of length
|
riskDiffH0s |
Numeric vector of length |
allocations |
Integer or integer vector of length |
pis |
Numeric vector of length |
nullVariance |
Whether to use the variance under the null or the empirical variance under the alternative. |
n |
Planned total sample size across all active arms and control. |
plannedSubjects |
Numeric vector of length |
maxNumberOfIterations |
Number of Monte Carlo replications. Defaults to 1000. |
seed |
Random seed for reproducibility. |
nthreads |
Number of threads for parallel simulation. Use 0 to accept the default RcppParallel behavior. |
An S3 object of class "rdsim_seamless" with these components:
overview: A list summarizing trial-level results and settings:
selectionProb: Probability of selecting each active arm at
the prespecified rank at the end of phase 2.
selectToStage2: Probability of selecting each active arm
to enter stage 2.
selectAnyToStage2: Probability of selecting any active arm
to enter stage 2.
rejectPerStage: Probability of rejecting the null for each
active arm at each stage.
futilityPerStage: Probability of futility stopping for each
active arm at each stage.
cumulativeRejection: Cumulative probability of rejection by stage.
cumulativeFutility: Cumulative futility stopping probabilities
by stage.
numberOfEvents: Cumulative event counts by stage, including
events from all arms in stage 1 and events from the selected arm
and control in later stages.
numberOfSubjects: Cumulative enrollments by stage.
replications that reached that stage.
overallReject: Overall probability of rejecting the null
by trial end.
overallFutility: Overall probability of stopping for futility
by trial end.
expectedNumberOfEvents: Expected cumulative events at trial end.
expectedNumberOfSubjects: Expected cumulative enrollments
at trial end.
criticalValues: The input critical values for each stage.
futilityBounds: The input futility boundaries for each stage.
riskDiffH0s: The input risk differences under H_0.
nullVariance: Whether to use variance under H_0.
numberOfIterations: Number of simulation iterations performed.
n: Planned total sample size.
allocations: The input allocation ratios.
responseRates: The input response rates for each arm.
plannedSubjects: The input planned cumulative sample size at
each look for the first active arm and the common control combined.
M: Number of active arms in Phase 2.
K: Number of sequential looks in Phase 3.
rankp0: Prespecified rank used for phase-2 arm selection.
sumdata1: Data frame summarizing each iteration, stage, and
treatment group:
iterationNumber, stopStage, stageNumber,
treatmentGroup, accruals, events, phat.
For each stage the final row summarizes the overall study (all arms combined).
summdata2: Data frame summarizing test statistics by iteration,
stage, and active arm:
iterationNumber, selectedArm, stopStage,
stageNumber, activeArm,
totalAccruals, totalEvents,
riskDiff, vriskDiff, riskDiffZ,
reject, futility.
For each active arm, total accruals and events refer to the combined counts for that arm and the common control at that stage.
Kaifeng Lu, kaifenglu@gmail.com
(sim1 <- rdsim_seamless(
M = 3,
K = 1,
criticalValues = c(8, 2.349),
futilityBounds = 1.036,
pis = c(0.22, 0.25, 0.35, 0.20),
n = 1120,
plannedSubjects = c(280, 560),
maxNumberOfIterations = 10000,
seed = 314159,
nthreads = 1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.