Package 'GSED'

Title: 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>.
Authors: Marie-Karelle Riviere
Maintainer: Marie-Karelle Riviere <[email protected]>
License: GPL-3
Version: 2.6
Built: 2025-02-21 03:14:00 UTC
Source: https://github.com/cran/GSED

Help Index


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 <[email protected]>

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 N_subsets.

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 K_stages-1.

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 K_stages+1.

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 K_stages+1.

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 [email protected]

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. By default filled with NA if the function is run for selection step.

N_subsets

Integer representing the number of possible subgroups.

Y

Efficient score test statistics. For stage_cur>0 (evaluation at stage 1 or k (k>1),), value representing the efficient score test statistic for all (pooled) selected subgroup. For stage_cur=0 (selection at stage 1), vector representing the efficient score test statistic for each subgroup.

I

Observed Fisher information. For stage_cur>0 (evaluation at stage 1 or k (k>1),), value representing the observed Fisher information for all (pooled) selected subgroup. For stage_cur=0 (selection at stage 1), vector representing the observed Fisher information for each subgroup.

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 N_subsets).

Author(s)

Marie-Karelle Riviere-Jourdan [email protected]

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 N_subsets.

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 K_stages-1.

l

Vector containing the lower boundaries for stagewise decisions. Must be of length K_stages.

u

Vector containing the upper boundaries for stagewise decisions. Must be of length K_stages.

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 [email protected]

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 N_subsets.

l

Vector containing the lower boundaries for stagewise decisions. Must be of length K_stages.

u

Vector containing the upper boundaries for stagewise decisions. Must be of length K_stages.

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 K_stages-1.

type_outcome

A string containing the type of outcome, either "survival", "binary", or "continuous".

param_outcome

Must be supplied only if type_outcome is equal to "binary" or "continuous". The parameters supplied for the binary outcome must be a list of one element containing a matrix of size 2xN_subsets. The parameters supplied for the continuous outcome must be a list of two elements containing two matrices of size 2xN_subsets. The matrices should contain probabilities of response, or the means and variances respectively, for in row control or treatment, and in column the subgroup number.

n_max

Integer representing the maximum number of patients to enroll in a trial. Must be supplied only if type_outcome is equal to "binary" or "continuous", will be ignored otherwise.

incl_rate

Number representing the inclusion rate. Must be supplied only if type_outcome is equal to "survival", will be ignored otherwise.

mean_cur_c

Number representing the median survival for the control group. Must be supplied only if type_outcome is equal to "survival", will be ignored otherwise.

HR

Vector containing the expected hazard ratios for each subgroup. Must be of length N_subsets. Must be supplied only if type_outcome is equal to "survival", will be ignored otherwise.

nb_required

Integer indicating the maximum number of events required. Must be supplied only if type_outcome is equal to "survival", will be ignored otherwise.

nmax_wait

For type_outcome equal to "survival" only, will be ignored otherwise. If specified, maximum number of patients to include in the trial, the inclusions will be stopped when this number is achieved and trial will pursue until the number of events required is achieved. Must be superior to nb_required. Default value is +Inf.

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 list_keep across all simulated trials.

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 type_outcome is equal to "survival", the trial mean duration across all simulated trials is also returned.

Author(s)

Marie-Karelle Riviere-Jourdan [email protected]

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 N_subsets.

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 (=keep).

Author(s)

Marie-Karelle Riviere-Jourdan [email protected]

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 N_subsets.

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 [email protected]

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