Title: | Multiplicity Control on Drop-the-Losers Designs |
Version: | 0.1.0 |
Description: | A tool to calculate the correlation boundary for the correlation between the response rate and the log-rank test statistic for the binary surrogate endpoint and the time-to-event primary endpoint, as well as conduct simulation studies to obtain design operating characteristics of the drop-the-losers design. |
License: | GPL (≥ 3) |
Depends: | shiny, shinythemes, ggplot2 |
Imports: | survival, stringr, DT, gsDesign, coin, dplyr, stats, tidyr, mvtnorm, cubature |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | no |
Packaged: | 2025-05-15 18:12:00 UTC; weibin.zhong |
Author: | Weibin Zhong [aut, cre], Jing-ou Liu [aut], chenguang Wang [aut] |
Maintainer: | Weibin Zhong <wzhong3@gmu.edu> |
Repository: | CRAN |
Date/Publication: | 2025-05-19 14:10:02 UTC |
Minimum significance level for the final stage under drop-the-losers (DTL) design
Description
Get minimum significance level alpha_t (minimum of alpha_s) for the final analysis considering the ranges of response rate q and hazard ratio of responders and non-responders gamma given a pre-specified FWER alpha
Usage
dtl_app_get_alpha_t(n, N, q_seq, gamma_seq, alpha, fix_rho = NULL, delta)
Arguments
n |
Number of patients per treatment arm at the DTL look. |
N |
Total number of patients in both selected and control arms at final analysis. |
q_seq |
A vector of response rates under the null (can be 95% CI). |
gamma_seq |
A vector of hazards ratios of responders and non-responders (can be 95% CI). |
alpha |
A pre-specified FWER. |
fix_rho |
Use fixed correlation coefficient or use theoretical upper bound to get alpha_t. If = NULL, then it uses upper bound; else if = real number between 0 and 1, then it use such number as fixed correlation coefficient. |
delta |
Least difference to decide superiority of high dose. |
Value
A list of two data frames for minimum significance level alpha_t and significance level alpht_s given all combinations of q_seq and gamma_seq.
Examples
# Inputs
n = 80
N = 152
q_seq = seq(0.19, 0.32, 0.01)
gamma_seq = seq(0.14, 0.34, 0.01)
alpha = 0.025
delta = 0.05
# Use fixed correlation coefficient
dtl_app_get_alpha_t(n, N, q_seq, gamma_seq, alpha, fix_rho = 1, delta)
# Use theoretical upper bound
dtl_app_get_alpha_t(n, N, q_seq, gamma_seq, alpha, fix_rho = NULL, delta)
Numerical minimum significance level for the final stage under drop-the-losers (DTL) design
Description
Get numerical minimum significance level alpha_t (minimum of alpha_s) for the final analysis considering the ranges of response rate q and hazard ratio of responders and non-responders gamma given a pre-specified FWER alpha
Usage
dtl_app_get_alpha_t_sim(
nsim = 1e+05,
n,
N,
q_seq,
gamma_seq,
alpha,
fix_rho = NULL,
sel_g_func = sel_g_func_default,
...
)
Arguments
nsim |
Number of replicates. |
n |
Number of patients per treatment arm at the DTL look |
N |
Total number of patients in both selected and control arms at final analysis. |
q_seq |
A vector of response rates under the null (can be 95% CI). |
gamma_seq |
A vector of hazards ratios of responders and non-responders (can be 95% CI). |
alpha |
A pre-specified FWER. |
fix_rho |
Use fixed correlation coefficient or use theoretical upper bound to get alpha_t. If = NULL, then it uses upper bound; else if = real number between 0 and 1, then it use such number as fixed correlation coefficient. |
sel_g_func |
Arm-select function. The default function is sel_g_func_default(W_2, W_1, delta). Users can define their own arm-select function. The format of the function must be function_name(W_2, W_1, ...). The return values must be 1 (arm 1 is selected) or 2 (arm 2 is selected) or 0 (stop for futility). |
... |
Other arguments from sel_g_func. |
Value
A list of two data frames for numerical minimum significance level alpha_t and significance level alpht_s given all combinations of q_seq and gamma_seq.
Examples
# Inputs
set.seed(1000)
nsim = 100000
n = 80
N = 152
q_seq = seq(0.19, 0.32, 0.01)
gamma_seq = seq(0.14, 0.34, 0.01)
alpha = 0.025
delta = 0.05
# Use fixed correlation coefficient
dtl_app_get_alpha_t_sim(nsim, n, N, q_seq, gamma_seq, alpha,
fix_rho = 1, delta = delta)
# Use theoretical upper bound
dtl_app_get_alpha_t_sim(nsim, n, N, q_seq, gamma_seq, alpha,
fix_rho = NULL, delta = delta)
Simulation study for drop-the-losers (DTL) trial.
Description
Simulation study for a trial based on the DTL design
Usage
dtl_app_sim(
nsim,
alpha_t,
D,
N,
n,
mPFS,
q,
gamma,
drop_rate,
enroll,
interim_t,
sel_g_func = sel_g_func_default,
...
)
Arguments
nsim |
Number of replicates. |
alpha_t |
significance level for the final stage (recommend to use minimum significance level alpha_t to control family-wise type I error rate). |
D |
Total number of events. |
N |
Total number of patients in both selected and control arms at final analysis. |
n |
Number of patients per treatment arm at the DTL look. |
mPFS |
A 3-entry vector of median progression-free survival times (in days) for control, low dose and high dose arms. |
q |
A 3-entry vector of response rates under the null. |
gamma |
Hazards ratio of responders and non-responders. |
drop_rate |
Annual drop-out rate. |
enroll |
Annual enrollment rate. |
interim_t |
A vector of information fractions of final stage. |
sel_g_func |
Arm-select function. The default function is sel_g_func_default(W_2, W_1, delta). Users can define their own arm-select function. The format of the function must be function_name(W_2, W_1, ...). The return values must be 1 (arm 1 is selected) or 2 (arm 2 is selected) or 0 (stop for futility). |
... |
Other arguments from sel_g_func. |
Value
A one row data frame of simulation results, including the parameter settings, the O'Brien-Fleming boundaries for interim and final analyses: c.1, c.2, the overall censoring rate: cen_rate, the mean study duration: dur, the probability of selecting high dose / low dose / no dose: prob_sel_2, prob_sel_1, prob_sel_0, the probability of rejecting H_1 or H_2: rej_12, the probability of rejecting H_1 only: rej_1, the probability of rejecting H_2 only: rej_2.
Examples
# Inputs
set.seed(1000)
nsim = 1000
alpha_t = 0.018
D = 162
N = 152
n = 80
mPFS = c(180, 276, 300)
q = c(0.2, 0.4, 0.5)
mPFS_null = rep(180, 3)
q_null = rep(0.2, 3)
gamma = 0.15
drop_rate = 0.05
enroll = 20 * 12
interim_t = c(0.5, 1)
delta = 0.05
# Type I Error
dtl_app_sim(nsim, alpha_t, D, N, n, mPFS_null, q_null, gamma, drop_rate,
enroll, interim_t, delta = delta)
# Power
dtl_app_sim(nsim, alpha_t, D, N, n, mPFS, q, gamma, drop_rate, enroll,
interim_t, delta = delta)
Simulate a single drop-the-losers (DTL) trial.
Description
Simulate a single trial based on the DTL design
Usage
dtl_app_sim_single(
D,
N,
n,
mPFS,
q,
gamma,
drop_rate,
enroll,
interim_t,
sel_g_func = sel_g_func_default,
...
)
Arguments
D |
Total number of events. |
N |
Total number of patients in both selected and control arms at final analysis. |
n |
Number of patients per treatment arm at the DTL look. |
mPFS |
A 3-entry vector of median progression-free survival times for control, low dose and high dose arms (assume exponential time-to-event outcome for all arms and the conditional distribution for responders and non-responders can be uniquely identified given q and gamma). |
q |
A 3-entry vector of response rates under the null. |
gamma |
Hazards ratio of responders and non-responders. |
drop_rate |
Annual drop-out rate. |
enroll |
Annual Enrollment rate. |
interim_t |
A vector of information fractions of final stage. |
sel_g_func |
Arm-select function. The default function is sel_g_func_default(W_2, W_1, delta). Users can define their own arm-select function. The format of the function must be function_name(W_2, W_1, ...). The return values must be 1 (arm 1 is selected) or 2 (arm 2 is selected) or 0 (stop for futility). |
... |
Other arguments from sel_g_func. |
Value
A list including (1) a data frame of response rates of low dose and high dose W_1, W_2 and the log-rank test statistics Z_jk at kth interim analysis if the jth arm is selected at DTL look; (2) data frames of simulated data at DTL look; (3) data frames of simulated data at interim or final analyses.
Examples
# Inputs
set.seed(1000)
D = 162
N = 152
n = 80
mPFS = c(180, 276, 300)
q = c(0.2, 0.4, 0.5)
gamma = 0.15
drop_rate = 0.05
enroll = 20 * 12
interim_t = c(0.5, 1)
delta = 0.05
# Run function
dtl_app_sim_single(D, N, n, mPFS, q, gamma, drop_rate, enroll, interim_t, delta = delta)
Theoretical upper bound of correlation coefficient between time-to-event primary endpoint and binary surrogate endpoint
Description
Get theoretical upper bound of correlation coefficient
Usage
dtl_cor_the_PH_upper_bound(tau_k, pi_ar = 0.5, q, gamma)
Arguments
tau_k |
Equals n/n_k, where n is the number of patients per treatment arm at the DTL look and n_k is the number of patients in both selected and control arms at the kth interim analysis. |
pi_ar |
Allocation rate of treatment and control (0.5 by default) |
q |
Response rate under the null |
gamma |
Hazards ratio of responders and non-responders |
Value
Theoretical upper bound of correlation coefficient
Examples
dtl_cor_the_PH_upper_bound(tau_k = 0.4, pi_ar = 0.5, q = 0.3, gamma = 0.2)
Significance level given a fixed correlation coefficient for the final stage under drop-the-losers (DTL) design
Description
Get significant level alpha_s based on a pre-specified FWER alpha given a fixed correlation coefficient for the final stage (reverse calculation of dtl_tier_the())
Usage
dtl_get_alpha_s(n, t, rho, q, alpha, delta)
Arguments
n |
Sample size per arm at DTL look |
t |
A vector of information fraction of final stage |
rho |
Fixed correlation coefficient |
q |
Response rate under the null |
alpha |
A pre-specified FWER |
delta |
Least difference to decide superiority of high dose |
Value
Significance level alpha_s for the final stage
Examples
# Without interim analysis
dtl_get_alpha_s(n = 80, t = 1, rho = 0.4, q = 0.3, alpha = 0.025, delta = 0.05)
Numerical significance level given a fixed correlation coefficient for the final stage under drop-the-losers (DTL) design
Description
Get the numerical significant level alpha_s based on a pre-specified FWER alpha given a fixed correlation coefficient for the final stage by simulation (reverse calculation of dtl_tier_sim())
Usage
dtl_get_alpha_s_sim(
nsim = 1e+05,
n,
t,
rho,
q,
alpha,
sel_g_func = sel_g_func_default,
...
)
Arguments
nsim |
Number of replicates |
n |
Sample size per arm at DTL look |
t |
A vector of information fraction of final stage |
rho |
Fixed correlation coefficient |
q |
Response rate under the null |
alpha |
A pre-specified FWER |
sel_g_func |
Arm-select function. The default function is sel_g_func_default(W_2, W_1, delta). Users can define their own arm-select function. The format of the function must be function_name(W_2, W_1, ...). The return values must be 1 (arm 1 is selected) or 2 (arm 2 is selected) or 0 (stop for futility). |
... |
Other arguments from sel_g_func. |
Value
Significance level alpha_s for the final stage
Examples
# Without interim analysis
dtl_get_alpha_s_sim(nsim = 100000, n = 80, t = 1, rho = 0.4, q = 0.3,
alpha = 0.025, delta = 0.05)
Shiny app of drop-the-losers (DTL) design
Description
Interactive shiny app of drop-the-losers (DTL) design
Usage
dtl_shiny(appname = "shiny")
Arguments
appname |
Default is "shiny". Do not change it since there is only one shiny app in the package |
Value
The shiny app of DTL design which includes three panels:(1) family-wise type I error rate (FWER) given fixed rho; (2) correlation coefficient boundary for rho (rho_s); (3) adjusted significance level in real application (alpha_t). The first two panels show the graphs of change of the FWER and the rho_s as the change of some related parameters. The corresponding tables of the graphs are also shown. In the last panel, the table of the significance levels alpha_s based on all possible values of response rate q and hazard ratio of responders and non-responders gamma and the resulting minimum or called adjusted significance level are shown.
Examples
# run dtl_shiny()
Generate normal approximated test statistics for drop-the-losers (DTL) design
Description
Generate normal approximated test statistics for drop-the-losers (DTL) design
Usage
dtl_sim_stat(nsim, n, q, t, rho)
Arguments
nsim |
Number of replicates |
n |
Sample size per arm at DTL look |
q |
Response rate under the null |
t |
A vector of information fraction of final stage |
rho |
Fixed correlation coefficient |
Value
Data frame of the simulated test statistics
Examples
dtl_sim_stat(nsim = 1000, n = 80, q = 0.3, t = c(0.3, 1), rho = c(0.5, 0.3))
Simulated family-wise type I error rate (FWER) given a fixed correlation coefficient under drop-the-losers (DTL) design
Description
Get the simulated FWER alpha given fixed correlation coefficient
Usage
dtl_tier_sim(nsim, n, t, rho, q, alpha_s, sel_g_func = sel_g_func_default, ...)
Arguments
nsim |
Number of replicates |
n |
Sample size per arm at DTL look |
t |
A vector of information fraction of final stage |
rho |
Fixed correlation coefficient |
q |
Response rate under the null |
alpha_s |
Significance level for the final stage |
sel_g_func |
Arm-select function. The default function is sel_g_func_default(W_2, W_1, delta). Users can define their own arm-select function. The format of the function must be function_name(W_2, W_1, ...). The return values must be 1 (arm 1 is selected) or 2 (arm 2 is selected) or 0 (stop for futility). |
... |
Other arguments from sel_g_func. |
Value
Simulated FWER alpha
Examples
# Without interim analysis
dtl_tier_sim(nsim = 1000, n = 80, t = 1, rho = 0.4, q = 0.3,
alpha_s = 0.025, delta = 0.05)
# With interim analysis
dtl_tier_sim(nsim = 1000, n = 80, t = c(0.5, 1), rho = c(0.4, 0.2), q = 0.3,
alpha_s = 0.025, delta = 0.05)
Theoretical family-wise type I error rate (FWER) given a fixed correlation coefficient under drop-the-losers (DTL) design
Description
Get the theoretical FWER alpha given fixed correlation coefficient
Usage
dtl_tier_the(n, t, rho, q, alpha_s, delta)
Arguments
n |
Sample size per arm at DTL look |
t |
A vector of information fraction of final stage |
rho |
Fixed correlation coefficient |
q |
Response rate under the null |
alpha_s |
Significance level for the final stage |
delta |
Least difference to decide superiority of high dose |
Value
Theoretical FWER alpha
Examples
# Without interim analysis
dtl_tier_the(n = 80, t = 1, rho = 0.4, q = 0.3, alpha_s = 0.025, delta = 0.05)
# With interim analysis
dtl_tier_the(n = 80, t = c(0.5, 1), rho = c(0.4, 0.2), q = 0.3, alpha_s = 0.025, delta = 0.05)
Default arm-select function
Description
Default arm-select function for selecting arm to the next stage.
Usage
sel_g_func_default(W_2, W_1, delta)
Arguments
W_2 |
Response rate for arm 2 (high dose) |
W_1 |
Response rate for arm 1 (low dose) |
delta |
Least difference to decide superiority of arm 2 (high dose) |
Value
The function is g(W_2, W_1; \Delta) =
2I(W_2 - W_1 - \Delta > 0) + I(W_2 - W_1 - \Delta \leq 0)
.
It returns the following values:
1: arm 1 (low dose) is selected;
2: arm 2 (high dose) is selected.
Examples
sel_g_func_default(W_2 = 0.5, W_1 = 0.3, delta = 0.05)