| Type: | Package | 
| Title: | Group Sequential Enrichment Design | 
| Version: | 2.6 | 
| Date: | 2023-08-31 | 
| Author: | Marie-Karelle Riviere | 
| Maintainer: | Marie-Karelle Riviere <eldamjh@gmail.com> | 
| Copyright: | All files are copyright Sanofi Aventis | 
| Description: | Provides function to apply "Group sequential enrichment design incorporating subgroup selection" (GSED) method proposed by Magnusson and Turnbull (2013) <doi:10.1002/sim.5738>. | 
| License: | GPL-3 | 
| Depends: | R (≥ 3.1.2), memoise (≥ 1.0.0), rootSolve (≥ 1.6.6), survival (≥ 2.37-7), R.utils (≥ 2.3.0) | 
| Packaged: | 2023-08-31 09:30:43 UTC; Marie-Karelle | 
| NeedsCompilation: | no | 
| Repository: | CRAN | 
| Date/Publication: | 2023-08-31 10:10:12 UTC | 
Group Sequential Enrichment Design
Description
Provides function to apply "Group sequential enrichment design incorporating subgroup selection" (GSED) method proposed by Magnusson and Turnbull (2013) <doi:10.1002/sim.5738>.
Details
| Package: | GSED | 
| Type: | Package | 
| Version: | 2.6 | 
| Date: | 2023-08-31 | 
| License: | GPL-3 | 
Author(s)
Marie-Karelle Riviere-Jourdan <eldamjh@gmail.com>
References
Baldur P. Magnusson and Bruce W. Turnbull. Group sequential enrichment design incorporating subgroup selection. Statistics in Medicine, 2013. <doi:10.1002/sim.5738>
Lower and upper boundaries for GSED
Description
boundaries_sim is used to estimate lower and upper boundaries for GSED based on simulations of trials.
Usage
boundaries_sim(K_stages, N_subsets, f, ratio_Delta_star_d1, ordering, 
increasing_theta=FALSE, seed=42, n_trials, alpha_spending, 
one_minus_alpha_spending, updateProgress=NULL)
Arguments
K_stages | 
 Integer indicating the number of stages in the design.  | 
N_subsets | 
 Integer representing the number of possible subgroups.  | 
f | 
 Vector containing the prevalence rates of each subgroup. Must be of length   | 
ratio_Delta_star_d1 | 
 Vector containing the ratio between the (observed Fisher) information increments at each stage >1 with the (observed Fisher) information at stage 1. Must be of length   | 
ordering | 
 Boolean indicating if the subgroups (theta) are ordered.  | 
increasing_theta | 
 Boolean indicating if greater values of theta parameters represent better treatment effects. The default value is set at FALSE.  | 
seed | 
 Interger representing the seed. The default value is set at 42.  | 
n_trials | 
 Integer indicating the number of trials to simulate.  | 
alpha_spending | 
 Vector containing the values of the alpha-spending function at each time of the analysis (including 0 at time 0 and alpha at time 1). Must be of length   | 
one_minus_alpha_spending | 
 Vector containing the values of the 1-alpha-spending function at each time of the analysis (including 0 at time 0 and 1-alpha at time 1). Must be of length   | 
updateProgress | 
 (for Rshiny application)  | 
Value
A list is returned, consisting of two vectors containing the lower and upper boundaries:
l | 
 Vector of lower boundaries at each stage.  | 
u | 
 Vector of upper boundaries at each stage.  | 
Author(s)
Marie-Karelle Riviere-Jourdan eldamjh@gmail.com
References
Baldur P. Magnusson and Bruce W. Turnbull. Group sequential enrichment design incorporating subgroup selection. Statistics in Medicine, 2013. <doi:10.1002/sim.5738>
Examples
#For testing purpose only, larger number of simulations required (see in comments below)
boundaries_sim(K_stages=2, N_subsets=3, f=c(0.6,0.2,0.2), ratio_Delta_star_d1=c(1), 
ordering=FALSE, seed=42, n_trials=3, alpha_spending=c(0,0.0125,0.025), 
one_minus_alpha_spending=c(0,0.4875,0.975))
#boundaries_sim(K_stages=2, N_subsets=3, f=c(0.6,0.2,0.2), ratio_Delta_star_d1=c(1), 
#ordering=FALSE, seed=42, n_trials=10000000, alpha_spending=c(0,0.0125,0.025), 
#one_minus_alpha_spending=c(0,0.4875,0.975))
Application of GSED on data
Description
magnusson_turnbull is used apply GSED design, selection or evaluation at each stage, on data.
Usage
magnusson_turnbull(stage_cur, keep=NA, N_subsets, Y, I, l, u, ordering, 
increasing_theta=FALSE)
Arguments
stage_cur | 
 Integer representing the current stage. 0 represents selection at stage 1, 1 represents evaluation at stage 1, while k (>1) represents evaluation at stage k.  | 
