Simulate phase 2/3 seamless design using a weighted log-rank test. Analyses can be triggered either by the cumulative number of events (combined for an active arm and the common control) or by pre-specified calendar times.
lrsim_seamless(
M = 2,
K = 1,
criticalValues = NA,
futilityBounds = NULL,
hazardRatioH0s = 1,
allocations = 1,
accrualTime = 0,
accrualIntensity = NA,
piecewiseSurvivalTime = 0,
stratumFraction = 1,
lambdas = NULL,
gammas = NULL,
n = NA,
followupTime = NA,
fixedFollowup = FALSE,
rho1 = 0,
rho2 = 0,
plannedEvents = NA,
plannedTime = NA,
maxNumberOfIterations = 1000,
maxNumberOfRawDatasetsPerStage = 0,
seed = 0,
nthreads = 0
)Number of active treatment arms in Phase 2.
Number of sequential looks in Phase 3.
Numeric vector of length \(K + 1\) giving the critical value for the Wald statistic at each look (Look 1 through Look \(K + 1\)). Decision rule:
At Look 1, compute the Wald statistic (which equals the negative of the logrank statistic) for each active arm versus the common control. If the largest test statistic exceeds the Look 1 critical value, stop for efficacy.
If the Look 1 stopping rule is not met, select the active arm with the largest Wald statistic and continue with that arm only versus control at subsequent looks.
For each look \(j = 2,\ldots,K+1\), compare the selected arm to control; if its Wald statistic exceeds the Look \(j\) critical value, stop for efficacy; otherwise continue.
If no critical value is exceeded by Look \(K + 1\), the procedure ends without rejection.
Numeric vector of length \(K\) giving the futility boundaries for Phase 2 and the first \(K-1\) looks in Phase 3. The study stops for futility:
in Phase 2 if the selected treatment arm crosses the phase-2 futility boundary;
in Phase 3 if the selected arm crosses the futility boundary at an interim look; If omitted, no interim futility stopping is applied.
Numeric vector of length \(M\). Hazard ratios under \(H_0\) for each active arm versus the common control. Defaults to 1 for superiority tests.
Integer or integer vector of length \(M + 1\). Number of subjects per arm within a randomization block. A single value implies equal allocation; defaults to 1. The first \(M\) elements refer to the active arms and the last element refers to the common control.
A vector that specifies the starting time of
piecewise Poisson enrollment time intervals. Must start with 0, e.g.,
c(0, 3) breaks the time axis into 2 accrual intervals:
\([0, 3)\) and \([3, \infty)\).
A vector of accrual intensities. One for each accrual time interval.
A vector that specifies the starting time of
piecewise exponential survival time intervals. Must start with 0, e.g.,
c(0, 6) breaks the time axis into 2 event intervals:
\([0, 6)\) and \([6, \infty)\).
Defaults to 0 for exponential distribution.
A vector of stratum fractions that sum to 1. Defaults to 1 for no stratification.
List of length \(M + 1\) (one element per arm). Each element is a scalar or a numeric vector of event hazard rates for the corresponding arm, given by analysis interval and stratum as required by the simulation. The first \(M\) elements refer to the active arms and the last element refers to the common control.
List of length \(M + 1\) (one element per arm). Each element is a scalar or a numeric vector of dropout hazard rates for the corresponding arm, by analysis interval and stratum. The first \(M\) elements refer to the active arms and the last element refers to the common control.
Planned total sample size across all active arms and control.
Follow-up time for the last enrolled subject.
Whether a fixed follow-up design is used.
Defaults to FALSE for variable follow-up.
The first parameter of the Fleming-Harrington family of weighted log-rank test. Defaults to 0 for conventional log-rank test.
The second parameter of the Fleming-Harrington family of weighted log-rank test. Defaults to 0 for conventional log-rank test.
Numeric vector of length \(K + 1\) giving the
planned cumulative number of events to trigger Look 1 through Look
\(K + 1\). Each entry refers to the combined events for the first
active arm and the common control. Use plannedEvents to schedule
event-driven looks.
Numeric vector of calendar times for the analyses.
If plannedTime is supplied, analyses are scheduled by calendar
time and plannedEvents should be left missing.
Number of Monte Carlo replications. Defaults to 1000.
Number of subject-level raw datasets to retain per stage (for selected replications).
Random seed for reproducibility.
Number of threads for parallel simulation. Use 0 to accept the default RcppParallel behavior.
An S3 object of class "lrsim_seamless" with these components:
overview: A list summarizing trial-level results and settings:
selectionProb: Probability of selecting each active arm 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.
numberOfDropouts: Cumulative dropouts by stage.
numberOfSubjects: Cumulative enrollments by stage.
analysisTime: Average calendar time for each stage among
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.
expectedNumberOfDropouts: Expected cumulative dropouts at trial end.
expectedNumberOfSubjects: Expected cumulative enrollments
at trial end.
expectedStudyDuration: Expected study duration.
criticalValues: The input critical values for each stage.
futilityBounds: The input futility boundaries for each stage.
hazardRatioH0s: The input hazard ratios under \(H_0\).
useEvents: Logical indicating whether analyses were event-driven.
numberOfIterations: Number of simulation iterations performed.
n: Planned total sample size.
allocations: The input allocation ratios.
fixedFollowup: Logical indicating whether fixed follow-up was used.
rho1, rho2: Fleming–Harrington weighting parameters used.
M: Number of active arms in Phase 2.
K: Number of sequential looks in Phase 3.
sumdata1: Data frame summarizing each iteration, stage, and
treatment group:
iterationNumber, eventsNotAchieved,
stopStage, stageNumber,
analysisTime, treatmentGroup, accruals,
events, dropouts.
For each stage the final row summarizes the overall study (all arms combined).
summdata2: Data frame summarizing log-rank statistics by iteration,
stage, and active arm:
iterationNumber, selectedArm, stopStage,
stageNumber, analysisTime, activeArm,
totalAccruals, totalEvents, totalDropouts,
uscore, vscore, logRankStatistic,
reject, futility.
For each active arm, total accruals, events, and dropouts refer to the combined counts for that arm and the common control at that stage.
rawdata (present when maxNumberOfRawDatasetsPerStage > 0):
Subject-level data for selected replications with variables:
iterationNumber, stopStage, stageNumber,
analysisTime, subjectId, arrivalTime,
stratum, treatmentGroup,
survivalTime, dropoutTime, timeUnderObservation,
event, dropoutEvent.
(sim1 <- lrsim_seamless(
M = 2,
K = 2,
criticalValues = c(3.882, 2.733, 2.222),
futilityBounds = c(0.259, 1.201),
accrualTime = c(0, 8),
accrualIntensity = c(10, 28),
piecewiseSurvivalTime = 0,
lambdas = list(log(2)/12*0.5, log(2)/12*0.7, log(2)/12),
n = 700,
plannedEvents = c(42, 84, 126),
maxNumberOfIterations = 10000,
maxNumberOfRawDatasetsPerStage = 1,
seed = 314159,
nthreads = 1))
#>
#> Phase 2/3 seamless group-sequential design for log-rank test
#> Empirical power: 0.8969
#> Number of active arms in phase 2: 2
#> Number of looks in phase 3: 2
#> Most promising phase-2 arm selected
#> Expected # events: 117.2
#> Expected # dropouts: 0
#> Expected # subjects: 417
#> Expected study duration: 22.2
#> n: 700, fixed follow-up: FALSE
#> Number of simulations: 10000
#>
#> Stage 1 Stage 2 Stage 3
#> Efficacy bounds (z-scale) 3.882 2.733 2.222
#> Futility bounds (z-scale) 0.259 1.201 2.222
#>
#> Arm 1 Arm 2
#> Selected as most promising in phase 2 0.8277 0.1723
#>
#> Arm 1 Arm 2
#> Selected to enter stage 2 0.7816 0.1658
#>
#> Probability
#> Any active arm selected to enter stage 2 0.9474
#>
#> Reject Active 1 Reject Active 2 Overall Rejection Futility Continue
#> Stage 1 0.0391 0.0025 0.0406 0.0120 0.9474
#> Stage 2 0.5396 0.0495 0.5891 0.0297 0.3286
#> Stage 3 0.2092 0.0580 0.2672 0.0614 0.0000
#> Total 0.7879 0.1100 0.8969 0.1031 NA
#>
#> activeArm stage cumReject cumFutility nEvents nDropouts nSubjects analysisTime
#> 1 1 0.0391 0.0120 63.3 0.0 298.5 15.8
#> 1 2 0.5787 0.0220 105.3 0.0 398.3 21.2
#> 1 3 0.7879 0.0448 147.8 0.0 477.6 25.4
#> 2 1 0.0025 0.0120 56.6 0.0 278.9 15.1
#> 2 2 0.0520 0.0317 104.4 0.0 383.3 20.7
#> 2 3 0.1100 0.0703 152.7 0.0 467.2 25.2
#> Overall 1 0.0406 0.0120 62.1 0.0 295.1 15.7
#> Overall 2 0.6297 0.0417 105.1 0.0 395.7 21.1
#> Overall 3 0.8969 0.1031 149.2 0.0 474.5 25.3