Learn R Programming

drugdevelopR: Utility-based optimal phase II/III drug development planning.

The drugdevelopR package enables you to plan phase II/III drug development programs with optimal sample size allocation and go/no-go decision rules. The assumed true treatment effects can be fixed or modelled by a prior distribution. The corresponding R Shiny application has a graphic user interface and thus makes it accessible for users without prior knowledge of R. Fast computing is made possible by parallel programming. Theoretical foundations for this package were laid in the dissertation “Integrated Planning of Pilot and Subsequent Confirmatory Study in Clinical Research – Finding Optimal Designs in a Utility-Based Framework” by Stella Erdmann at the Institute of Medical Biometry at the University of Heidelberg.

On the package webpage, we supply full documentation of all functions as well as a tutorial for getting started with drugdevelopR.

Installation

Install the development version of the package directly from GitHub using the following code:

if(!require(devtools)) { install.packages("devtools"); require(devtools)} 
devtools::install_github("Sterniii3/drugdevelopR")

and access the drugdevelopR App via https://web.imbi.uni-heidelberg.de/drugdevelopR/.

Usage

Here is a basic example for applying drugdevelopR to a drug development program with a normally distributed outcome:

library(drugdevelopR)
#> Lade nötiges Paket: doParallel
#> Lade nötiges Paket: foreach
#> Lade nötiges Paket: iterators
#> Lade nötiges Paket: parallel
#> Lade nötiges Paket: progressr
# Optimize
optimal_normal(Delta1 = 0.625, Delta2 = 0.8, fixed = FALSE, # treatment effect
               n2min = 20, n2max = 400, # sample size region
               stepn2 = 4, # sample size step size
               kappamin = 0.02, kappamax = 0.2, # threshold region
               stepkappa = 0.02, # threshold step size
               c2 = 0.675, c3 = 0.72, # maximal total trial costs
               c02 = 15, c03 = 20, # maximal per-patient costs
               b1 = 3000, b2 = 8000, b3 = 10000, # gains for patients
               alpha = 0.025, # one-sided significance level
               beta = 0.1, # 1 - power
               w = 0.6, in1 = 300, in2 = 600, # weight and amount of information
               a = 0.25, b = 0.75) # truncation values
#> Optimization result:
#>  Utility: 3073.85
#>  Sample size:
#>    phase II: 84, phase III: 194, total: 278
#>  Probability to go to phase III: 0.99
#>  Total cost:
#>    phase II: 72, phase III: 160, 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.85
#>  Success probability by effect size:
#>    small: 0.69, medium: 0.15, large: 0.01
#>  Significance level: 0.025
#>  Targeted power: 0.9
#>  Decision rule threshold: 0.06 [Kappa] 
#>  Parameters of the prior distribution: 
#>    Delta1: 0.625, Delta2: 0.8, in1: 300, in2: 600,
#>    a: 0.25, b: 0.75, w: 0.6
#>  Treatment effect offset between phase II and III: 0 [gamma]

drugdevelopR functions

The drugdevelopR package provides the functions

to plan optimal phase II/III drug development programs with

  • time-to-event (treatment effect measured by hazard ratio, HR),
  • binary (treatment effect measured by risk ratio, RR), or
  • normally distributed (treatment effect measured by standardized difference in means, Delta)

endpoints, where the treatment effect is modelled on a prior distribution. Optimal phase II/III drug development planning with fixed treatment effects can be done with the help of the R Shiny application basic.

Extensions to the basic setting are:

Copy Link

Version

Install

install.packages('drugdevelopR')

Monthly Downloads

165

Version

1.0.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Lukas D. Sauer

Last Published

January 14th, 2025

Functions in drugdevelopR (1.0.2)

EPsProg23_normal

Expected probability of a successful program deciding between two or three phase III trials for a normally distributed outcome
EPsProg_bias_normal

Expected probability of a successful program for bias adjustment programs with normally distributed outcomes
Epgo23_normal

Expected probability to do third phase III trial
EPsProg_multiple_normal

Expected probability of a successful program for multiple endpoints and normally distributed outcomes
EPsProg_multitrial_binary

Expected probability of a successful program for multitrial programs with binary distributed outcomes
EPsProg23

Expected probability of a successful program deciding between two or three phase III trials in a time-to-event setting
EPsProg_multiple_tte

Expected probability of a successful program for multiple endpoints in a time-to-event setting
EPsProg_bias

Expected probability of a successful program for bias adjustment programs with time-to-event outcomes
EPsProg23_binary

Expected probability of a successful program deciding between two or three phase III trials for a binary distributed outcome
dbivanorm

Density of the bivariate normal distribution
Epgo_bias

Expected probability to go to phase III for bias adjustment programs with time-to-event outcomes
PsProg_binary

Probability of a successful program for multiarm programs with binary distributed outcomes
Ed3_bias

Expected sample size for phase III for bias adjustment programs and time-to-event outcomes
Ed3_tte

Expected sample size for phase III for time-to-event outcomes
EPsProg_multitrial_normal

Expected probability of a successful program for multitrial programs with normally distributed outcomes
drugdevelopR-package

drugdevelopR: Utility-Based Optimal Phase II/III Drug Development Planning
Ess_normal

Expected sample size for phase III for multiarm programs with normally distributed outcomes
En3_bias_binary

Expected sample size for phase III for bias adjustment programs and binary distributed outcomes
EPsProg_tte

Expected probability of a successful program for time-to-event outcomes
PsProg_normal

Probability of a successful program for multiarm programs with normally distributed outcomes
Epgo23

Expected probability to do third phase III trial
optimal_multiarm_binary

Optimal phase II/III drug development planning for multi-arm programs with binary endpoint
Ess_tte

Expected sample size for phase III for multiarm programs with time-to-event outcomes
Epgo23_binary

