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
)The seed of R's random number generator. Default is 1234
An integer specifying the number of simulations
A vector of doses that users are going to explore. Default is 1:6, where dose 1 through dose 6 are being tested.
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
A matrix provides the mean of the multivariate Gaussian distribution in efficacy data generation. Specifically, the \((i, j)\)th element represents the mean value of \(i\)th dose level and \(j\)th cycle of the Gaussian distribution for efficacy data generation. Default is a 6 by 6 zero matrix
The covariance matrix of the multivariate Guassian distribution in efficacy data generation. See details below.
A positive number controls the skewness of the distribution of the efficacy response. Default is 1.5. See details below.
The target toxicity of the treatment. Default is 0.28. See details below.
The probability cutoff for cycle 1 toxicity. Default is 0.2. See details below.
The probability cutoff for later cycles toxicity beyond cycle 1. Default is 0.2. See Details below.
The maximum sample size for trial simulation. Default is 36. Must be the multiple of cohort size, represented by chSize
The cohort size of patients recruited. Default is 3.
An upper bound of toxicity for cycle 1 of the treatment. Default is 0.28. See Details below.
An upper bound of toxicity for late cycles of the treatment, beyond cycle 1. Default is 0.28. See Details below
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.
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.
Clinical weight matrix, where toxicity types define the rows while the toxicity grades define the columns. Usually solicited from physicians.
The normalization constant used in computing nTTP score. For details, see Ezzalfani et al(2013).
Only specified when tox.matrix is null. This argument, a character vector, specifies toxicity types considered in the trial.
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.
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
Only specified when tox.matrix is null. A scalar controlling the cycle effect in simulation in proportional odds model. See Details below
A list specifying the prior distribution for the parameters.
the precision (inverse of variance) of intercept of toxicity model assuming a normal prior
the prior mean of cycle effect of toxicity model assuming a normal prior
the precision (inverse of variance) of cycle effect of toxicity model assuming a normal prior
the prior minimum of dose effect of toxicity model assuming a uniform prior
the prior maximum of dose effect of toxicity model assuming a uniform prior
the prior mean vector of the parameters from efficacy model assuming a multivariate normal prior
the prior precision matrix (inverse of covariance matrix) of the parameters from efficacy model assuming a multivariate normal prior
the prior mean of association parameter \(\gamma\) (See Du et al(2017)) of two submodels of the joint model assuming a normal prior
the prior precision (inverse of variance) of association parameter \(\gamma\) of two submodels of the joint model assuming a normal prior.
Total number of MCMC simulations. Default is 10,000.
Number of burn=ins in the MCMC simulation. Default is 5,000.
Thinning parameter. Default is 2.
No. of MCMC chains in Bayesian model fitting. Default is 1
Whether we include efficacy response in modeling or not?
Whether we allow dose changing for cycle > 1 in stage 1 model or not? Default is TRUE. See details below
Whether the patients should suspend the treatment when observing DLT. Default is TRUE
Default is TRUE. Whether we only allow ICD or IED among cycle 1 tested dose level
Default is TRUE. Whether we allow dose changing for cycle > 1 in stage 2 model or not?
The cut-off point of the posterior toxicity probability in defining ICD. Default is 0.3. See details below.
contains mnTTP.M the matrix of mean nTTP
for each dose and cycle and pDLT.M matrix of probability of
observing DLT for each dose and cycle
When
effcy.flag == TRUE, contains eff.M the mean efficacy for
each dose and cycle and err.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
A list of length
numTrials. Each element includes patlist which records all the
treatment and outcome information; dose_aloca which shows the
cycle 1 dose allocation; doseA which saves the recommended dose
level for cycle 1 at the end of the phase I simulation, equals "early
break" if the trial was stop before finishing the trial; n.cohort
indicates the last cohort in the trial; pp.nTTPM gives the
posterior probability of nTTP less than target toxicity tox.target
for all dose level any cycles and message saves the message of
each trial.
The input argument chSize
Time cost in simulation
The input argument
doese
The input argument cycles
The input argument effcy.flag
The input argument proxy.thrd
The input argument DLT.drop.flag
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 \(z
= {z1, \ldots, zd} \) from multivariate Gaussian distribution $$z ~
MVN(\mu, V)$$, where \(\mu\) and \(V\) are specified by
eff.structure and eff.Sigma, respectively. Define
\(\phi\) be the density of \(N(0, \sigma^2)\) with CDF \(\Phi\),
and \(\sigma^2\) is set by eff.sd_trans. Then the efficacy
response is calculated by taking the CDF of \(z\): $$x={x1, \ldots,
xd} = \Phi(z) = { \Phi(z1), \ldots, \Phi(zd)}$$ is the generated efficacy
response. Notice here the variance parameter \(\sigma^2_{trans}\)
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 \(z =
{z1, \ldots, zd} \) from multivariate Gaussian distribution $$z ~
MVN(\mu, V)$$, where \(\mu\) and \(V\) are specified by
eff.structure and eff.Sigma, respectively. Define
\(\phi\) be the density of \(N(0, \sigma^2)\) with CDF \(\Phi\),
where \(\sigma^2\) is set by eff.sd_trans. Then the efficacy
measure is generated by taking the CDF of \(z\): $$x={x1, \ldots,
xd} = \Phi(z) = { \Phi(z1), \ldots, \Phi(zd)}$$. Notice here the variance
parameter \(\sigma^2_{trans}\) 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:
$$P(nTTP1 < thrd1) > p_tox1$$ and for cycle > 1: $$p(nTTP2 <
thrd2) > p_tox2$$ , where \(nTTP1\) and \(nTTP2\) 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 $$P(nTTPi < target.tox) > ICD_thrd$$ ,
where \(nTTPi\) 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.
# NOT RUN {
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------#
# }
# NOT RUN {
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)
# }
# NOT RUN {
#------- a flat dose-toxicity pattern model ------#
# }
# NOT RUN {
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)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab