Title: | Escalation with Overdose Control |
---|---|
Description: | An implementation of a variety of escalation with overdose control designs introduced by Babb, Rogatko and Zacks (1998) <doi:10.1002/(SICI)1097-0258(19980530)17:10%3C1103::AID-SIM793%3E3.0.CO;2-9>. It calculates the next dose as a clinical trial proceeds and performs simulations to obtain operating characteristics. |
Authors: | Marcio A. Diniz <[email protected]> |
Maintainer: | Marcio A. Diniz <[email protected]> |
License: | GPL(>= 2) |
Version: | 0.3.0 |
Built: | 2024-11-03 03:34:39 UTC |
Source: | https://github.com/dnzmarcio/ewoc |
Calculate the Accuracy Index.
accuracy_index( mtd_estimate, dose_set, true_prob, theta, loss = c("squared", "absolute", "classification", "overdose"), alpha = NULL )
accuracy_index( mtd_estimate, dose_set, true_prob, theta, loss = c("squared", "absolute", "classification", "overdose"), alpha = NULL )
mtd_estimate |
a numerical vector of the MTD estimates. |
dose_set |
a numerical vector of allowable doses in the trial. |
true_prob |
a numerical vector of the true probabilities associated with 'dose_set'. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
loss |
a loss function between the true probabilities of toxicity 'true_prob' and the target DLT rate 'theta'. |
alpha |
a numerical value indicating the weight of overdose for the overdose loss function. |
Accuracy Index for given loss function of the MTD estimates.
Cheung, Y. K. (2011). Dose finding by the continual reassessment method. CRC Press.
Calculate the Average Toxicity Number.
average_toxicity(dose, dose_set, true_prob, theta)
average_toxicity(dose, dose_set, true_prob, theta)
dose |
a numerical matrix of assigned doses for each step of the trial (column) and for each trial (row). |
dose_set |
a numerical vector of allowable doses in the trial. |
true_prob |
a numerical vector of the true probabilities associated with 'dose_set'. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
Average Toxicity Number.
Cheung, Y. K. (2011). Dose finding by the continual reassessment method. CRC Press.
Plot the DLT curve based on the EWOC classical model
dlt_curve_d1classical(mtd, rho, theta, min_dose, max_dose, dose_set = NULL)
dlt_curve_d1classical(mtd, rho, theta, min_dose, max_dose, dose_set = NULL)
mtd |
a numerical value indicating the true value of the parameter mtd. |
rho |
a numerical value indicating the true value of the parameter rho. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
dose_set |
a numerical vector of doses that probability of DLT will be calculated. |
Plot the DLT curve based on the EWOC extended model
dlt_curve_d1extended(rho, theta, min_dose, max_dose, dose_set = NULL)
dlt_curve_d1extended(rho, theta, min_dose, max_dose, dose_set = NULL)
rho |
a numerical vector indicating the true value of the parameters rho_0 and rho_1. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
dose_set |
a numerical vector of doses that probability of DLT will be calculated. |
Plot the DLT curve based on the EWOC proportional hazards model
dlt_curve_d1ph( mtd, rho, theta, min_dose, max_dose, shape, tau, distribution = "exponential", dose_set = NULL )
dlt_curve_d1ph( mtd, rho, theta, min_dose, max_dose, shape, tau, distribution = "exponential", dose_set = NULL )
mtd |
a numerical value indicating the true value of the parameter mtd. |
rho |
a numerical value indicating the true value of the parameter rho. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
shape |
a numerical value indicating the true value of the parameter shape. It is only necessary if 'distribution' = "weibull". |
tau |
a numerical value defining the period of time for a possible toxicity be observed. |
distribution |
a character establishing the distribution for the time of events. It can be defined as 'exponential' or 'weibull'. |
dose_set |
a numerical vector of doses that probability of DLT will be calculated. |
Calculate the DLT rate for each trial, the average DLT rate, the percent
of trials which have , the percent
of trials which have
and the percent
of trials which have
.
dlt_rate( dlt_matrix, trial = FALSE, target_rate = NULL, margin = NULL, digits = 2 )
dlt_rate( dlt_matrix, trial = FALSE, target_rate = NULL, margin = NULL, digits = 2 )
dlt_matrix |
a matrix of the number of DLT for each step of the trial (column) and for each trial (row). |
trial |
a logical value indicating if the DLT rate for each trial should be returned. |
target_rate |
a numerical value of the target rate of DLT. |
margin |
a numerical value of the acceptable distance from the |
digits |
a numerical value indicating the number of digits. |
trial
a numerical vector of the DLT rate for each trial.
average
a numerical value of the average of DLT rate considering a batch of trials.
upper
the percent of trials which the
DLT rate > target_rate + margin
if margin != NULL
and
target_rate != NULL
.
lower
the percent of trials which the
DLT rate < target_rate - margin
if margin != NULL
and
target_rate != NULL
.
interval
the percent of trials which the
target_rate - margin < DLT rate < target_rate + margin
if margin != NULL
and
target_rate != NULL
.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_sim(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 2, alpha_strategy = "increasing", response_sim = response_sim, stop_rule_sim = stop_rule_sim, ncores = 2) dlt_rate(sim$dlt_sim) ## End(Not run) ## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_sim(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, stop_rule_sim = stop_rule_sim, ncores = 2) dlt_rate(sim$dlt_sim) ## End(Not run)
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_sim(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 2, alpha_strategy = "increasing", response_sim = response_sim, stop_rule_sim = stop_rule_sim, ncores = 2) dlt_rate(sim$dlt_sim) ## End(Not run) ## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_sim(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, stop_rule_sim = stop_rule_sim, ncores = 2) dlt_rate(sim$dlt_sim) ## End(Not run)
Finding the next dose for a phase I clinical trial based on the Escalation with Overdose Control (EWOC) design considering the classical parametrization for binary responses and single agent.
ewoc_d1classical( formula, theta, alpha, mtd_prior, rho_prior, min_dose, max_dose, type = c("continuous", "discrete"), first_dose = NULL, last_dose = NULL, dose_set = NULL, max_increment = NULL, no_skip_dose = TRUE, rounding = c("down", "nearest"), n_adapt = 5000, burn_in = 1000, n_mcmc = 1000, n_thin = 1, n_chains = 1 )
ewoc_d1classical( formula, theta, alpha, mtd_prior, rho_prior, min_dose, max_dose, type = c("continuous", "discrete"), first_dose = NULL, last_dose = NULL, dose_set = NULL, max_increment = NULL, no_skip_dose = TRUE, rounding = c("down", "nearest"), n_adapt = 5000, burn_in = 1000, n_mcmc = 1000, n_thin = 1, n_chains = 1 )
formula |
an object of class |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
alpha |
a numerical value defining the probability that the dose selected by EWOC is higher than the MTD. |
mtd_prior |
a matrix 1 x 2 of hyperparameters for the Beta prior distribution associated with the parameter MTD. |
rho_prior |
a matrix 1 x 2 of hyperparameters for the Beta prior distribution associated with the parameter rho. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
type |
a character describing the type of the Maximum Tolerable Dose (MTD) variable. |
first_dose |
a numerical value for the first allowable dose in the trial. It is only necessary if type = 'continuous'. |
last_dose |
a numerical value for the last allowable dose in the trial. It is only necessary if type = 'continuous'. |
dose_set |
a numerical vector of allowable doses in the trial. It is only necessary if type = 'discrete'. |
max_increment |
a numerical value indicating the maximum increment from the current dose to the next dose. It is only applied if type = 'continuous'. |
no_skip_dose |
a logical value indicating if it is allowed to skip doses. It is only necessary if type = 'discrete'. The default is TRUE. |
rounding |
a character indicating how to round a continuous dose to the one of elements of the dose set. It is only necessary if type = 'discrete'. |
n_adapt |
the number of iterations for adaptation.
See |
burn_in |
numerical value indicating the number of iterations before to start monitoring. |
n_mcmc |
numerical value indicating the number of iterations to monitor. |
n_thin |
numerical value corresponding to the thinning interval for monitors. |
n_chains |
numerical value indicating the number of parallel chains for the model. |
next_dose
the next recommend dose.
mtd
the posterior MTD distribution.
rho
the posterior rho_0 distribution.
sample
a list of the MCMC chains distribution.
trial
a list of the trial conditions.
Babb, J., Rogatko, A. and Zacks, S., 1998. Cancer phase I clinical trials: efficient dose escalation with overdose control. Statistics in medicine, 17(10), pp.1103-1120.
DLT <- 0 dose <- 20 test <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") summary(test) plot(test)
DLT <- 0 dose <- 20 test <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") summary(test) plot(test)
Finding the next dose for a phase I clinical trial based on the Escalation with Overdose Control (EWOC) design considering the extended parametrization for binary response and single agent.
ewoc_d1extended( formula, theta, alpha, rho_prior, min_dose, max_dose, type = c("continuous", "discrete"), first_dose = NULL, last_dose = NULL, dose_set = NULL, max_increment = NULL, no_skip_dose = TRUE, rounding = c("down", "nearest"), n_adapt = 5000, burn_in = 1000, n_mcmc = 1000, n_thin = 1, n_chains = 1 )
ewoc_d1extended( formula, theta, alpha, rho_prior, min_dose, max_dose, type = c("continuous", "discrete"), first_dose = NULL, last_dose = NULL, dose_set = NULL, max_increment = NULL, no_skip_dose = TRUE, rounding = c("down", "nearest"), n_adapt = 5000, burn_in = 1000, n_mcmc = 1000, n_thin = 1, n_chains = 1 )
formula |
an object of class |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
alpha |
a numerical value defining the probability that the dose selected by EWOC is higher than the MTD. |
rho_prior |
a matrix 3 x 2 of hyperparameters for the Beta prior distribution associated with each parameter rho. Each row corresponds to a parameter. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
type |
a character describing the type of the Maximum Tolerable Dose (MTD) variable. |
first_dose |
a numerical value for the first allowable dose in the trial. |
last_dose |
a numerical value for the last allowable dose in the trial. |
dose_set |
a numerical vector of allowable doses in the trial. It is only necessary if type = "discrete". |
max_increment |
a numerical value indicating the maximum increment from the current dose to the next dose. It is only applied if type = 'continuous'. |
no_skip_dose |
a logical value indicating if it is allowed to skip doses. It is only necessary if type = 'discrete'. The default is TRUE. |
rounding |
a character indicating how to round a continuous dose to the one of elements of the dose set. It is only necessary if type = "discrete". |
n_adapt |
the number of iterations for adaptation.
See |
burn_in |
the number of iterations before to start monitoring. |
n_mcmc |
the number of iterations to monitor. |
n_thin |
thinning interval for monitors. |
n_chains |
the number of parallel chains for the model. |
next_dose
the next recommend dose.
mtd
a numerical vector for the posterior MTD distribution considering the next patient covariable.
rho
a matrix for the posterior rho_0 and rho_1 distributions.
sample
a list of the MCMC chains distribution.
trial
a list of the trial conditions.
Tighiouart, M., Cook-Wiens, G., & Rogatko, A. (2018). A Bayesian adaptive design for cancer phase I trials using a flexible range of doses. Journal of biopharmaceutical statistics, 28(3), 562-574.
DLT <- 0 dose <- 20 test <- ewoc_d1extended(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, dose_set = seq(20, 100, 20), min_dose = 20, max_dose = 100, rho_prior = matrix(1, ncol = 2, nrow = 2), rounding = "nearest") summary(test) plot(test)
DLT <- 0 dose <- 20 test <- ewoc_d1extended(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, dose_set = seq(20, 100, 20), min_dose = 20, max_dose = 100, rho_prior = matrix(1, ncol = 2, nrow = 2), rounding = "nearest") summary(test) plot(test)
Finding the next dose for a phase I clinical trial based on Escalation with Overdose Control (EWOC) design considering parametrization for time to event response and single agent.
ewoc_d1ph( formula, theta, alpha, tau, type = c("continuous", "discrete"), rho_prior, mtd_prior, shape_prior = NULL, min_dose, max_dose, first_dose = NULL, last_dose = NULL, dose_set = NULL, max_increment = NULL, no_skip_dose = TRUE, distribution = c("exponential", "weibull"), rounding = c("down", "nearest"), n_adapt = 5000, burn_in = 1000, n_mcmc = 1000, n_thin = 1, n_chains = 1 )
ewoc_d1ph( formula, theta, alpha, tau, type = c("continuous", "discrete"), rho_prior, mtd_prior, shape_prior = NULL, min_dose, max_dose, first_dose = NULL, last_dose = NULL, dose_set = NULL, max_increment = NULL, no_skip_dose = TRUE, distribution = c("exponential", "weibull"), rounding = c("down", "nearest"), n_adapt = 5000, burn_in = 1000, n_mcmc = 1000, n_thin = 1, n_chains = 1 )
formula |
an object of class |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
alpha |
a numerical value defining the probability that the dose selected by EWOC is higher than the MTD. |
tau |
a numerical value defining the period of time for a possible toxicity be observed. |
type |
a character describing the type of the Maximum Tolerable Dose (MTD) variable. It can be 'discrete' or 'continuous'. |
rho_prior |
a matrix 1x2 of hyperparameters for the Beta prior distribution associated with the parameter rho. |
mtd_prior |
a matrix 1x2 of hyperparameters for the Beta prior distribution associated with the parameter MTD. |
shape_prior |
a matrix 1x2 of hyperparameters for the Gamma prior distribution associated with the shape parameter r for the Weibull distribution. It is only necessary if distribution = 'weibull'. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
first_dose |
a numerical value for the first allowable dose in the trial. It is only necessary if type = 'continuous'. |
last_dose |
a numerical value for the last allowable dose in the trial. It is only necessary if type = 'continuous'. |
dose_set |
a numerical vector of allowable doses in the trial. It is only necessary if type = 'discrete'. |
max_increment |
a numerical value indicating the maximum increment from the current dose to the next dose. It is only applied if type = 'continuous'. |
no_skip_dose |
a logical value indicating if it is allowed to skip doses. It is only necessary if type = 'discrete'. The default is TRUE. |
distribution |
a character establishing the distribution for the time of events. It can be defined as 'exponential' or 'weibull'. |
rounding |
a character indicating how to round a continuous dose to the one of elements of the dose set. It can be 'nearest' or 'down'. It is only necessary if type = 'discrete'. |
n_adapt |
the number of iterations for adaptation.
See |
burn_in |
the number of iterations before to start monitoring. |
n_mcmc |
the number of iterations to monitor. |
n_thin |
thinning interval for monitors. |
n_chains |
the number of parallel chains for the model. |
next_dose
the next recommend dose.
mtd
the posterior MTD distribution.
rho
the posterior rho_0 distribution.
sample
a list of the MCMC chains distribution.
trial
a list of the trial conditions.
Tighiouart M, Liu Y, Rogatko A. Escalation with overdose control using time to toxicity for cancer phase I clinical trials. PloS one. 2014 Mar 24;9(3):e93070.
time <- 9 status <- 0 dose <- 20 test <- ewoc_d1ph(cbind(time, status) ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, tau = 10, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), distribution = 'exponential', rounding = 'nearest') summary(test) plot(test)
time <- 9 status <- 0 dose <- 20 test <- ewoc_d1ph(cbind(time, status) ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, tau = 10, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), distribution = 'exponential', rounding = 'nearest') summary(test) plot(test)
Generic function for simulating EWOC trials.
ewoc_simulation( step_zero, n_sim, sample_size, response_sim, fixed_first_cohort = TRUE, n_cohort = 1, alpha_strategy = "conditional", alpha_rate = 0.05, stop_rule_sim = NULL, ncores = 1, seed = 1234, ... )
ewoc_simulation( step_zero, n_sim, sample_size, response_sim, fixed_first_cohort = TRUE, n_cohort = 1, alpha_strategy = "conditional", alpha_rate = 0.05, stop_rule_sim = NULL, ncores = 1, seed = 1234, ... )
step_zero |
an object from the classes either 'ewoc_d1classical' or 'ewoc_d1extended' or 'ewoc_d1ph' created using the first cohort data. |
n_sim |
a number indicating the number of phase I clinical trials to be simulated. |
sample_size |
a number indicating the number of patients enrolled for each clinical trial. |
response_sim |
a function which is self-contained and will be used as a generator function of the response variables in the simulation. Its only input is 'dose' and output is the indicator of DLT for classical and extended EWOC and the time until DLT for proportional hazards EWOC. |
fixed_first_cohort |
a logical value indicating if the first cohort should be randomly generated or be fixed as the input in 'step_zero'. |
n_cohort |
a number indicating the number of patients enrolled at each cohort. It is only used for 'ewoc_d1classical' and 'ewoc_d1extended'. |
alpha_strategy |
a character indicating the strategy to apply for the feasibility value. Default is "constant". Options are "increasing" and "conditional". |
alpha_rate |
a numerical value indicating the rate of the feasibility strategy. Only necessary if alpha_strategy is either 'increasing' or 'conditional'. |
stop_rule_sim |
a function having as an input an object containing all
the information related to the trial as the returned object trial from either
|
ncores |
a numeric value indicating the number of cores to be used in the simulation performed in parallel. Use parallel::detectCores() to check the number of cores available. |
seed |
is an integer value, containing the random number generator (RNG) state for random number generation. |
... |
For an object |
alpha_sim
a matrix n_sim
x sample_size
containing
the values of feasibility used for each step in the trial and each trial in
the simulation.
dlt_sim
a matrix n_sim
x sample_size
containing
ones and zeros indicating the occurrence of DLT (1) and the absence of DLT (0)
for each step in the trial and each trial in the simulation.
dose_sim
a matrix n_sim
x sample_size
containing
the doses assigned for each step in the trial and each trial in the simulation.
mtd_sim
a numeric vector n_sim
x 1 containing
the recommended MTD for each trial in the simulation.
rho_sim
a numeric vector n_sim
x k containing
the estimated rho parameter(s) for each trial in the simulation, where k = 1
for ewoc_d1classical, ewoc_d1ph, and k = 2 for ewoc_d1extended.
## Not run: ### Classical EWOC DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, ncores = 1) ### Extended EWOC DLT <- 0 dose <- 20 step_zero <- ewoc_d1extended(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 2), rounding = "nearest") response_sim <- response_d1extended(rho = c(0.05, 0.5), min_dose = 20, max_dose = 100) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, ncores = 1) ### PH EWOC time <- 0 status <- 0 dose <- 20 step_zero <- ewoc_d1ph(cbind(time, status) ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, tau = 10, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), distribution = 'exponential', rounding = 'nearest') response_sim <- response_d1ph(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100, tau = 10, distribution = "exponential") sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, ncores = 1) ## End(Not run)
## Not run: ### Classical EWOC DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, ncores = 1) ### Extended EWOC DLT <- 0 dose <- 20 step_zero <- ewoc_d1extended(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 2), rounding = "nearest") response_sim <- response_d1extended(rho = c(0.05, 0.5), min_dose = 20, max_dose = 100) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, ncores = 1) ### PH EWOC time <- 0 status <- 0 dose <- 20 step_zero <- ewoc_d1ph(cbind(time, status) ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, tau = 10, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), distribution = 'exponential', rounding = 'nearest') response_sim <- response_d1ph(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100, tau = 10, distribution = "exponential") sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, ncores = 1) ## End(Not run)
Unstandardizing a dose between minimum and maximum doses.
inv_standard_dose(dose, min_dose, max_dose)
inv_standard_dose(dose, min_dose, max_dose)
dose |
a numerical value defining the standardized dose to be unstandardized. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
dose
a numerical value between min_dose
and max_dose
.
Calculating the logit of a probability
logit(p)
logit(p)
p |
a numerical value defining the probability to be transformed into logit scale. |
logit
a numerical value in logit scale.
Calculate the bias.
mtd_bias(mtd_estimate, true_mtd)
mtd_bias(mtd_estimate, true_mtd)
mtd_estimate |
a numerical vector of the MTD estimates. |
true_mtd |
a numerical value of the true Maximum Tolerable Dose. |
Bias of the MTD estimates.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) mtd_bias(sim$mtd_sim, true_mtd = 20) ## End(Not run)
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) mtd_bias(sim$mtd_sim, true_mtd = 20) ## End(Not run)
Calculate the Mean Square Error (MSE).
mtd_mse(mtd_estimate, true_mtd)
mtd_mse(mtd_estimate, true_mtd)
mtd_estimate |
a numerical vector of the MTD estimates. |
true_mtd |
a numerical value of the true Maximum Tolerable Dose. |
MSE of the MTD estimates.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) mtd_mse(sim$mtd_sim, true_mtd = 20) ## End(Not run)
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) mtd_mse(sim$mtd_sim, true_mtd = 20) ## End(Not run)
Converting mtd to rho_1 given rho_0 for EWOC design using extended parametrization and vice-versa.
mtd_rho_d1extended(mtd = NULL, rho_1 = NULL, rho_0, theta, min_dose, max_dose)
mtd_rho_d1extended(mtd = NULL, rho_1 = NULL, rho_0, theta, min_dose, max_dose)
mtd |
a numerical value defining the mtd value to be converted into rho_1 value. |
rho_1 |
a numerical value defining the probability of DLT at the max_dose. |
rho_0 |
a numerical value defining the probability of DLT at the min_dose. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
mtd
a numerical value for the maximum tolerable dose.
rho_1
a numerical value for the probability of DLT at the max_dose.
Generic operating characteristics for one or more scenarios in EWOC simulations.
opc(sim_list, pdlt_list, mtd_list, toxicity_margin = NULL, mtd_margin = NULL)
opc(sim_list, pdlt_list, mtd_list, toxicity_margin = NULL, mtd_margin = NULL)
sim_list |
a list of 'ewoc_simulation' objects for different scenarios
created using the |
pdlt_list |
a list of functions to calculate the probability of toxicity with a numeric vector of doses as input and a numeric vector of probabilities as output. |
mtd_list |
a list of numerical values indicating the true MTD for each scenario. |
toxicity_margin |
a numerical value of the acceptable margin of distance from the
|
mtd_margin |
a numerical value of the acceptable margin of distance from the
|
dlt_rate
See dlt_rate
.
dose_toxicity
See optimal_toxicity
.
mtd_toxicity
See optimal_toxicity
.
bias_mse
See mtd_bias
and mtd_mse
.
dose_efficiency
See optimal_mtd
.
mtd_efficiency
See optimal_mtd
.
stop
See stop_rule
.
Diniz, M. A., Tighiouart, M., & Rogatko, A. (2019). Comparison between continuous and discrete doses for model based designs in cancer dose finding. PloS one, 14(1).
## Not run: ### Only one simulation DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, fixed_first_cohort = TRUE, ncores = 1) pdlt <- pdlt_d1classical(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100) opc(sim_list = list(sim), pdlt_list = list(pdlt), mtd_list = list(60), toxicity_margin = 0.05, mtd_margin = 6) ### Two or more simulations sim_list <- list() mtd_list <- list() pdlt_list <- list() DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") mtd_list[[1]] <- 60 response_sim <- response_d1classical(rho = 0.05, mtd = mtd_list[[1]], theta = 0.33, min_dose = 20, max_dose = 100) sim_list[[1]] <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, fixed_first_cohort = TRUE, ncores = 1) pdlt_list[[1]] <- pdlt_d1classical(rho = 0.05, mtd = mtd_list[[1]], theta = 0.33, min_dose = 20, max_dose = 100) mtd_list[[2]] <- 40 response_sim <- response_d1classical(rho = 0.05, mtd = mtd_list[[2]], theta = 0.33, min_dose = 20, max_dose = 100) sim_list[[2]] <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, fixed_first_cohort = TRUE, ncores = 1) pdlt_list[[2]] <- pdlt_d1classical(rho = 0.05, mtd = mtd_list[[2]], theta = 0.33, min_dose = 20, max_dose = 100) opc(sim_list = sim_list, pdlt_list = pdlt_list, mtd_list = mtd_list, toxicity_margin = 0.05, mtd_margin = 6) ## End(Not run)
## Not run: ### Only one simulation DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, fixed_first_cohort = TRUE, ncores = 1) pdlt <- pdlt_d1classical(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100) opc(sim_list = list(sim), pdlt_list = list(pdlt), mtd_list = list(60), toxicity_margin = 0.05, mtd_margin = 6) ### Two or more simulations sim_list <- list() mtd_list <- list() pdlt_list <- list() DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") mtd_list[[1]] <- 60 response_sim <- response_d1classical(rho = 0.05, mtd = mtd_list[[1]], theta = 0.33, min_dose = 20, max_dose = 100) sim_list[[1]] <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, fixed_first_cohort = TRUE, ncores = 1) pdlt_list[[1]] <- pdlt_d1classical(rho = 0.05, mtd = mtd_list[[1]], theta = 0.33, min_dose = 20, max_dose = 100) mtd_list[[2]] <- 40 response_sim <- response_d1classical(rho = 0.05, mtd = mtd_list[[2]], theta = 0.33, min_dose = 20, max_dose = 100) sim_list[[2]] <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 30, n_cohort = 1, alpha_strategy = "conditional", response_sim = response_sim, fixed_first_cohort = TRUE, ncores = 1) pdlt_list[[2]] <- pdlt_d1classical(rho = 0.05, mtd = mtd_list[[2]], theta = 0.33, min_dose = 20, max_dose = 100) opc(sim_list = sim_list, pdlt_list = pdlt_list, mtd_list = mtd_list, toxicity_margin = 0.05, mtd_margin = 6) ## End(Not run)
Calculate the percent of doses which are inside the optimal MTD interval [true_MTD -
margin ; true_MTD + margin]
.
optimal_mtd(dose_matrix, true_mtd, margin, digits = 2)
optimal_mtd(dose_matrix, true_mtd, margin, digits = 2)
dose_matrix |
a numerical matrix or vector of assigned doses for each step of the trial (column) and for each trial (row). |
true_mtd |
a numerical value of the true Maximum Tolerable Dose. |
margin |
a numerical value of the acceptable margin of distance from the
|
digits |
a numerical value indicating the number of digits. |
interval
the average percent of doses which are inside the optimal MTD interval.
underdose
the average percent of doses which are smaller than the lower limit of the optimal MTD interval.
overdose
the average percent of doses which are greater than the upper limit of the optimal MTD interval.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) optimal_mtd(sim$mtd_sim, true_mtd = 20, margin = 0.1*20) optimal_mtd(sim$dose_sim, true_mtd = 20, margin = 0.1*20) ## End(Not run)
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) optimal_mtd(sim$mtd_sim, true_mtd = 20, margin = 0.1*20) optimal_mtd(sim$dose_sim, true_mtd = 20, margin = 0.1*20) ## End(Not run)
Calculate the percent of doses which are inside the optimal toxicity interval [target rate -
margin ; target rate + margin]
.
optimal_toxicity(dose_matrix, target_rate, margin, pdlt, digits = 2)
optimal_toxicity(dose_matrix, target_rate, margin, pdlt, digits = 2)
dose_matrix |
a numerical matrix of assigned doses for each step of the trial (column) and for each trial (row). |
target_rate |
a numerical value of the target DLT rate. |
margin |
a numerical value of the acceptable margin of distance from the
|
pdlt |
a function to calculate the probability of toxicity with a numeric vector of doses as input and a numeric vector of probabilities as output. |
digits |
a numerical value indicating the number of digits. |
interval
the average percent of doses which are inside the optimal toxicity interval.
underdose
the average percent of doses which are smaller than the lower limit of the optimal toxicity interval.
overdose
the average percent of doses which are greater than the upper limit of the optimal toxicity interval.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) pdlt_sim <- pdlt_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) optimal_toxicity(sim$mtd_sim, target_rate = 0.33, margin = 0.05, pdlt = pdlt_sim) optimal_toxicity(sim$dose_sim, target_rate = 0.33, margin = 0.05, pdlt = pdlt_sim) ## End(Not run)
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) pdlt_sim <- pdlt_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, ncores = 2) optimal_toxicity(sim$mtd_sim, target_rate = 0.33, margin = 0.05, pdlt = pdlt_sim) optimal_toxicity(sim$dose_sim, target_rate = 0.33, margin = 0.05, pdlt = pdlt_sim) ## End(Not run)
Generating a probability of DLT function based on the EWOC classical model
pdlt_d1classical(rho, mtd, theta, min_dose, max_dose)
pdlt_d1classical(rho, mtd, theta, min_dose, max_dose)
rho |
a numerical value indicating the true value of the parameter rho. |
mtd |
a numerical value indicating the true value of the parameter mtd. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
A function with dose as an input and a probability based on the logistic regression and parameters as an output.
pdlt <- pdlt_d1classical(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100) pdlt(20)
pdlt <- pdlt_d1classical(rho = 0.05, mtd = 60, theta = 0.33, min_dose = 20, max_dose = 100) pdlt(20)
Generating a probability of DLT function based on the EWOC extended model
pdlt_d1extended(rho, min_dose, max_dose)
pdlt_d1extended(rho, min_dose, max_dose)
rho |
a numerical vector indicating the true value of the parameters rho_0 and rho_1. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
A function with dose as an input and a probability based on the logistic regression and parameters as an output.
pdlt <- pdlt_d1extended(rho = c(0.05, 0.5), min_dose = 10, max_dose = 50) pdlt(20)
pdlt <- pdlt_d1extended(rho = c(0.05, 0.5), min_dose = 10, max_dose = 50) pdlt(20)
Generating a probability of DLT function based on the EWOC Proportional Hazards model
pdlt_d1ph(rho, mtd, shape = NULL, theta, min_dose, max_dose, tau, distribution)
pdlt_d1ph(rho, mtd, shape = NULL, theta, min_dose, max_dose, tau, distribution)
rho |
a numerical value indicating the true value of the parameter rho. |
mtd |
a numerical value indicating the true value of the parameter mtd. |
shape |
a numerical value indicating the true value of the parameter shape. It is only necessary if 'distribution' = "weibull". |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
tau |
a numerical value defining the period of time for a possible toxicity be observed. |
distribution |
a character establishing the distribution for the time of events. It can be defined as 'exponential' or 'weibull'. |
A function with dose as an input and a probability based on the logistic regression and parameters as an output.
pdlt <- pdlt_d1ph(rho = 0.05, mtd = 40, theta = 0.33, min_dose = 30, max_dose = 50, tau = 10, distribution = "exponential") pdlt(40)
pdlt <- pdlt_d1ph(rho = 0.05, mtd = 40, theta = 0.33, min_dose = 30, max_dose = 50, tau = 10, distribution = "exponential") pdlt(40)
Generating a binary response function based on the EWOC classical model
response_d1classical(rho, mtd, theta, min_dose, max_dose)
response_d1classical(rho, mtd, theta, min_dose, max_dose)
rho |
a numerical value indicating the true value of the parameter rho. |
mtd |
a numerical value indicating the true value of the parameter mtd. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
A function with dose as an input and a Binomial variable based on the parameters as an output.
response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) response_sim(20)
response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) response_sim(20)
Generating a binary response function based on the EWOC extended model
response_d1extended(rho, min_dose, max_dose)
response_d1extended(rho, min_dose, max_dose)
rho |
a numerical vector indicating the true value of the parameters rho_0 and rho_1. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
A function with dose as an input and a Binomial variable based on the parameters as an output.
response_sim <- response_d1extended(rho = c(0.05, 0.5), min_dose = 10, max_dose = 50) response_sim(20)
response_sim <- response_d1extended(rho = c(0.05, 0.5), min_dose = 10, max_dose = 50) response_sim(20)
Generating a response function based on the EWOC Proportional Hazards model
response_d1ph( rho, mtd, theta, min_dose, max_dose, tau, distribution, shape = NULL )
response_d1ph( rho, mtd, theta, min_dose, max_dose, tau, distribution, shape = NULL )
rho |
a numerical value indicating the true value of the parameter rho. |
mtd |
a numerical value indicating the true value of the parameter mtd. |
theta |
a numerical value defining the proportion of expected patients to experience a medically unacceptable, dose-limiting toxicity (DLT) if administered the MTD. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
tau |
a numerical value defining the period of time for a possible toxicity be observed. |
distribution |
a character establishing the distribution for the time of events. |
shape |
a numerical value indicating the true value of the parameter shape. It is only necessary if 'distribution' = "weibull". |
A function with dose as an input and a Binomial variable based on the parameters as an output.
response_sim <- response_d1ph(rho = 0.05, mtd = 40, theta = 0.33, min_dose = 30, max_dose = 50, tau = 10, distribution = "exponential") response_sim(40)
response_sim <- response_d1ph(rho = 0.05, mtd = 40, theta = 0.33, min_dose = 30, max_dose = 50, tau = 10, distribution = "exponential") response_sim(40)
Standardizing a dose between 0 and 1.
standard_dose(dose, min_dose, max_dose)
standard_dose(dose, min_dose, max_dose)
dose |
a numerical value defining the dose to be standardized. |
min_dose |
a numerical value defining the lower bound of the support of the MTD. |
max_dose |
a numerical value defining the upper bound of the support of the MTD. |
standardized dose
a numerical value between 0 and 1.
Calculate the average, minimum, maximum number of patients to stop a trial and the percent of stopped trials. Stopped trials contain NA after the last assigned dose.
stop_rule(dlt_matrix, sample_size, digits = 2)
stop_rule(dlt_matrix, sample_size, digits = 2)
dlt_matrix |
Matrix of the number of DLT for each step of the trial (column) and for each trial (row). |
sample_size |
a numerical value indicating the expected sample size. |
digits |
a numerical value indicating the number of digits. |
A list consisting of
average
: Average number of patients to stop a trial.
min
: Minimum number of patients to stop a trial.
max
: Maximum number of patients to stop a trial.
nstop
: Percent of stopped trials.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_sim(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 2, alpha_strategy = "increasing", response_sim = response_sim, stop_rule_sim = stop_rule_sim, ncores = 2) stop_rule(sim$dlt_sim) ## End(Not run) ## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_sim(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, stop_rule_sim = stop_rule_sim, ncores = 2) stop_rule(sim$dlt_sim) ## End(Not run)
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_sim(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 1, sample_size = 2, alpha_strategy = "increasing", response_sim = response_sim, stop_rule_sim = stop_rule_sim, ncores = 2) stop_rule(sim$dlt_sim) ## End(Not run) ## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_sim(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "increasing", response_sim = response_sim, stop_rule_sim = stop_rule_sim, ncores = 2) stop_rule(sim$dlt_sim) ## End(Not run)
Generating a stop rule function for EWOC classical model
stop_rule_d1classical(step)
stop_rule_d1classical(step)
step |
an object from the class 'ewoc_d1classical'. |
The stop rule function is evaluated at each step of the trial. It can defined based on any information contained in the object 'step' that is the output from one of the functions 'ewoc_d1classical'.
a logical character indicating if the trial should be stopped or not.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_d1classical(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "conditional", response_sim = response_sim, stop_rule_sim = stop_rule_d1_classical, ncores = 1) ## End(Not run)
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1classical(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), rounding = "nearest") stop_rule_d1classical(step_zero) response_sim <- response_d1classical(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "conditional", response_sim = response_sim, stop_rule_sim = stop_rule_d1_classical, ncores = 1) ## End(Not run)
Generating a stop rule function for EWOC extended model
stop_rule_d1extended(step)
stop_rule_d1extended(step)
step |
an object from the class 'ewoc_d1extended'. |
The stop rule function is evaluated at each step of the trial. It can defined based on any information contained in the object 'step' that is the output from one of the functions ewoc_d1extended'.
a logical character indicating if the trial should be stopped or not.
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1extended(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 2), rounding = "nearest") stop_rule_d1extended(step_zero) response_sim <- response_d1extended(rho = c(0.05, 0.95), min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "conditional", response_sim = response_sim, stop_rule_sim = stop_rule_d1extended, ncores = 1) ## End(Not run)
## Not run: DLT <- 0 dose <- 20 step_zero <- ewoc_d1extended(DLT ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, min_dose = 0, max_dose = 100, dose_set = seq(0, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 2), rounding = "nearest") stop_rule_d1extended(step_zero) response_sim <- response_d1extended(rho = c(0.05, 0.95), min_dose = 10, max_dose = 50) sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "conditional", response_sim = response_sim, stop_rule_sim = stop_rule_d1extended, ncores = 1) ## End(Not run)
Generating a stop rule function for EWOC proportional hazards model
stop_rule_d1ph(step)
stop_rule_d1ph(step)
step |
an object from the class 'ewoc_d1ph'. |
The stop rule function is evaluated at each step of the trial. It can defined based on any information contained in the object 'step' that is the output from one of the functions 'ewoc_d1ph'.
a logical character indicating if the trial should be stopped or not.
## Not run: time <- 9 status <- 0 dose <- 20 step_zero <- ewoc_d1ph(cbind(time, status) ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, tau = 10, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), distribution = 'exponential', rounding = 'nearest') stop_rule_d1ph(step_zero) response_sim <- response_d1ph(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50, tau = 10, distribution = "exponential") sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "conditional", response_sim = response_sim, stop_rule_sim = stop_rule_d1ph, ncores = 1) ## End(Not run)
## Not run: time <- 9 status <- 0 dose <- 20 step_zero <- ewoc_d1ph(cbind(time, status) ~ dose, type = 'discrete', theta = 0.33, alpha = 0.25, tau = 10, min_dose = 20, max_dose = 100, dose_set = seq(20, 100, 20), rho_prior = matrix(1, ncol = 2, nrow = 1), mtd_prior = matrix(1, ncol = 2, nrow = 1), distribution = 'exponential', rounding = 'nearest') stop_rule_d1ph(step_zero) response_sim <- response_d1ph(rho = 0.05, mtd = 20, theta = 0.33, min_dose = 10, max_dose = 50, tau = 10, distribution = "exponential") sim <- ewoc_simulation(step_zero = step_zero, n_sim = 2, sample_size = 30, alpha_strategy = "conditional", response_sim = response_sim, stop_rule_sim = stop_rule_d1ph, ncores = 1) ## End(Not run)