Skip to contents

Use the bayesian parametric model to find go/nogo cutting point for TTE endpoint

Usage

PFS_Find_Cut(basic_settings, pfs_settings, go_nogo_settings, start_evt_num = 1)

Examples

basic_settings <- list(
    max_subj_num = 40,
    # accrual_rate = 40 / 5,
    accrual_time = 5,
    n1 = 20,    # number of subjects in stage1
    wait_after_n1 = 0,    # time to wait after `n1` subjects being enrolled
    # cut_date = 9 + 2 + 5,    # cutoff date = actrual accrual_time +  wait time + followup time
    cut_evt_num  = NULL, # event number target to determine cutoff date.
                         # If `cut_date` is NULL, `cut_evt_num` will be used.
    rate_diff_at = 6,
    followup_time = 6
)
(basic_settings <- gonogo:::Get_Settings(basic_settings, type = 1))
#> $max_subj_num
#> [1] 40
#> 
#> $accrual_time
#> [1] 5
#> 
#> $n1
#> [1] 20
#> 
#> $wait_after_n1
#> [1] 0
#> 
#> $cut_evt_num
#> NULL
#> 
#> $rate_diff_at
#> [1] 6
#> 
#> $followup_time
#> [1] 6
#> 
#> $accrual_rate
#> [1] 8
#> 
#> $cut_date
#> [1] 11
#> 

pfs_settings <- list(
    m_ref = 7,    # median reference PFS time
    m_trt = 9.5,    # pfs_m_ctrl,
    trt_dropout = 0.1,    # annual pfs dropout rate
    piecewise_trt = FALSE
)

pfs_prior_shape <- 0.001
pfs_prior_rate <- 0.001

(pfs_settings <- gonogo:::Get_Settings(pfs_settings, type = 2,
                                       prior_shape = pfs_prior_shape,
                                       prior_rate = pfs_prior_rate))
#> $m_ref
#> [1] 7
#> 
#> $m_trt
#> [1] 9.5
#> 
#> $trt_dropout
#> [1] 0.1
#> 
#> $piecewise_trt
#> [1] FALSE
#> 
#> $hazard
#> [1] 0.07296286
#> 
#> $ref_hazard
#> [1] 0.09902103
#> 
#> $dropout_lambda
#> [1] 0.008780043
#> 
#> $prior_shape
#> [1] 0.001
#> 
#> $prior_rate
#> [1] 0.001
#> 

go_nogo_settings <- list(
    lam_eff_cut = pfs_settings$hazard,
    lam_fut_cut = pfs_settings$ref_hazard,
    go_prob_target = 0.67,
    nogo_prob_target = 0.1,
    use_evt_cut = TRUE,
    go_evt_target = 13,
    nogo_evt_target = 27,
    pfs_rate_diff_at = 6,
    pfs_rate_eff_cut = 2 ^ (-6 / pfs_settings$m_trt),
    pfs_rate_fut_cut = 2 ^ (-6 / pfs_settings$m_ref),
    pfs_rate_go_prob_target = 0.67,
    pfs_rate_nogo_prob_target = 0.1,
    pfs_rate_use_evt_cut = TRUE,
    pfs_rate_go_evt_target = 13,
    pfs_rate_nogo_evt_target = 27
)

pfs_rules_list <- PFS_Find_Cut(basic_settings, pfs_settings, go_nogo_settings, start_evt_num = 5)

pfs_rules_list$rules_tb
#> # A tibble: 36 × 5
#>    evt_num `sum_obs_time_Declare Go` sum_obs_time_Declare N…¹ `pprob_Declare Go`
#>      <dbl>                     <dbl>                    <dbl>              <dbl>
#>  1      40                       583                      487              0.672
#>  2      39                       569                      476              0.673
#>  3      38                       555                      465              0.674
#>  4      37                       540                      454              0.670
#>  5      36                       526                      443              0.671
#>  6      35                       512                      431              0.672
#>  7      34                       498                      420              0.673
#>  8      33                       484                      409              0.674
#>  9      32                       469                      398              0.671
#> 10      31                       455                      386              0.672
#> # ℹ 26 more rows
#> # ℹ abbreviated name: ¹​`sum_obs_time_Declare Nogo`
#> # ℹ 1 more variable: `pprob_Declare Nogo` <dbl>

# cowplot::plot_grid(plotlist = pfs_rules_list$gplot_list)