Computes either the maximum information and stopping boundaries for a phase 2/3 seamless design, or the achieved power when the maximum information and stopping boundaries are provided. Both efficacy and futility stopping can be incorporated.
getDesign_seamless(
beta = NA_real_,
IMax = NA_real_,
theta = NA_real_,
M = NA_integer_,
r = 1,
corr_known = TRUE,
K = 1L,
informationRates = NA_real_,
efficacyStopping = NA_integer_,
futilityStopping = NA_integer_,
criticalValues = NULL,
alpha = 0.025,
typeAlphaSpending = "sfOF",
parameterAlphaSpending = NA_real_,
userAlphaSpending = NA_real_,
futilityBounds = NULL,
futilityCP = NULL,
futilityTheta = NULL,
typeBetaSpending = "none",
parameterBetaSpending = NA_real_,
userBetaSpending = NA_real_,
spendingTime = NA_real_,
rankp0 = 1L,
nthreads = 0
)An S3 object of class seamless with the following components:
overallResults: A data frame containing:
overallReject: Overall probability of rejecting the null
hypothesis.
alpha: Overall significance level.
attainedAlpha: The attained significance level, which may
differ from alpha in the presence of futility stopping.
M: Number of active arms in Phase 2.
r: Randomization ratio per active arm versus control in
Phase 2.
corr_known: Whether the phase-2 correlation was assumed known.
rankp0: The rank of the selected arm at the end of Phase 2.
K: Number of looks in Phase 3.
information: Maximum information for any active arm versus
control.
expectedInformationH1: Expected information under the
alternative.
expectedInformationH0: Expected information under the null.
informationOverall: Maximum information for the overall study.
expectedInformationH1: Expected information under the
alternative for the overall study.
expectedInformationH0: Expected information under the null
for the overall study.
byStageResults: A data frame containing:
informationRates: Information rates at each analysis.
efficacyBounds: Efficacy boundaries on the Z scale.
futilityBounds: Futility boundaries on the Z scale.
rejectPerStage: Probability of efficacy stopping at each stage.
futilityPerStage: Probability of futility stopping at each
stage.
cumulativeRejection: Cumulative probability of efficacy
stopping.
cumulativeFutility: Cumulative probability of futility
stopping.
cumulativeAlphaSpent: Cumulative alpha spent.
efficacyTheta: Efficacy boundaries on the parameter scale.
futilityTheta: Futility boundaries on the parameter scale.
efficacyP: Efficacy boundaries on the p-value scale.
futilityP: Futility boundaries on the p-value scale.
information: Cumulative information at each analysis.
informationOverall: Cumulative information for the overall
study at each analysis.
efficacyStopping: Indicator of whether efficacy stopping is
permitted.
futilityStopping: Indicator of whether futility stopping is
permitted.
rejectPerStageH0: Probability of efficacy stopping under the
global null.
futilityPerStageH0: Probability of futility stopping under the
global null.
cumulativeRejectionH0: Cumulative probability of efficacy
stopping under the global null.
cumulativeFutilityH0: Cumulative probability of futility
stopping under the global null.
byArmResults: A data frame containing:
theta: Parameter values for the active arms.
selectionProb: Probability an arm is selected at the
end of Phase 2.
powerByArm: Probability of rejecting the null for each arm by
trial end.
condPowerByArm: Conditional power for each arm given it was
selected at rank rankp0 at the end of Phase 2.
settings: A list of input settings:
typeAlphaSpending: Type of alpha spending function.
parameterAlphaSpending: Parameter value for the chosen alpha
spending function.
userAlphaSpending: User-specified alpha spending values.
typeBetaSpending: Type of beta spending function.
parameterBetaSpending: Parameter value for the chosen beta
spending function.
userBetaSpending: User-specified beta spending values.
spendingTime: Error-spending times at each analysis.
Type II error rate. Provide either beta or IMax;
the other should be missing.
Maximum information for any active arm versus the common
control. Provide either IMax or beta; the other should
be missing.
A vector of length \(M\) representing the true treatment effects for each active arm versus the common control. The global null is \(\theta_i = 0\) for all \(i\), and alternatives are one-sided: \(\theta_i > 0\) for at least one \(i = 1, \ldots, M\).
Number of active treatment arms in Phase 2.
Randomization ratio of each active arm to the common control in Phase 2.
Logical. If TRUE, the correlation between Wald
statistics in Phase 2 is derived from the randomization ratio \(r\)
as \(r / (r + 1)\). If FALSE, a conservative correlation of
0 is used, which is only valid when rankp0 = 1 (i.e., the arm
with the largest Phase-2 Z-statistic is selected for Phase 3).
This option is only used for critical value calculations; the
correlation is always derived from \(r\) for power calculations.
Number of sequential looks in Phase 3.
A numeric vector of information rates fixed before the trial. If unspecified, defaults to \((1:(K+1)) / (K+1)\).
Indicators of whether efficacy stopping is allowed
at each stage. Defaults to TRUE if left unspecified.
Indicators of whether futility stopping is allowed
at each stage. Defaults to TRUE if left unspecified.
The upper boundaries on the Z-statistic scale for the rank-selected arm in Phase 2 and the Z statistics for the selected arm in Phase 3. If missing, boundaries will be computed based on the specified alpha spending function.
The significance level. Defaults to 0.025.
The type of alpha spending. One of the following:
"OF" for O'Brien-Fleming boundaries,
"P" for Pocock boundaries,
"WT" for Wang & Tsiatis boundaries,
"sfOF" for O'Brien-Fleming type spending function,
"sfP" for Pocock type spending function,
"sfKD" for Kim & DeMets spending function,
"sfHSD" for Hwang, Shi & DeCani spending function,
"user" for user defined spending, and
"none" for no early efficacy stopping.
Defaults to "sfOF".
The parameter value for the alpha spending.
Corresponds to \(\Delta\) for "WT", \(\rho\) for "sfKD",
and \(\gamma\) for "sfHSD".
The user defined alpha spending. Cumulative alpha spent up to each stage.
A numeric vector of length \(K\) specifying futility boundaries on the Z scale at the end of Phase 2 for the rank-selected arm and on the Z scale for the \(K - 1\) analyses in Phase 3. The final analysis uses the efficacy boundary as the futility boundary.
A numeric vector of length \(K\) specifying futility boundaries on the conditional power scale.
A numeric vector of length \(K\) specifying futility boundaries on the parameter scale.
The type of beta spending. One of the following:
"sfOF" for O'Brien-Fleming type spending function,
"sfP" for Pocock type spending function,
"sfKD" for Kim & DeMets spending function,
"sfHSD" for Hwang, Shi & DeCani spending function,
"user" for user defined spending, and
"none" for no early futility stopping.
Defaults to "none".
The parameter value for the beta spending.
Corresponds to \(\rho\) for "sfKD", and
\(\gamma\) for "sfHSD".
The user defined beta spending. Cumulative beta spent up to each stage.
A numeric vector of length \(K+1\) specifying the
error spending time at each analysis. Values must be strictly increasing
and end at 1. If omitted, defaults to informationRates.
An integer between 1 and M specifying which ranked
Phase-2 arm is carried forward. rankp0 = 1 selects the largest
Phase-2 Z-statistic, rankp0 = 2 selects the second largest, and
so on.
The number of threads to use (0 leaves the RcppParallel setting unchanged).
Kaifeng Lu, kaifenglu@gmail.com
If corr_known is FALSE, critical boundaries are
computed assuming independence among the Phase-2 Wald statistics
(a conservative assumption when rankp0 = 1). Power calculations,
however, use the correlation implied by the randomization ratio \(r\).
Futility boundaries may be supplied directly on the Z scale, derived from conditional power, derived from parameter values, or computed from a beta spending function.
Ping Gao, Yingqiu Li. Adaptive two-stage seamless sequential design for clinical trials. Journal of Biopharmaceutical Statistics, 2025, 35(4), 565-587.
# Example 1: obtain the maximum information given power with no futility
(design1 <- getDesign_seamless(
beta = 0.1, theta = c(0.3, 0.5), M = 2, r = 1.0,
K = 2, informationRates = seq(1, 3)/3,
alpha = 0.025, typeAlphaSpending = "OF", nthreads = 1))
# Example 2: obtain power given the maximum information and a futility rule
(design2 <- getDesign_seamless(
IMax = 110/(2*1^2), theta = c(0.3, 0.5), M = 2, r = 1.0,
K = 2, informationRates = seq(1, 3)/3,
alpha = 0.025, typeAlphaSpending = "OF",
futilityBounds = c(0.0, 0.5), nthreads = 1))
# Example 3: derive futility boundaries using beta spending
(design3 <- getDesign_seamless(
beta = 0.1, theta = c(-log(0.5), -log(0.7)),
M = 2, r = 1.0, corr_known = FALSE,
K = 2, informationRates = seq(1, 3)/3,
alpha = 0.025, typeAlphaSpending = "sfOF",
typeBetaSpending = "sfHSD", parameterBetaSpending = -2,
nthreads = 1))
Run the code above in your browser using DataLab