Title: | Personalized Repeated Measurement Design for Phase I Clinical Trials |
---|---|
Description: | Implements Bayesian phase I repeated measurement design that accounts for multidimensional toxicity endpoints and longitudinal efficacy measure from multiple treatment cycles. The package provides flags to fit a variety of model-based phase I design, including 1 stage models with or without individualized dose modification, 3-stage models with or without individualized dose modification, etc. Functions are provided to recommend dosage selection based on the data collected in the available patient cohorts and to simulate trial characteristics given design parameters. Yin, Jun, et al. (2017) <doi:10.1002/sim.7134>. |
Authors: | Lu Zhang, Jun Yin |
Maintainer: | Lu Zhang <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.2 |
Built: | 2024-11-24 03:54:42 UTC |
Source: | https://github.com/luzhangstat/phase1prmd |
A list of 4 records the parameters for efficacy measure generation. This
serves as an example of the parameter settings for efficacy measure
generation in function SimPRMD
. Check eff_summary
or
SimPRMD
to see the examples of using dataset eff
in
generating efficacy measure.
eff
eff
An object of class list
of length 4.
Dose_Cycle_Meff |
Dose-cycle mean efficacy matrix. An array of 4 dimension providing the mean of the multivariate Gaussian distribution in efficacy data generation. The dimension of the Dose-cycle mean efficacy matrix is 5 5 6 6 which represents dose efficacy pattern, cycle efficacy pattern, dose and cycle. Patterns are ordered in a way that the first is increasing, the second is flat, the third is platform, the fourth is decreasing, and the fifth is quadratic efficacy across dose levels and cycles. |
Sigma |
A 6 by 6 matrix, the covariance matrix of the multivariate Guassian distribution in efficacy data generation. |
sd_trans |
A positive number controls the skewness of the distribution of the efficacy response |
eff.M |
An array recording the corresponding mean of the generated
efficacy data with parameters specified by |
eff.structure
of function SimPRMD
with
selected eff.sd_tran
Suggest the input eff.structure
of function SimPRMD with selected
eff.sd_tran
for given efficacy mean matrix and efficacy standard
deviation
eff_suggest(eff.M, eff.sd, eff.sd_trans, n.sim = 30000)
eff_suggest(eff.M, eff.sd, eff.sd_trans, n.sim = 30000)
eff.M |
The efficacy mean matrix whose (i,j)th element save the target mean of the efficacy data |
eff.sd |
The target standard deviation matrix for all dose and cycles. Notice that the generated efficacy may have different standard deviation matrix due to the correlations across cycles |
eff.sd_trans |
The eff.sd_trans for test. Notice variance of the
generated efficacy data will be effected by |
n.sim |
The number of simulations for the numerical calculation in the function. The default is 30,000 |
eff.suggest |
The matrix suggested for the input
|
# Provide an target efficacy mean matrix for all dose and cycles eff.M <- matrix(rep(3:8/10, 6), nrow = 6, ncol = 6) # Give a target standard deviation matrix for all dose and cycles # Notice that the generated efficacy may have difference standard deviation # matrix due to the correlations across cycles eff.sd <- matrix(0.2, nrow = 6, ncol = 6) # Select a eff.sd_trans for testing. The efficacy variance are mainly # controlled by the eff.sd_trans eff.sd_trans <- 1.5 # or other positive value eff.structure <- eff_suggest(eff.M = eff.M, eff.sd = eff.sd, eff.sd_trans = eff.sd_trans) # check whether the suggested eff.M and the selected sd_trans # generate the desirable scenario eff.Sigma <- diag(6) diag(eff.Sigma[-1,]) = 0.5 diag(eff.Sigma[, -1]) = 0.5 eff.check <- eff_summary(eff.structure = eff.structure, eff.Sigma = eff.Sigma, eff.sd_trans = eff.sd_trans, plot.flag = FALSE) eff.check$eff.M eff.check$eff.cor.ls
# Provide an target efficacy mean matrix for all dose and cycles eff.M <- matrix(rep(3:8/10, 6), nrow = 6, ncol = 6) # Give a target standard deviation matrix for all dose and cycles # Notice that the generated efficacy may have difference standard deviation # matrix due to the correlations across cycles eff.sd <- matrix(0.2, nrow = 6, ncol = 6) # Select a eff.sd_trans for testing. The efficacy variance are mainly # controlled by the eff.sd_trans eff.sd_trans <- 1.5 # or other positive value eff.structure <- eff_suggest(eff.M = eff.M, eff.sd = eff.sd, eff.sd_trans = eff.sd_trans) # check whether the suggested eff.M and the selected sd_trans # generate the desirable scenario eff.Sigma <- diag(6) diag(eff.Sigma[-1,]) = 0.5 diag(eff.Sigma[, -1]) = 0.5 eff.check <- eff_summary(eff.structure = eff.structure, eff.Sigma = eff.Sigma, eff.sd_trans = eff.sd_trans, plot.flag = FALSE) eff.check$eff.M eff.check$eff.cor.ls
Numerically compute the Mean, mariginal standard deviance and mariginal correlation matrix of efficacy measure generated with specified parameters. The function provides plots of marginal density of generated efficacy and correlation matrix for each dose. Check details to see the efficacy data generation procedures.
eff_summary( eff.structure, eff.Sigma, eff.sd_trans, n.sim = 3e+05, seed = 123, plot.flag = F, plot.title = T )
eff_summary( eff.structure, eff.Sigma, eff.sd_trans, n.sim = 3e+05, seed = 123, plot.flag = F, plot.title = T )
eff.structure |
A matrix providing the mean of the multivariate
Gaussian distribution in efficacy data generation. Specifically, the
|
eff.Sigma |
The covariance matrix of the multivariate Guassian distribution in efficacy data generation. |
eff.sd_trans |
A positive number controling the skewness of the distribution of the efficacy response. |
n.sim |
Number of simulations for calculation summary statistics. Default is 300,000 |
seed |
The seed of R's random number generator. Default is 123 |
plot.flag |
Whether output the marginal density, and correlation matrix or not. Default is FALSE. |
plot.title |
Whether display the title of the plot or not. Default is TRUE |
The user can simulate longitudinal efficacy response with
different dose-efficacy and cycle-efficacy pattern using argument
eff.structure
, eff.Sigma
and eff.sd_trans
. The
sampling process of efficacy response starts from generating from multivariate Gaussian distribution
, where and
are specified by
eff.structure
and eff.Sigma
, respectively. Define
be the density of
with CDF
,
where
is set by
eff.sd_trans
. Then the efficacy
measure is generated by taking the CDF of :
. Notice here the variance
parameter controls the variance of the generated
efficacy.
eff.M |
A matrix recording the efficacy mean whose |
eff.cor.ls |
A list with a length of dose levels numbers recording the marginal correlation matrix across cycles of efficacy data for each dose level |
data("eff") # load eff.RData from package phase1PRMD. Details see "?eff" eff.structure = eff$Dose_Cycle_Meff["plat", "dec", , ] eff.Sigma = eff$Sigma eff.sd_trans = eff$sd_trans # res <- eff_summary(eff.structure, eff.Sigma, eff.sd_trans, n.sim = 300000, # seed = 123) # res # set a special cases and check the density and correlation plots # eff_summary(eff.structure = matrix(eff.structure[cbind(c(1:6), c(1:6))], # nrow = 1, ncol = 6), # eff.Sigma, eff.sd_trans, n.sim = 300000, seed = 123, # plot.flag = TRUE, plot.title = FALSE)
data("eff") # load eff.RData from package phase1PRMD. Details see "?eff" eff.structure = eff$Dose_Cycle_Meff["plat", "dec", , ] eff.Sigma = eff$Sigma eff.sd_trans = eff$sd_trans # res <- eff_summary(eff.structure, eff.Sigma, eff.sd_trans, n.sim = 300000, # seed = 123) # res # set a special cases and check the density and correlation plots # eff_summary(eff.structure = matrix(eff.structure[cbind(c(1:6), c(1:6))], # nrow = 1, ncol = 6), # eff.Sigma, eff.sd_trans, n.sim = 300000, seed = 123, # plot.flag = TRUE, plot.title = FALSE)
nTTP_summary
generates the mean nTTP score and the probability of
observing DLT for all doses and cycles
nTTP_summary(Tox.prob.M, nTTP.all, wm)
nTTP_summary(Tox.prob.M, nTTP.all, wm)
Tox.prob.M |
Toxicity probability matrix with 4 dimension: dose,
cycle, type, grade. Tox.prob.M can be the output of the build-in matrix
of function |
nTTP.all |
The output of |
wm |
(numerical matrix) Toxicity weighted matrix, with row be the type of the toxicity and column be the toxicity grade |
mnTTP.M |
matrix of mean nTTP for all doses and cycles |
pDLT.M |
matrix of probability of observing DLT for all doses and cycles |
data("prob") wm <- matrix(c(0, 0.5, 0.75, 1, 1.5, 0, 0.5, 0.75, 1, 1.5, 0, 0, 0, 0.5, 1), byrow = TRUE, ncol = 5) # weighted matrix for toxicity matrix # nrow = No.of type; ncol = No. of grade toxmax <- 2.5 nTTP.all <- nTTP.array(wm, toxmax) tox.matrix <- prob["MTD4", "flat", , , , ] nTTP_summary(tox.matrix, nTTP.all, wm)
data("prob") wm <- matrix(c(0, 0.5, 0.75, 1, 1.5, 0, 0.5, 0.75, 1, 1.5, 0, 0, 0, 0.5, 1), byrow = TRUE, ncol = 5) # weighted matrix for toxicity matrix # nrow = No.of type; ncol = No. of grade toxmax <- 2.5 nTTP.all <- nTTP.array(wm, toxmax) tox.matrix <- prob["MTD4", "flat", , , , ] nTTP_summary(tox.matrix, nTTP.all, wm)
nTTP.array
generates the nTTP dictionary for all combination of
toxicity type and grade with a given toxicity weighted matrix. Used in
function nTTP_summary
for checking the toxicity scenario.
nTTP.array(wm, toxmax)
nTTP.array(wm, toxmax)
wm |
(numeric matrix, m by n) Toxicity weighted matrix, with row be the type of the toxicity and column be the toxicity grade |
toxmax |
(scalar) Normalized constant for nTTP |
An m dimensional array with dimension . The
th
element is the nTTP when the grade of
th type of toxicity has
th toxicity grade.
wm = matrix(c(0, 0.5, 0.75, 1, 1.5, 0, 0.5, 0.75, 1, 1.5, 0, 0, 0, 0.5, 1), byrow = TRUE, ncol = 5) # weighted matrix for toxicity matrix # nrow = No.of type; ncol = No. of grade toxmax = 2.5 nTTP.array(wm, toxmax)
wm = matrix(c(0, 0.5, 0.75, 1, 1.5, 0, 0.5, 0.75, 1, 1.5, 0, 0, 0, 0.5, 1), byrow = TRUE, ncol = 5) # weighted matrix for toxicity matrix # nrow = No.of type; ncol = No. of grade toxmax = 2.5 nTTP.array(wm, toxmax)
The data "patlist_sim" is a trial generated by "SimPRMD". The model utilized
for generating trial is a 3-stage model with individualized dose modification.
The MTD = 4 and the MED = 1 since the dose-efficacy pattern when generating
the trial was set to be flat. The dose-toxicity trend and efficacy-cycle trend
are flat. There are in total 12 cohorts with 3 patients in each cohort. This
also serves as an example of the input data of function RunPRMD
.
patlist_sim
patlist_sim
An object of class list
of length 6.
PatID |
denotes the patient ID where the elements are specified by cohort and subject number. For example, "cohort2subject3" denotes the third subject in the second cohort |
dose |
records the dose assigned for each patient on different cycles |
cycle |
shows the treatment cycle |
nTTP |
records th corresponding nTTP score. |
dlt |
indicates whether a DLT event is observed or not? |
efficacy |
provides the continuous efficacy for each cycle. The range of efficacy measure is (0, 1). |
Display patient records in a human-readable table. Each cell contains 3 values including observed nTTP, DLT, and dose assignment. The higher the dose, the warmer the cell background color is. The black color of the records indicates DLT equals 1.
patlist.display(patlist, n.dose, n.cycle)
patlist.display(patlist, n.dose, n.cycle)
patlist |
A list of the patient treatment records, which must contains the following variables:
|
n.dose |
The number of dose in the study |
n.cycle |
The number of cycle in the study |
Plot nTTP boxplots of a RunPRMD object. Plot efficacy boxplots when
implementing RunPRMD
with option effcy.flag == TRUE
.
## S3 method for class 'RunPRMD' plot(x, ..., select_cycle = x$cycles)
## S3 method for class 'RunPRMD' plot(x, ..., select_cycle = x$cycles)
x |
RunPRMD object to summarise |
... |
other arguments ignored (for compatibility with generic) |
select_cycle |
A vector indication the cycle in the boxplot. Default
is |
## Check ?RunPRMD for example
## Check ?RunPRMD for example
Plot the predictive probability of nTTP < target toxicity for all cycles
and doses , the mean nTTP vs cycle1 and cycle > 2 for all doses of a
SimPRMD object. Plot median treatment duration boxplot along with the DLT
drop off rate when implementing SimPRMD
with option
DLT.drop.flag = TRUE
.
## S3 method for class 'SimPRMD' plot(x, ..., title.add = TRUE)
## S3 method for class 'SimPRMD' plot(x, ..., title.add = TRUE)
x |
SimPRMD object to summarise |
... |
other arguments ignored (for compatibility with generic) |
title.add |
controls whether there is a title on plots or not. |
## Check ?SimPRMD for example
## Check ?SimPRMD for example
Displays a useful description of a summary.RunPRMD object. Call by
link{summary.RunPRMD}
. Check link{summary.RunPRMD}
for the
details of the print information.
## S3 method for class 'summary.RunPRMD' print(x, ...)
## S3 method for class 'summary.RunPRMD' print(x, ...)
x |
summary.RunPRMD object to summarise |
... |
other arguments ignored (for compatibility with generic) |
Displays a useful description of a summary.SimPRMD object
## S3 method for class 'summary.SimPRMD' print(x, ...)
## S3 method for class 'summary.SimPRMD' print(x, ...)
x |
summary.SimPRMD object to summarise |
... |
other arguments ignored (for compatibility with generic) |
A 6 dimension array providing the toxicity probability of different scenarios. The dimension is 4 3 6 6 3 5 which represents scenario, cycle effect, dose level, cycle number, toxicity type, and tox grade. Scenarios are ordered in a way that the first scenario is MTD = dose 2, the second is MTD = dose 3, the third is MTD = dose 4, and the fourth is MTD = dose 5. The three Cycle effect trend are decreasing, flat, and increasing toxicity trend over cycles. There are 6 doses, 6 cycles, 3 toxicity types and 5 toxicity grades.
prob
prob
An object of class array
of dimension 4 x 3 x 6 x 6 x 3 x 5.
A function to implement a Multi-Stage Phase I Dose-Finding Design to recommend dosage selection based on the data collected in the available patient cohorts. The available models include 1-stage model with/without individualized dose modification, 3-stage model with/without individualized dose modification, 3-stage model with individualized dose modification on stage II and 3-stage model with individualized dose modification on stage I and dose modification on stage II.
RunPRMD( seed = 1234, patlist, patID_act = NULL, cycle_act = NULL, dose_act = NULL, dlt_act = NULL, doses = 1:6, cycles = 1:6, tox.target = 0.28, p_tox1 = 0.2, p_tox2 = 0.2, trialSize = 36, chSize = 3, thrd1 = 0.28, thrd2 = 0.28, proxy.thrd = 0.1, param.ctrl = list(), n.iters = 10000, burn.in = 5000, thin = 2, n.chains = 1, effcy.flag = T, ICD.flag = T, DLT.drop.flag = T, testedD = T, IED.flag = T, ICD_thrd = 0.3 )
RunPRMD( seed = 1234, patlist, patID_act = NULL, cycle_act = NULL, dose_act = NULL, dlt_act = NULL, doses = 1:6, cycles = 1:6, tox.target = 0.28, p_tox1 = 0.2, p_tox2 = 0.2, trialSize = 36, chSize = 3, thrd1 = 0.28, thrd2 = 0.28, proxy.thrd = 0.1, param.ctrl = list(), n.iters = 10000, burn.in = 5000, thin = 2, n.chains = 1, effcy.flag = T, ICD.flag = T, DLT.drop.flag = T, testedD = T, IED.flag = T, ICD_thrd = 0.3 )
seed |
The seed of R's random number generator. Default is 1234 |
patlist |
A list of the patient treatment records, which must contains the following variables:
See |
patID_act |
A vector recording the patients' ID who need dose
recommendation for next cycle. Default is |
cycle_act |
A vector recording the current cycle of patID_act. Default
is |
dose_act |
A vector recording the current dose level of patID_act.
Default is |
dlt_act |
A vector indicating whether a dlt is observed in current
cycle for current patients. Default is |
doses |
A vector of doses that users are going to explore. Default is 1:6, where dose 1 through dose 6 are being tested. |
cycles |
A vector of cycles that the treatment plans to go through. Default is 1:6, where patients will experience up to 6 cycles of the treatment |
tox.target |
The target toxicity of the treatment. Default is 0.28. See details below. |
p_tox1 |
The probability cutoff for cycle 1 toxicity. Default is 0.2. See details below. |
p_tox2 |
The probability cutoff for later cycles toxicity beyond cycle 1. Default is 0.2. See Details below. |
trialSize |
The maximum sample size for trial simulation. Default is
36. Must be the multiple of cohort size ( |
chSize |
The cohort size of patients recruited. Default is 3. |
thrd1 |
An upper bound of toxicity for cycle 1 of the treatment. Default is 0.28. See Details below. |
thrd2 |
An upper bound of toxicity for late cycles of the treatment, beyond cycle 1. Default is 0.28. See Details below |
proxy.thrd |
A distance parameter to define efficacious doses. Any dose whose predicted efficacy is within proxy.thrd away from the largest one among the safe doses will be declared an efficacious dose. |
param.ctrl |
A list specifying the prior distribution for the parameters.
Default is non-informative priors. |
n.iters |
Total number of MCMC simulations. Default is 10,000. |
burn.in |
Number of burn=ins in the MCMC simulation. Default is 5,000. |
thin |
Thinning parameter. Default is 2. |
n.chains |
No. of MCMC chains in Bayesian model fitting. Default is
1. Will check the convergence of MCMC chains by the potential scale
reduction factor (PSRF) when |
effcy.flag |
Whether efficacy data is modeled in the model fitting or not. Default is TRUE. |
ICD.flag |
Whether we allow individualized dose modification in stage 1 model or not? Default is TRUE. See details below |
DLT.drop.flag |
Whether the patients should suspend the treatment when observing DLT. Default is TRUE. |
testedD |
Default is TRUE. Whether we only allow ICD or IED to be less than or equal to the maximum dose tested in first cycle. |
IED.flag |
Default is TRUE. Whether we allow dose changing for cycle > 1 in stage 2 model or not? |
ICD_thrd |
The cut-off point of the posterior toxicity probability in defining ICD. Default is 0.3. See details below. |
The RunPRMD function implement a Multi-Stage Phase I Dose–Finding
Design to recommend dosage selection based on the data collected in the
available patient cohorts. The function will automatically identify the
model and the stage based on all flags and the records. For the details
of argument tox.target
, p_tox1
, p_tox2
, thrd1
,
thrd2
and ICD_thrd
, please check the help document of
SimPRMD
.
patlist |
The input data |
doseA |
The recommended dose level for cycle 1 for new cohorts |
pat_rec |
The recommended dose for current patients for next cycle |
effcy.flag |
The input argument |
doses |
The
input argument |
cycles |
The input argument
|
data("patlist_sim") # check the whole dataset by function patlist.display patlist.display(patlist_sim, n.dose = 6, n.cycle = 6) # When we pick the records before 6th cohort enrolled in the study L <- length(patlist_sim$PatID) patlist <- lapply(patlist_sim, function(a){a <- a[-(44:L)]}) patlist.display(patlist, n.dose = 6, n.cycle = 6) #The table shows the current patient in the trial. Now record the active #patient ID and records as follows patID_act <- c("cohort1subject1", "cohort1subject2", "cohort1subject3", "cohort2subject1", "cohort2subject2", "cohort2subject3", "cohort3subject2", "cohort3subject3", "cohort4subject1", "cohort4subject2", "cohort4subject3", "cohort5subject1", "cohort5subject2", "cohort5subject3") cycle_act <- c(5, 5, 5, 4, 4, 4, 3, 3, 2, 2, 2, 1, 1 ,1) dose_act <- c(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4) dlt_act <- c(0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0) test <- RunPRMD(patlist = patlist, patID_act = patID_act, cycle_act = cycle_act, dose_act = dose_act, dlt_act = dlt_act, trialSize = 36, chSize = 3, effcy.flag = TRUE, ICD.flag = TRUE, DLT.drop.flag = TRUE, IED.flag = TRUE, ICD_thrd = 0.3) summary(test) plot(test) plot(test, select_cycle = 1:2)
data("patlist_sim") # check the whole dataset by function patlist.display patlist.display(patlist_sim, n.dose = 6, n.cycle = 6) # When we pick the records before 6th cohort enrolled in the study L <- length(patlist_sim$PatID) patlist <- lapply(patlist_sim, function(a){a <- a[-(44:L)]}) patlist.display(patlist, n.dose = 6, n.cycle = 6) #The table shows the current patient in the trial. Now record the active #patient ID and records as follows patID_act <- c("cohort1subject1", "cohort1subject2", "cohort1subject3", "cohort2subject1", "cohort2subject2", "cohort2subject3", "cohort3subject2", "cohort3subject3", "cohort4subject1", "cohort4subject2", "cohort4subject3", "cohort5subject1", "cohort5subject2", "cohort5subject3") cycle_act <- c(5, 5, 5, 4, 4, 4, 3, 3, 2, 2, 2, 1, 1 ,1) dose_act <- c(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4) dlt_act <- c(0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0) test <- RunPRMD(patlist = patlist, patID_act = patID_act, cycle_act = cycle_act, dose_act = dose_act, dlt_act = dlt_act, trialSize = 36, chSize = 3, effcy.flag = TRUE, ICD.flag = TRUE, DLT.drop.flag = TRUE, IED.flag = TRUE, ICD_thrd = 0.3) summary(test) plot(test) plot(test, select_cycle = 1:2)
A function to implement simulations for a multi-stage phase 1 dose-finding design incorporating a longitudinal continuous efficacy outcome and toxicity data from multiple treatment cycles. The available models include 1-stage model with/without individualized dose modification, 3-stage model with/without individualized dose modification, 3-stage model with individualized dose modification on stage II and 3-stage model with individualized dose modification on stage I and dose modification on stage II.
SimPRMD( seed = 1234, numTrials = 100, doses = 1:6, cycles = 1:6, eff.structure = matrix(0, nrow = 6, ncol = 6), eff.Sigma = diag(6), eff.sd_trans = 1.5, tox.target = 0.28, p_tox1 = 0.2, p_tox2 = 0.2, trialSize = 36, chSize = 3, thrd1 = 0.28, thrd2 = 0.28, proxy.thrd = 0.1, tox.matrix = NULL, wm = matrix(c(0, 0.5, 0.75, 1, 1.5, 0, 0.5, 0.75, 1, 1.5, 0, 0, 0, 0.5, 1), byrow = T, ncol = 5), toxmax = 2.5, toxtype = NULL, intercept.alpha = NULL, coef.beta = NULL, cycle.gamma = NULL, param.ctrl = list(), n.iters = 10000, burn.in = 5000, thin = 2, n.chains = 1, effcy.flag = T, ICD.flag = T, DLT.drop.flag = T, testedD = T, IED.flag = T, ICD_thrd = 0.3 )
SimPRMD( seed = 1234, numTrials = 100, doses = 1:6, cycles = 1:6, eff.structure = matrix(0, nrow = 6, ncol = 6), eff.Sigma = diag(6), eff.sd_trans = 1.5, tox.target = 0.28, p_tox1 = 0.2, p_tox2 = 0.2, trialSize = 36, chSize = 3, thrd1 = 0.28, thrd2 = 0.28, proxy.thrd = 0.1, tox.matrix = NULL, wm = matrix(c(0, 0.5, 0.75, 1, 1.5, 0, 0.5, 0.75, 1, 1.5, 0, 0, 0, 0.5, 1), byrow = T, ncol = 5), toxmax = 2.5, toxtype = NULL, intercept.alpha = NULL, coef.beta = NULL, cycle.gamma = NULL, param.ctrl = list(), n.iters = 10000, burn.in = 5000, thin = 2, n.chains = 1, effcy.flag = T, ICD.flag = T, DLT.drop.flag = T, testedD = T, IED.flag = T, ICD_thrd = 0.3 )
seed |
The seed of R's random number generator. Default is 1234 |
numTrials |
An integer specifying the number of simulations |
doses |
A vector of doses that users are going to explore. Default is 1:6, where dose 1 through dose 6 are being tested. |
cycles |
A vector of cycles that the treatment plans to go through. Default is 1:6, where patients will experience up to 6 cycles of the treatment |
eff.structure |
A matrix provides the mean of the multivariate
Gaussian distribution in efficacy data generation. Specifically, the
|
eff.Sigma |
The covariance matrix of the multivariate Guassian distribution in efficacy data generation. See details below. |
eff.sd_trans |
A positive number controls the skewness of the distribution of the efficacy response. Default is 1.5. See details below. |
tox.target |
The target toxicity of the treatment. Default is 0.28. See details below. |
p_tox1 |
The probability cutoff for cycle 1 toxicity. Default is 0.2. See details below. |
p_tox2 |
The probability cutoff for later cycles toxicity beyond cycle 1. Default is 0.2. See Details below. |
trialSize |
The maximum sample size for trial simulation. Default is 36. Must be the multiple of cohort size, represented by chSize |
chSize |
The cohort size of patients recruited. Default is 3. |
thrd1 |
An upper bound of toxicity for cycle 1 of the treatment. Default is 0.28. See Details below. |
thrd2 |
An upper bound of toxicity for late cycles of the treatment, beyond cycle 1. Default is 0.28. See Details below |
proxy.thrd |
A distance parameter to define efficacious doses. Any dose whose predicted efficacy is within proxy.thrd away from the largest one among the safe doses will be declared an efficacious dose. |
tox.matrix |
Optional. A four-dimension array specifying the probabilities of the occurrences of certain grades for certain types of toxicities, at each dose level and cycle under consideration. Dimension 1 refers to doses; dimension 2 corresponds to cycles of the treatment; dimension 3 regards the types of toxicities while dimension 4 relates to grades. If null, which is default choice, the arguments toxtype, intercept.alpha, coef.beta, cycle.gamma must be provided to simulate this array. |
wm |
Clinical weight matrix, where toxicity types define the rows while the toxicity grades define the columns. Usually solicited from physicians. |
toxmax |
The normalization constant used in computing nTTP score. For details, see Ezzalfani et al(2013). |
toxtype |
Only specified when tox.matrix is null. This argument, a character vector, specifies toxicity types considered in the trial. |
intercept.alpha |
Only specified when tox.matrix is null. A four element numeric vector specifying the intercepts for the cumulative probabilities of the occurrences of grades 0-4 of toxicities in proportional odds model. See Details below. |
coef.beta |
Only specified when tox.matrix is null. A n numeric vector specifying the slope for dose in proportional odds model for n types of toxicities. See Details below |
cycle.gamma |
Only specified when tox.matrix is null. A scalar controlling the cycle effect in simulation in proportional odds model. See Details below |
param.ctrl |
A list specifying the prior distribution for the parameters.
Default is non-informative priors. |
n.iters |
Total number of MCMC simulations. Default is 10,000. |
burn.in |
Number of burn=ins in the MCMC simulation. Default is 5,000. |
thin |
Thinning parameter. Default is 2. |
n.chains |
No. of MCMC chains in Bayesian model fitting. Default is 1 |
effcy.flag |
Whether we include efficacy response in modeling or not? |
ICD.flag |
Whether we allow dose changing for cycle > 1 in stage 1 model or not? Default is TRUE. See details below |
DLT.drop.flag |
Whether the patients should suspend the treatment when observing DLT. Default is TRUE |
testedD |
Default is TRUE. Whether we only allow ICD or IED among cycle 1 tested dose level |
IED.flag |
Default is TRUE. Whether we allow dose changing for cycle > 1 in stage 2 model or not? |
ICD_thrd |
The cut-off point of the posterior toxicity probability in defining ICD. Default is 0.3. See details below. |
The user can simulation efficacy response with different
dose-efficacy and cycle-efficacy pattern using argument
eff.structure
, eff.Sigma
and eff.sd_trans
. The
sampling process of efficacy response start from generating sample from multivariate Gaussian distribution
, where and
are specified by
eff.structure
and eff.Sigma
, respectively. Define
be the density of
with CDF
,
and
is set by
eff.sd_trans
. Then the efficacy
response is calculated by taking the CDF of :
is the generated efficacy
response. Notice here the variance parameter
controls the variance of the generated efficacy.
The user can simulate longitudinal efficacy response with
different dose-efficacy and cycle-efficacy pattern using argument
eff.structure
, eff.Sigma
and eff.sd_trans
. The
sampling process of efficacy response starts from generating from multivariate Gaussian distribution
, where and
are specified by
eff.structure
and eff.Sigma
, respectively. Define
be the density of
with CDF
,
where
is set by
eff.sd_trans
. Then the efficacy
measure is generated by taking the CDF of :
. Notice here the variance
parameter controls the variance of the generated
efficacy.
p_tox1
, p_tox2
, thrd1
and thrd2
are used to
define allowable (safe) doses the probability conditions for cycle 1:
and for cycle > 1:
, where and
denote the posterior
estimate of nTTP for cycle 1 and the average of cycle > 1. When we
implement model with individualized dose modification, we only check the
condition for cycle 1 for defining allowable (safe) doses.
ICD_thrd
are used to find ICD. ICD is defined as the maximum dose
which satisfy the condition
,
where is the individualized posterior predicted nTTP score.
The individualized dose modification for next cycle will not escalate
more than 1 dose from the current dose.
senerio_sum |
contains |
eff_sum |
When
|
list_simul |
A list of length
numTrials. Each element includes |
chSize |
The input argument |
sim.time |
Time cost in simulation |
doses |
The input argument
|
cycles |
The input argument |
effcy.flag |
The input argument |
proxy.thrd |
The input argument |
DLT.drop.flag |
The input argument |
data("prob") # load prob.RData from package phaseI, Details see "?prob" data("eff") # load eff.RData from package phaseI. Details see "?eff" eff.structure = eff$Dose_Cycle_Meff[2, 2, , ] eff.Sigma = eff$Sigma eff.sd_trans = eff$sd_trans wm <- matrix(c(0, 0.5, 0.75, 1, 1.5, 0, 0.5, 0.75, 1, 1.5, 0, 0, 0, 0.5, 1), byrow = TRUE, ncol = 5) # weighted matrix for toxicity matrix # nrow = No.of type; ncol = No. of grade toxmax <- 2.5 tox.matrix <- prob["MTD4", "flat", , , , ] #------- a flat dose-toxicity, dose-efficacy, cycle-efficacy pattern------# simul1 <- SimPRMD(numTrials = 1, tox.matrix = tox.matrix, eff.structure = eff.structure, eff.Sigma = eff.Sigma, eff.sd_trans = eff.sd_trans, wm = wm, toxmax = toxmax, trialSize = 36) #------- a flat dose-toxicity pattern model ------# simul2 <- SimPRMD(numTrials = 1, toxtype = c("H", "L", "M"), intercept.alpha = c(1.9, 2.3, 2.6, 3.1), coef.beta = c(-0.3, -0.2, -0.25), cycle.gamma = 0, tox.target = 0.23, thrd1 = 0.23, thrd2 = 0.23, p_tox1 = 0.2, p_tox2 = 0.2, ICD.flag = FALSE, IED.flag = FALSE, effcy.flag = TRUE) summary(simul2) plot(simul2)
data("prob") # load prob.RData from package phaseI, Details see "?prob" data("eff") # load eff.RData from package phaseI. Details see "?eff" eff.structure = eff$Dose_Cycle_Meff[2, 2, , ] eff.Sigma = eff$Sigma eff.sd_trans = eff$sd_trans wm <- matrix(c(0, 0.5, 0.75, 1, 1.5, 0, 0.5, 0.75, 1, 1.5, 0, 0, 0, 0.5, 1), byrow = TRUE, ncol = 5) # weighted matrix for toxicity matrix # nrow = No.of type; ncol = No. of grade toxmax <- 2.5 tox.matrix <- prob["MTD4", "flat", , , , ] #------- a flat dose-toxicity, dose-efficacy, cycle-efficacy pattern------# simul1 <- SimPRMD(numTrials = 1, tox.matrix = tox.matrix, eff.structure = eff.structure, eff.Sigma = eff.Sigma, eff.sd_trans = eff.sd_trans, wm = wm, toxmax = toxmax, trialSize = 36) #------- a flat dose-toxicity pattern model ------# simul2 <- SimPRMD(numTrials = 1, toxtype = c("H", "L", "M"), intercept.alpha = c(1.9, 2.3, 2.6, 3.1), coef.beta = c(-0.3, -0.2, -0.25), cycle.gamma = 0, tox.target = 0.23, thrd1 = 0.23, thrd2 = 0.23, p_tox1 = 0.2, p_tox2 = 0.2, ICD.flag = FALSE, IED.flag = FALSE, effcy.flag = TRUE) summary(simul2) plot(simul2)
Summary a RunPRMD object. Print the information of recommended dosage
selection along with the mean nTTP and the number of DLT for all doses and
cycles. Will print the mean efficacy for all doses and cycles when
implementing RunPRMD
with option effcy.flag = TRUE
. The
collected data is displayed in a human-readable table whose cell contain 3
values including observed nTTP, DLT, and dose assignment. The higher the
dose, the warmer the cell background color is. The black color of the
records indicates DLT equals 1.
## S3 method for class 'RunPRMD' summary(object, ...)
## S3 method for class 'RunPRMD' summary(object, ...)
object |
RunPRMD object to summarise |
... |
other arguments ignored (for compatibility with generic) |
object |
The output of function |
mnttp.M |
The mean nTTP for all doses and cycles |
dlt.count.M |
The number of DLT for all doses and cycles |
eff.M |
The mean efficacy for all doses and cycles. Return
|
## Check ?RunPRMD for example
## Check ?RunPRMD for example
Summary a SimPRMD object
## S3 method for class 'SimPRMD' summary(object, ...)
## S3 method for class 'SimPRMD' summary(object, ...)
object |
SimPRMD object to summarise |
... |
other arguments ignored (for compatibility with generic) |
senerio_sum |
Output |
eff_sum |
Output |
n.trial |
The number of trials in the simulation |
alloc.perc |
The dose allocation percentage for cycle1 |
n.stop |
The number of early stop cases |
m.n.pat |
The average number of patient in each trial |
m.dlt.rt |
dlt rate |
c1_dlt.rt |
Cycle 1 dlt rate |
cs_dlt.rt |
Subsequent cycle (cycle > 1) dlt rate |
alloc.perc |
Dose allocation of cycle 1 |
sbsq.alloc |
Dose allocation of subsequent cycles (cycle > 1) |
rec.prec |
The percentage of Recommended doses for cycle 1 |
effcy.flag |
Argument |
DLT.drop.flag |
Argument |
## Check ?SimPRMD for example
## Check ?SimPRMD for example