keep | 
 Vector of indices of selected subgroups if selection at stage 1 is already performed. Values must be between 1 and   | 
N_subsets | 
 Integer representing the number of possible subgroups.  | 
Y | 
 Efficient score test statistics. For   | 
I | 
 Observed Fisher information. For   | 
l | 
 Vector containing the lower boundaries for stagewise decisions.  | 
u | 
 Vector containing the upper boundaries for stagewise decisions.  | 
ordering | 
 Boolean indicating if the subgroups (theta) are ordered.  | 
increasing_theta | 
 Boolean indicating if greater values of theta parameters represent better treatment effects. The default value is set at FALSE.  | 
Value
An list is returned, consisting of:
Rejection | 
 Interger with value 1 if the decision is to reject the null hypothesis, 0 otherwise.  | 
Acceptation | 
 Interger with value 1 if the decision is to accept the null hypothesis, 0 otherwise.  | 
Keep | 
 Vector of indices of selected subgroups (between 1 and   | 
Author(s)
Marie-Karelle Riviere-Jourdan eldamjh@gmail.com
References
Baldur P. Magnusson and Bruce W. Turnbull. Group sequential enrichment design incorporating subgroup selection. Statistics in Medicine, 2013. <doi:10.1002/sim.5738>
Examples
magnusson_turnbull(stage_cur=0, keep=NA, N_subsets=3, Y=c(-10.71,12.84,19.06), 
I=c(480,144,176), l=c(0.7962,2.5204), u=c(2.7625,2.5204), ordering=FALSE)
magnusson_turnbull(stage_cur=2, keep=c(2,3), N_subsets=3, Y=135.57, 
I=1120, l=c(0.7962,2.5204), u=c(2.7625,2.5204), ordering=FALSE)
Maximum Fisher information
Description
max_FI is used to estimate maximum Fisher information based on two power criteria. 
- The first criterion consider the maxmimum Fisher information such that there is a pre-defined power to declare efficacy in the entire population for a given vector of parameters representing treatment effetcs in each subgroup.
- The second criterion consider the maxmimum Fisher information such that there is a pre-defined power to declare efficacy in at least one subgroup for a given vector of parameters representing treatment effetcs in each subgroup.
Usage
max_FI(K_stages, N_subsets, f, ratio_Delta_star_d1, l, u, type_outcome, param_theta, 
pow, ordering, increasing_theta=FALSE, seed=42, n_trials, rule, updateProgress=NULL)
Arguments
K_stages | 
 Integer indicating the number of stages in the design.  | 
N_subsets | 
 Integer representing the number of possible subgroups.  | 
f | 
 Vector containing the prevalence rates of each subgroup. Must be of length   | 
ratio_Delta_star_d1 | 
 Vector containing the ratio between the (observed Fisher) information increments at each stage >1 with the (observed Fisher) information at stage 1. Must be of length   | 
l | 
 Vector containing the lower boundaries for stagewise decisions. Must be of length   | 
u | 
 Vector containing the upper boundaries for stagewise decisions. Must be of length   | 
type_outcome | 
 A string containing the type of outcome, either "survival", "binary", or "continuous".  | 
param_theta | 
 Vector of parameters representing treatment effects in each subgroup. Must satisfy the properties detailed in Magnusson and Turnbull's article (reparametrization can be needed).  | 
pow | 
 Value representing the desired power.  | 
ordering | 
 Boolean indicating if the subgroups (theta) are ordered.  | 
increasing_theta | 
 Boolean indicating if greater values of theta parameters represent better treatment effects. The default value is set at FALSE.  | 
seed | 
 Interger representing the seed. The default value is set at 42.  | 
n_trials | 
 Integer indicating the number of trials to simulate.  | 
rule | 
 Integer with value either 1 or 2 for power criteria detailed in description section (1 for entire population, 2 for at least one subgroup).  | 
updateProgress | 
 (for Rshiny application)  | 
Value
A value representing the maximum Fisher information is returned.
Author(s)
Marie-Karelle Riviere-Jourdan eldamjh@gmail.com
References
Baldur P. Magnusson and Bruce W. Turnbull. Group sequential enrichment design incorporating subgroup selection. Statistics in Medicine, 2013. <doi:10.1002/sim.5738>
Examples
theta_assumption = list(matrix(c(0.4,0.6,0.4,0.6,0.4,0.6),nrow=2,ncol=3))
#For testing purpose only, larger number of simulations required (see in comments below)
max_FI(K_stages=2, N_subsets=3, f=c(0.6,0.2,0.2), ratio_Delta_star_d1=c(1), l=c(0.7962, 2.5204), 
u=c(2.7625, 2.5204), type_outcome="binary", param_theta=theta_assumption, pow=0.9, 
ordering=FALSE, increasing_theta=FALSE, seed=140691, n_trials=3, rule=1)
       
#max_FI(K_stages=2, N_subsets=3, f=c(0.6,0.2,0.2), ratio_Delta_star_d1=c(1), l=c(0.7962, 2.5204), 
#u=c(2.7625, 2.5204), type_outcome="binary", param_theta=theta_assumption, pow=0.9, 
#ordering=FALSE, increasing_theta=FALSE, seed=140691, n_trials=10000000, rule=1)
#max_FI(K_stages=2, N_subsets=3, f=c(0.6,0.2,0.2), ratio_Delta_star_d1=c(1), l=c(0.7962, 2.5204), 
#u=c(2.7625, 2.5204), type_outcome="binary", param_theta=theta_assumption, pow=0.9,
#ordering=FALSE, increasing_theta=FALSE, seed=140691, n_trials=10000000, rule=2)
Simulations of trials with GSED
Description
sim_magnusson_turnbull is used to simulate clincal trials with GSED for different type of outcome (survival, binary, continuous).
Usage
sim_magnusson_turnbull(K_stages, N_subsets, f, l, u, ratio_Delta_star_d1, type_outcome, 
param_outcome=NA, n_max=NA, incl_rate=NA, mean_cur_c=NA, HR=NA, nb_required=NA, 
nmax_wait=+Inf, ordering, increasing_theta=FALSE, nsim=1000, seed=42,
nsim_tot=NA, num_sc=1, updateProgress=NULL)
Arguments
K_stages | 
 Integer indicating the number of stages in the design.  | 
N_subsets | 
 Integer representing the number of possible subgroups.  | 
f | 
 Vector containing the prevalence rates of each subgroup. Must be of length   | 
l | 
 Vector containing the lower boundaries for stagewise decisions. Must be of length   | 
u | 
 Vector containing the upper boundaries for stagewise decisions. Must be of length   | 
ratio_Delta_star_d1 | 
 Vector containing the ratio between the (observed Fisher) information increments at each stage >1 with the (observed Fisher) information at stage 1. Must be of length   | 
type_outcome | 
 A string containing the type of outcome, either "survival", "binary", or "continuous".  | 
param_outcome | 
 Must be supplied only if   | 
n_max | 
 Integer representing the maximum number of patients to enroll in a trial. Must be supplied only if   | 
incl_rate | 
 Number representing the inclusion rate. Must be supplied only if   | 
mean_cur_c | 
 Number representing the median survival for the control group. Must be supplied only if   | 
HR | 
 Vector containing the expected hazard ratios for each subgroup. Must be of length   | 
nb_required | 
 Integer indicating the maximum number of events required. Must be supplied only if   | 
nmax_wait | 
 For   | 
ordering | 
 Boolean indicating if the subgroups (theta) are ordered.  | 
increasing_theta | 
 Boolean indicating if greater values of theta parameters represent better treatment effects. The default value is set at FALSE.  | 
nsim | 
 Integer indicating the number of trials to simulate. The default value is set at 1000.  | 
seed | 
 Interger representing the seed. The default value is set at 42.  | 
nsim_tot | 
 (for Rshiny application)  | 
num_sc | 
 (for Rshiny application)  | 
updateProgress | 
 (for Rshiny application)  | 
Value
A list is returned composed of:
prob_rejec | 
 Percentage of simulated trials (estimated probability) to reject any subgroup.  | 
prob_accep | 
 Percentage of simulated trials (estimated probability) to accept the null hypothesis, that is there is no treatment effect in any subgroup.  | 
list_keep | 
 A list of the different subgroups that were selected across all simulated trials.  | 
pct_keep | 
 Percentage of selection of each subgroup of   | 
rejec_stage | 
 Vector of percentage of simulated trials (estimated probability) to reject any subgroup at each stage.  | 
accep_stage | 
 Vector of percentage of simulated trials (estimated probability) to accept the null hypothesis (that is there is no treatment effect in any subgroup) at each stage.  | 
mean_pat | 
 Mean number of patients included across all simulated trials.  | 
mean_duration | 
 If   | 
Author(s)
Marie-Karelle Riviere-Jourdan eldamjh@gmail.com
References
Baldur P. Magnusson and Bruce W. Turnbull. Group sequential enrichment design incorporating subgroup selection. Statistics in Medicine, 2013. <doi:10.1002/sim.5738>
Examples
#For testing purpose only, larger number of simulations required (see in comments below)
sim_magnusson_turnbull(K_stages=2, N_subsets=3, f=c(0.6,0.2,0.2), l=c(0.7962, 2.5204), 
u=c(2.7625, 2.5204), ratio_Delta_star_d1=c(1), type_outcome="binary", param_outcome=
list(matrix(c(0.4,0.4,0.4,0.6,0.6,0.6),nrow=2,ncol=3,byrow=TRUE)), n_max=1496, 
ordering=FALSE, nsim=2, seed=42)
#sim_magnusson_turnbull(K_stages=2, N_subsets=3, f=c(0.6,0.2,0.2), l=c(0.7962, 2.5204), 
#u=c(2.7625, 2.5204), ratio_Delta_star_d1=c(1), type_outcome="binary", param_outcome=
#list(matrix(c(0.4,0.4,0.4,0.6,0.6,0.6),nrow=2,ncol=3,byrow=TRUE)), n_max=1496, 
#ordering=FALSE, nsim=1000, seed=42)
#sim_magnusson_turnbull(K_stages=2, N_subsets=3, f=c(0.6,0.2,0.2), l=c(0.7962, 2.5204), 
#u=c(2.7625, 2.5204), ratio_Delta_star_d1=c(1), type_outcome="binary", param_outcome=
#list(matrix(c(0.5,0.5,0.5,0.5,0.5,0.5),nrow=2,ncol=3,byrow=TRUE)), n_max=1496, 
#ordering=FALSE, nsim=1000, seed=42)
#sim_magnusson_turnbull(K_stages=2, N_subsets=4, f=c(0.25,0.25,0.25,0.25), l=c(0.98,2.35), 
#u=c(2.59,2.35), ratio_Delta_star_d1=c(1), type_outcome="survival", incl_rate=1/28, 
#mean_cur_c=7/log(2), HR=c(0.8,0.8,0.8,0.8), nb_required=1030, ordering=TRUE, 
#increasing_theta=FALSE, nsim=1000, seed=42)
Stage 1-evaluation step of GSED
Description
stage_1_evaluation is used to evaluate the efficacy of the subgroup selected at the end of the first stage of GSED.
Usage
stage_1_evaluation(keep, Z_1j, f, u)
Arguments
keep | 
 Vector containing the indices of the subgroups selected at stage 1.  | 
Z_1j | 
 Vector containing the Z-statistics (standard normal under H0) for each subgroup. Must be of length   | 
f | 
 Vector containing the prevalence rates of each subgroup.  | 
u | 
 Vector containing the upper boundaries for stagewise decisions.  | 
Value
A list is returned, consisting of:
stage | 
 Integer containing the current step. Value is 1 by default, or -1 if the trial stops earlier for efficacy after this evaluation step.  | 
S | 
 Vector containing the indices of the subgroups selected at stage 1 (=  | 
Author(s)
Marie-Karelle Riviere-Jourdan eldamjh@gmail.com
References
Baldur P. Magnusson and Bruce W. Turnbull. Group sequential enrichment design incorporating subgroup selection. Statistics in Medicine, 2013. <doi:10.1002/sim.5738>
Examples
stage_1_evaluation(keep=c(2,3), Z_1j=c(-0.49,1.07,1.44), f=c(0.6,0.2,0.2), u=c(2.7625,2.5204))
Stage 1-selection step of GSED
Description
stage_1_selection is used to determine the subgroup selected at the end of the first stage of GSED.
Usage
stage_1_selection(N_subsets, Z_1j, l, ordering, increasing_theta=FALSE)
Arguments
N_subsets | 
 Integer representing the number of possible subgroups.  | 
Z_1j | 
 Vector containing the Z-statistics (standard normal under H0) for each subgroup. Must be of length   | 
l | 
 Vector containing the lower boundaries for stagewise decisions.  | 
ordering | 
 Boolean indicating if the subgroups (theta) are ordered.  | 
increasing_theta | 
 Boolean indicating if greater values of theta parameters represent better treatment effects. The default value is set at FALSE.  | 
Value
A vector containing the indices of the subgroups selected is returned.
Author(s)
Marie-Karelle Riviere-Jourdan eldamjh@gmail.com
References
Baldur P. Magnusson and Bruce W. Turnbull. Group sequential enrichment design incorporating subgroup selection. Statistics in Medicine, 2013. <doi:10.1002/sim.5738>
Examples
stage_1_selection(N_subsets=3, Z_1j=c(-0.49,1.07,1.44), l=c(0.7962,2.5204), ordering=FALSE)
For internal use
Description
For internal use