# Optimal phase II/III drug development planning for time-to-event endpoints when discounting phase II results

Source:`R/optimal_bias.R`

`optimal_bias.Rd`

The function `optimal_bias`

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 time-to-event 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 (planning is then also possible via user friendly R Shiny App: bias) 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(
w,
hr1,
hr2,
id1,
id2,
d2min,
d2max,
stepd2,
hrgomin,
hrgomax,
stephrgo,
adj = "both",
lambdamin = NULL,
lambdamax = NULL,
steplambda = NULL,
alphaCImin = NULL,
alphaCImax = NULL,
stepalphaCI = NULL,
alpha,
beta,
xi2,
xi3,
c2,
c3,
c02,
c03,
K = Inf,
N = Inf,
S = -Inf,
steps1 = 1,
stepm1 = 0.95,
stepl1 = 0.85,
b1,
b2,
b3,
fixed = FALSE,
num_cl = 1
)
```

## Arguments

- w
weight for mixture prior distribution

- hr1
first assumed true treatment effect on HR scale for prior distribution, see the vignette on priors as well as the Shiny app for more details concerning the definition of a prior distribution.

- hr2
second assumed true treatment effect on HR scale for prior distribution

- id1
amount of information for

`hr1`

in terms of number of events- id2
amount of information for

`hr2`

in terms of number of events- d2min
minimal number of events for phase II

- d2max
maximal number of events for phase II

- stepd2
stepsize for the optimization over

`d2`

- hrgomin
minimal threshold value for the go/no-go decision rule

- hrgomax
maximal threshold value for the go/no-go decision rule

- stephrgo
stepsize for the optimization over HRgo

- adj
choose type of adjustment:

`"multiplicative"`

,`"additive"`

,`"both"`

or`"all"`

. When using "both",`res[1,]`

contains the results using the multiplicative method and`res[2,]`

contains the results using the additive method. When using "all", there are also`res[3,]`

and`res[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
1-beta power for calculation of the number of events for phase III by Schoenfeld (1981) formula

- xi2
event rate for phase II

- xi3
event rate 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" in HR scale, default: 1

- stepm1
lower boundary for effect size category "medium" in HR scale = upper boundary for effect size category "small" in HR scale, default: 0.95

- stepl1
lower boundary for effect size category "large" in HR scale = upper boundary for effect size category "medium" in HR scale, default: 0.85

- 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 random, if TRUE hr1 is 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

- HRgo
optimal threshold value for the decision rule to go to phase III

- d2
optimal total number of events for phase II

- d3
total expected number of events for phase III; rounded to next natural number

- d
total expected number of events in the program; d = d2 + d3

- 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 date of the optimization procedure.

## References

IQWiG (2016). Allgemeine Methoden. Version 5.0, 10.07.2016, Technical Report. Available at https://www.iqwig.de/ueber-uns/methoden/methodenpapier/, assessed last 15.05.19.

Preussler, S., Kirchner, M., Goette, H., Kieser, M. (2020). Optimal designs for phase II/III drug development programs including methods for discounting of phase II results. Submitted to peer-review journal.

Schoenfeld, D. (1981). The asymptotic properties of nonparametric tests for comparing survival distributions. Biometrika, 68(1), 316-319.

## Examples

```
# Activate progress bar (optional)
if (FALSE) {
progressr::handlers(global = TRUE)
}
# Optimize
# \donttest{
optimal_bias(w = 0.3, # define parameters for prior
hr1 = 0.69, hr2 = 0.88, id1 = 210, id2 = 420, # (https://web.imbi.uni-heidelberg.de/prior/)
d2min = 20, d2max = 100, stepd2 = 5, # define optimization set for d2
hrgomin = 0.7, hrgomax = 0.9, stephrgo = 0.05, # define optimization set for HRgo
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, xi2 = 0.7, xi3 = 0.7, # drug development planning parameters
c2 = 0.75, c3 = 1, c02 = 100, c03 = 150, # fixed/variable costs for phase II/III
K = Inf, N = Inf, S = -Inf, # set constraints
steps1 = 1, # define lower boundary for "small"
stepm1 = 0.95, # "medium"
stepl1 = 0.85, # and "large" effect size categories
b1 = 1000, b2 = 2000, b3 = 3000, # define expected benefits
fixed = FALSE, # true treatment effects are fixed/random
num_cl = 1) # number of coresfor parallelized computing
#> Optimization result with multiplicative adjustment of the treatment effect:
#> Utility: 98.28
#> Bias adjustment parameter: 0.75
#> Sample size:
#> phase II: 122, phase III: 218, total: 340
#> Expected number of events:
#> phase II: 85, phase III: 153, total: 238
#> Assumed event rate:
#> phase II: 0.7, phase III: 0.7
#> Probability to go to phase III: 0.36
#> Total cost:
#> phase II: 192, phase III: 273, cost constraint: Inf
#> Fixed cost:
#> phase II: 100, phase III: 150
#> Variable cost per patient:
#> phase II: 0.75, phase III: 1
#> Effect size categories (expected gains):
#> small: 1 (1000), medium: 0.95 (2000), large: 0.85 (3000)
#> Success probability: 0.24
#> Success probability by effect size:
#> small: 0.04, medium: 0.08, large: 0.12
#> Significance level: 0.025
#> Targeted power: 0.9
#> Decision rule threshold: 0.75 [HRgo]
#> Parameters of the prior distribution:
#> hr1: 0.69, hr2: 0.88, id1: 210, id2: 420, w: 0.3
#>
#> Optimization result with additive adjustment of the treatment effect:
#> Utility: 75.95
#> Bias adjustment parameter: 0.475
#> Sample size:
#> phase II: 130, phase III: 230, total: 360
#> Expected number of events:
#> phase II: 90, phase III: 161, total: 251
#> Assumed event rate:
#> phase II: 0.7, phase III: 0.7
#> Probability to go to phase III: 0.45
#> Total cost:
#> phase II: 198, phase III: 298, cost constraint: Inf
#> Fixed cost:
#> phase II: 100, phase III: 150
#> Variable cost per patient:
#> phase II: 0.75, phase III: 1
#> Effect size categories (expected gains):
#> small: 1 (1000), medium: 0.95 (2000), large: 0.85 (3000)
#> Success probability: 0.26
#> Success probability by effect size:
#> small: 0.05, medium: 0.09, large: 0.11
#> Significance level: 0.025
#> Targeted power: 0.9
#> Decision rule threshold: 0.8 [HRgo]
#> Parameters of the prior distribution:
#> hr1: 0.69, hr2: 0.88, id1: 210, id2: 420, w: 0.3
#>
# }
```