Optimal phase II/III drug development planning when discounting phase II results with normally distributed endpoint
Source:R/optimal_bias_normal.R
      optimal_bias_normal.RdThe function optimal_bias_normal of the drugdevelopR package enables planning of phase II/III drug development programs with optimal sample size allocation and go/no-go decision rules including methods for discounting of phase II results for normally distributed endpoints (Preussler et. al, 2020).
The discounting may be necessary as programs that proceed to phase III can be overoptimistic about the treatment effect (i.e. they are biased).
The assumed true treatment effects can be assumed fixed or modelled by a prior distribution.
The R Shiny application prior visualizes the prior distributions used in this package.
Fast computing is enabled by parallel programming.
Usage
optimal_bias_normal(
  w,
  Delta1,
  Delta2,
  in1,
  in2,
  a,
  b,
  n2min,
  n2max,
  stepn2,
  kappamin,
  kappamax,
  stepkappa,
  adj = "both",
  lambdamin = NULL,
  lambdamax = NULL,
  steplambda = NULL,
  alphaCImin = NULL,
  alphaCImax = NULL,
  stepalphaCI = NULL,
  alpha,
  beta,
  c2,
  c3,
  c02,
  c03,
  K = Inf,
  N = Inf,
  S = -Inf,
  steps1 = 0,
  stepm1 = 0.5,
  stepl1 = 0.8,
  b1,
  b2,
  b3,
  fixed = FALSE,
  num_cl = 1
)Arguments
- w
 weight for mixture prior distribution
- Delta1
 assumed true prior treatment effect measured as the standardized difference in means, see here for details
- Delta2
 assumed true prior treatment effect measured as the standardized difference in means, see here for details
- in1
 amount of information for
Delta1in terms of sample size, see here for details- in2
 amount of information for
Delta2in terms of sample size, see here for details- a
 lower boundary for the truncation of the prior distribution
- b
 upper boundary for the truncation of the prior distribution
- n2min
 minimal total sample size for phase II; must be an even number
- n2max
 maximal total sample size for phase II, must be an even number
- stepn2
 step size for the optimization over n2; must be an even number
- kappamin
 minimal threshold value kappa for the go/no-go decision rule
- kappamax
 maximal threshold value kappa for the go/no-go decision rule
- stepkappa
 step size for the optimization over the threshold value kappa
- adj
 choose type of adjustment:
"multiplicative","additive","both"or"all". When using "both",res[1,]contains the results using the multiplicative method andres[2,]contains the results using the additive method. When using "all", there are alsores[3,]andres[4,], containing the results of a multiplicative and an additive method which do not only adjust the treatment effect but also the threshold value for the decision rule.- lambdamin
 minimal multiplicative adjustment parameter lambda (i.e. use estimate with a retention factor)
- lambdamax
 maximal multiplicative adjustment parameter lambda (i.e. use estimate with a retention factor)
- steplambda
 stepsize for the adjustment parameter lambda
- alphaCImin
 minimal additive adjustment parameter alphaCI (i.e. adjust the lower bound of the one-sided confidence interval)
- alphaCImax
 maximal additive adjustment parameter alphaCI (i.e. adjust the lower bound of the one-sided confidence interval)
- stepalphaCI
 stepsize for alphaCI
- alpha
 one-sided significance level
- beta
 type II error rate; i.e.
1 - betais the power for calculation of the sample size for phase III- c2
 variable per-patient cost for phase II in 10^5 $
- c3
 variable per-patient cost for phase III in 10^5 $
- c02
 fixed cost for phase II in 10^5 $
- c03
 fixed cost for phase III in 10^5 $
- K
 constraint on the costs of the program, default: Inf, e.g. no constraint
- N
 constraint on the total expected sample size of the program, default: Inf, e.g. no constraint
- S
 constraint on the expected probability of a successful program, default: -Inf, e.g. no constraint
- steps1
 lower boundary for effect size category "small", default: 0
- stepm1
 lower boundary for effect size category "medium" = upper boundary for effect size category "small" default: 0.5
- stepl1
 lower boundary for effect size category "large" = upper boundary for effect size category "medium", default: 0.8
- b1
 expected gain for effect size category "small" in 10^5 $
- b2
 expected gain for effect size category "medium" in 10^5 $
- b3
 expected gain for effect size category "large" in 10^5 $
- fixed
 choose if true treatment effects are fixed or following a prior distribution, if TRUE
Delta1is used as fixed effect- num_cl
 number of clusters used for parallel computing, default: 1
Value
The output of the function is a data.frame object containing the optimization results:
- Adj
 optimal adjustment parameter (lambda or alphaCI according to Method)
- u
 maximal expected utility under the optimization constraints, i.e. the expected utility of the optimal sample size and threshold value
- Kappa
 optimal threshold value for the decision rule to go to phase III
- n2
 total sample size for phase II; rounded to the next even natural number
- n3
 total sample size for phase III; rounded to the next even natural number
- n
 total sample size in the program; n = n2 + n3
- K
 maximal costs of the program (i.e. the cost constraint, if it is set or the sum K2+K3 if no cost constraint is set)
- pgo
 probability to go to phase III
- sProg
 probability of a successful program
- sProg1
 probability of a successful program with "small" treatment effect in phase III
- sProg2
 probability of a successful program with "medium" treatment effect in phase III
- sProg3
 probability of a successful program with "large" treatment effect in phase III
- K2
 expected costs for phase II
- K3
 expected costs for phase III
and further input parameters. Taking cat(comment()) of the
data frame lists the used optimization sequences, start and
finish time of the optimization procedure. The attribute
attr(,"trace") returns the utility values of all parameter
combinations visited during optimization.
Examples
# Activate progress bar (optional)
if (FALSE) progressr::handlers(global = TRUE) # \dontrun{}
# Optimize
# \donttest{
optimal_bias_normal(w=0.3,             # define parameters for prior
  Delta1 = 0.375, Delta2 = 0.625, in1=300, in2=600,    # (https://web.imbi.uni-heidelberg.de/prior/)
  a = 0.25, b = 0.75,
  n2min = 20, n2max = 100, stepn2 = 10,                # define optimization set for n2
  kappamin = 0.02, kappamax = 0.2, stepkappa = 0.02,   # define optimization set for kappa
  adj = "both",                                        # choose type of adjustment
  lambdamin = 0.2, lambdamax = 1, steplambda = 0.05,   # define optimization set for lambda
  alphaCImin = 0.025, alphaCImax = 0.5,
  stepalphaCI = 0.025,                                 # define optimization set for alphaCI
  alpha = 0.025, beta = 0.1,                           # drug development planning parameters
  c2 = 0.675, c3 = 0.72, c02 = 15, c03 = 20,           # fixed and variable costs for phase II/III
  K = Inf, N = Inf, S = -Inf,                          # set constraints
  steps1 = 0,                                          # define lower boundary for "small"
  stepm1 = 0.5,                                        # "medium"
  stepl1 = 0.8,                                        # and "large" effect size categories
  b1 = 3000, b2 = 8000, b3 = 10000,                    # define expected benefits
  fixed = TRUE,                                        # true treatment effects are fixed/random
  num_cl = 1)                                          # number of coresfor parallelized computing 
#> Optimization result with multiplicative adjustment of the treatment effect:
#>  Utility: 1854.94
#>  Bias adjustment parameter: 0.8
#>  Sample size:
#>    phase II: 100, phase III: 628, total: 728
#>  Probability to go to phase III: 0.9
#>  Total cost:
#>    phase II: 82, phase III: 470, cost constraint: Inf
#>  Fixed cost:
#>    phase II: 15, phase III: 20
#>  Variable cost per patient:
#>    phase II: 0.675, phase III: 0.72
#>  Effect size categories (expected gains):
#>   small: 0 (3000), medium: 0.5 (8000), large: 0.8 (10000)
#>  Success probability: 0.8
#>  Joint probability of success and observed effect of size ... in phase III:
#>    small: 0.8, medium: 0, large: 0
#>  Significance level: 0.025
#>  Targeted power: 0.9
#>  Decision rule threshold: 0.12 [Kappa] 
#>  Assumed true effect: 0.375 [Delta] 
#> 
#> Optimization result with additive adjustment of the treatment effect:
#>  Utility: 1768.13
#>  Bias adjustment parameter: 0.5
#>  Sample size:
#>    phase II: 100, phase III: 460, total: 560
#>  Probability to go to phase III: 0.92
#>  Total cost:
#>    phase II: 82, phase III: 350, cost constraint: Inf
#>  Fixed cost:
#>    phase II: 15, phase III: 20
#>  Variable cost per patient:
#>    phase II: 0.675, phase III: 0.72
#>  Effect size categories (expected gains):
#>   small: 0 (3000), medium: 0.5 (8000), large: 0.8 (10000)
#>  Success probability: 0.73
#>  Joint probability of success and observed effect of size ... in phase III:
#>    small: 0.73, medium: 0, large: 0
#>  Significance level: 0.025
#>  Targeted power: 0.9
#>  Decision rule threshold: 0.1 [Kappa] 
#>  Assumed true effect: 0.375 [Delta] 
#> 
  # }