Expected probability to do third phase III trial
En3_bias_normal

Expected sample size for phase III for bias adjustment programs and normally distributed outcomes
optimal_multiarm_generic

Generic function for optimizing multi-arm programs
optimal_normal

Optimal phase II/III drug development planning with normally distributed endpoint
get_sample_multiple_normal

Generate sample for Monte Carlo integration in the multiple setting
optimal_normal_generic

Generic function for optimizing normally distributed endpoints
pgo_multiple_tte

Probability to go to phase III for multiple endpoints in the time-to-event setting
get_sample_multiple_tte

Generate sample for Monte Carlo integration in the multiple setting
Epgo_tte

Expected probability to go to phase III for time-to-event outcomes
pgo_normal

Probability to go to phase III for multiarm programs with normally distributed outcomes
optimal_tte_generic

Generic function for optimal planning of time-to-event endpoints
os_tte

Probability that endpoint OS significant
print.drugdevelopResult

Printing a drugdevelopResult Object
Ess_binary

Expected sample size for phase III for multiarm programs with binary distributed outcomes
ss_tte

Total sample size for phase III trial with l treatments and equal allocation ratio for time-to-event outcomes
drugdevelopR

Utility based optimal phase II/III drug development planning
Epgo_bias_binary

Expected probability to go to phase III for bias adjustment programs with binary distributed outcomes
print_drugdevelopResult_helper

Helper function for printing a drugdevelopResult Object
Epgo_bias_normal

Expected probability to go to phase III for bias adjustment programs with normally distributed outcomes
drugdevelopResult

Construct a drugdevelopResult object from a data frame
fmax

Density for the maximum of two normally distributed random variables
optimal_generic

Generic function for optimizing drug development programs
Ess_multiple_normal

Expected sample size for phase III for multiple endpoints with normally distributed outcomes
optimal_bias_generic

Generic function for optimizing drug development programs with bias adjustment
optimal_bias_normal

Optimal phase II/III drug development planning when discounting phase II results with normally distributed endpoint
fmin

Density for the minimum of two normally distributed random variables
Ess_multiple_tte

Expected sample size for phase III for multiple endpoints with normally distributed outcomes
optimal_multiarm

Optimal phase II/III drug development planning for multi-arm programs with time-to-event endpoint
optimal_bias

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

Utility function for multitrial programs deciding between two or three phase III trials in a time-to-event setting
optimal_multiarm_normal

Optimal phase II/III drug development planning for multi-arm programs with normally distributed endpoint
PsProg_tte

Probability of a successful program for multiarm programs with time-to-event outcomes
utility_multiple_normal

Utility function for multiple endpoints with normally distributed outcomes.
optimal_multitrial_generic

Generic function for optimizing multi-trial programs
d3_skipII_tte

Expected probability to go to phase III for time-to-event outcomes
optimal_bias_binary

Optimal phase II/III drug development planning when discounting phase II results with binary endpoint
optimal_binary

Optimal phase II/III drug development planning with binary endpoint
optimal_multitrial_normal

Optimal phase II/III drug development planning where several phase III trials are performed
utility_multiple_tte

Utility function for multiple endpoints in a time-to-event-setting
utility_bias_normal

Utility function for bias adjustment programs with normally distributed outcomes.
optimal_multiple_generic

Generic function for optimizing drug development programs with multiple endpoints
optimal_return_doc

Function for generating documentation of return values
optimal_binary_generic

Generic function for optimizing programs with binary endpoints
optimal_multiple_normal

Optimal phase II/III drug development planning for programs with multiple normally distributed endpoints
utility_multiarm

Utility function for multiarm programs with time-to-event outcomes
prior_tte

Prior distribution for time-to-event outcomes
pw

Probabilty that effect in endpoint one is larger than in endpoint two
optimal_multiple_tte

Optimal phase II/III drug development planning for programs with multiple time-to-event endpoints
optimal_multitrial

Optimal phase II/III drug development planning where several phase III trials are performed for time-to-event endpoints
optimal_multitrial_binary

Optimal phase II/III drug development planning where several phase III trials are performed
pgo_binary

Probability to go to phase III for multiarm programs with binary distributed outcomes
utility_multiarm_binary

Utility function for multiarm programs with binary distributed outcomes
optimal_tte

Optimal phase II/III drug development planning with time-to-event endpoint
utility_multitrial_normal

Utility function for multitrial programs with normally distributed outcomes
utility_multiarm_normal

Utility function for multiarm programs with normally distributed outcomes
utility_tte

Utility function for time-to-event outcomes.
pgo_tte

Probability to go to phase III for multiarm programs with time-to-event outcomes
utility_multitrial

Utility function for multitrial programs in a time-to-event setting
posp_normal

Probability of a successful program, when going to phase III for multiple endpoint with normally distributed outcomes
utility_multitrial_binary

Utility function for multitrial programs with binary distributed outcomes
ss_binary

Total sample size for phase III trial with l treatments and equal allocation ratio for binary outcomes
pgo_multiple_normal

Probability to go to phase III for multiple endpoints with normally distributed outcomes
utility23_binary

Utility function for multitrial programs deciding between two or three phase III trials for a binary distributed outcome
utility23_normal

Utility function for multitrial programs deciding between two or three phase III trials for a normally distributed outcome
ss_normal

Total sample size for phase III trial with l treatments and equal allocation ratio for normally distributed outcomes
utility_bias

Utility function for bias adjustment programs with time-to-event outcomes.
utility_bias_binary

Utility function for bias adjustment programs with binary distributed outcomes.
EPsProg_bias_binary

Expected probability of a successful program for bias adjustment programs with binary distributed outcomes
EPsProg_multitrial

Expected probability of a successful program for multitrial programs in a time-to-event setting