Package 'phase1PRMD'

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

Help Index


Efficacy response generation parameters

Description

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.

Usage

eff

Format

An object of class list of length 4.

Value

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$Dose_Cycle_Meff, eff$Sigma, and eff$sd_trans


Suggest the input eff.structure of function SimPRMD with selected eff.sd_tran

Description

Suggest the input eff.structure of function SimPRMD with selected eff.sd_tran for given efficacy mean matrix and efficacy standard deviation

Usage

eff_suggest(eff.M, eff.sd, eff.sd_trans, n.sim = 30000)

Arguments

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 eff.sd_trans.

n.sim

The number of simulations for the numerical calculation in the function. The default is 30,000

Value

eff.suggest

The matrix suggested for the input eff.structure of function SimPRMD

Examples

# 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

Compute the summary statistics of efficacy measure with specified parameters.

Description

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.

Usage

eff_summary(
  eff.structure,
  eff.Sigma,
  eff.sd_trans,
  n.sim = 3e+05,
  seed = 123,
  plot.flag = F,
  plot.title = T
)

Arguments

eff.structure

A matrix providing the mean of the multivariate Gaussian distribution in efficacy data generation. Specifically, the (i,j)(i, j)th element represents the mean value of iith dose and jjth cycle of the Gaussian distribution for efficacy data generation.

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

Details

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,,zdz = {z1, \ldots, zd} from multivariate Gaussian distribution

z MVN(μ,V)z ~ MVN(\mu, V)

, where μ\mu and VV are specified by eff.structure and eff.Sigma, respectively. Define ϕ\phi be the density of N(0,σ2)N(0, \sigma^2) with CDF Φ\Phi, where σ2\sigma^2 is set by eff.sd_trans. Then the efficacy measure is generated by taking the CDF of zz:

x=x1,,xd=Φ(z)=Φ(z1),,Φ(zd)x={x1, \ldots, xd} = \Phi(z) = { \Phi(z1), \ldots, \Phi(zd)}

. Notice here the variance parameter σtrans2\sigma^2_{trans} controls the variance of the generated efficacy.

Value

eff.M

A matrix recording the efficacy mean whose (i,j)(i, j)th element represents the efficacy mean of iith dose level and jjth cycle

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

Examples

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)

Generate the mean nTTP score and the probability of observing DLT for all doses and cycles

Description

nTTP_summary generates the mean nTTP score and the probability of observing DLT for all doses and cycles

Usage

nTTP_summary(Tox.prob.M, nTTP.all, wm)

Arguments

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 GenToxProb in package phase1RMD. See more details about how to generate toxicity probability matrices in the help document of GenToxProb.

nTTP.all

The output of nTTP.array

wm

(numerical matrix) Toxicity weighted matrix, with row be the type of the toxicity and column be the toxicity grade

Value

mnTTP.M

matrix of mean nTTP for all doses and cycles

pDLT.M

matrix of probability of observing DLT for all doses and cycles

Examples

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)

Generate the nTTP dictionary

Description

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.

Usage

nTTP.array(wm, toxmax)

Arguments

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

Value

An m dimensional array with dimension (n,n,,n)(n, n, \ldots, n). The (d1,d2,,dm),di,i=1,m(1,,n)(d1, d2 ,\ldots,dm), {di, i = 1\ldots, m} \in (1, \ldots, n)th element is the nTTP when the grade of iith type of toxicity has didith toxicity grade.

Examples

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)

A list of patient information

Description

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.

Usage

patlist_sim

Format

An object of class list of length 6.

Value

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

Description

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.

Usage

patlist.display(patlist, n.dose, n.cycle)

Arguments

patlist

A list of the patient treatment records, which must contains the following variables:

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 level assigned for each patient through the whole treatment

cycle

shows the treatment cycle information of each record

nTTP

records the corresponding nTTP score.

dlt

indicates whether a DLT event is observed or not?

n.dose

The number of dose in the study

n.cycle

The number of cycle in the study


Plot nTTP and efficacy boxplots of a RunPRMD object

Description

Plot nTTP boxplots of a RunPRMD object. Plot efficacy boxplots when implementing RunPRMD with option effcy.flag == TRUE.

Usage

## S3 method for class 'RunPRMD'
plot(x, ..., select_cycle = x$cycles)

Arguments

x

RunPRMD object to summarise

...

other arguments ignored (for compatibility with generic)

select_cycle

A vector indication the cycle in the boxplot. Default is cycle of x.

Examples

## Check ?RunPRMD for example

Plots of a SimPRMD object

Description

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.

Usage

## S3 method for class 'SimPRMD'
plot(x, ..., title.add = TRUE)

Arguments

x

SimPRMD object to summarise

...

other arguments ignored (for compatibility with generic)

title.add

controls whether there is a title on plots or not.

Examples

## Check ?SimPRMD for example

Displays a useful description of a summary.RunPRMD object

Description

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.

Usage

## S3 method for class 'summary.RunPRMD'
print(x, ...)

Arguments

x

summary.RunPRMD object to summarise

...

other arguments ignored (for compatibility with generic)


Displays a useful description of a summary.SimPRMD object

Description

Displays a useful description of a summary.SimPRMD object

Usage

## S3 method for class 'summary.SimPRMD'
print(x, ...)

Arguments

x

summary.SimPRMD object to summarise

...

other arguments ignored (for compatibility with generic)


Toxicity probability matrix

Description

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.

Usage

prob

Format

An object of class array of dimension 4 x 3 x 6 x 6 x 3 x 5.


Implement a Multi-Stage Phase I Dose-Finding Design to recommend dosage selection based on the data collected in the available patient cohorts

Description

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.

Usage

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
)

Arguments

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:

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 level assigned for each patient through the whole treatment

cycle

shows the treatment cycle information of each record

nTTP

records the corresponding nTTP score.

dlt

indicates whether a DLT event is observed or not?

efficacy

provides the continuous efficacy for each cycle. Required when effcy.flag == T. The range of efficacy is (0, 1), use -1 for missing efficacy response.

See patlist_sim for an example.

patID_act

A vector recording the patients' ID who need dose recommendation for next cycle. Default is NULL

cycle_act

A vector recording the current cycle of patID_act. Default is NULL

dose_act

A vector recording the current dose level of patID_act. Default is NULL

dlt_act

A vector indicating whether a dlt is observed in current cycle for current patients. Default is NULL

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).

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.

p1_beta_intercept

the prior mean of intercept of toxicity model assuming a normal prior

p2_beta_intercept

the precision (inverse of variance) of intercept of toxicity model assuming a normal prior

p1_beta_cycle

the prior mean of cycle effect of toxicity model assuming a normal prior

p2_beta_cycle

the precision (inverse of variance) of cycle effect of toxicity model assuming a normal prior

p1_beta_dose

the prior minimum of dose effect of toxicity model assuming a uniform prior

p2_beta_dose

the prior maximum of dose effect of toxicity model assuming a uniform prior

p1_alpha

the prior mean vector of the parameters from efficacy model assuming a multivariate normal prior

p2_alpha

the prior precision matrix (inverse of covariance matrix) of the parameters from efficacy model assuming a multivariate normal prior

p1_gamma0

the prior mean of association parameter γ\gamma (See Du et al(2017)) of two submodels of the joint model assuming a normal prior

p2_gamma0

the prior precision (inverse of variance) of association parameter γ\gamma of two submodels of the joint model assuming a normal prior.

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 n.chains > 1.

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.

Details

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.

Value

patlist

The input data patlist

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 effcy.flag

doses

The input argument doses

cycles

The input argument cycles

Examples

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)

Simulation for a Multi-Stage Phase I Dose-Finding Design

Description

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.

Usage

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
)

Arguments

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 (i,j)(i, j)th element represents the mean value of iith dose level and jjth cycle of the Gaussian distribution for efficacy data generation. Default is a 6 by 6 zero matrix

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.

p1_beta_intercept

the prior mean of intercept of toxicity model assuming a normal prior

p2_beta_intercept

the precision (inverse of variance) of intercept of toxicity model assuming a normal prior

p1_beta_cycle

the prior mean of cycle effect of toxicity model assuming a normal prior

p2_beta_cycle

the precision (inverse of variance) of cycle effect of toxicity model assuming a normal prior

p1_beta_dose

the prior minimum of dose effect of toxicity model assuming a uniform prior

p2_beta_dose

the prior maximum of dose effect of toxicity model assuming a uniform prior

p1_alpha

the prior mean vector of the parameters from efficacy model assuming a multivariate normal prior

p2_alpha

the prior precision matrix (inverse of covariance matrix) of the parameters from efficacy model assuming a multivariate normal prior

p1_gamma0

the prior mean of association parameter γ\gamma (See Du et al(2017)) of two submodels of the joint model assuming a normal prior

p2_gamma0

the prior precision (inverse of variance) of association parameter γ\gamma of two submodels of the joint model assuming a normal prior.

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.

Details

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,,zdz = {z1, \ldots, zd} from multivariate Gaussian distribution

z MVN(μ,V)z ~ MVN(\mu, V)

, where μ\mu and VV are specified by eff.structure and eff.Sigma, respectively. Define ϕ\phi be the density of N(0,σ2)N(0, \sigma^2) with CDF Φ\Phi, and σ2\sigma^2 is set by eff.sd_trans. Then the efficacy response is calculated by taking the CDF of zz:

x=x1,,xd=Φ(z)=Φ(z1),,Φ(zd)x={x1, \ldots, xd} = \Phi(z) = { \Phi(z1), \ldots, \Phi(zd)}

is the generated efficacy response. Notice here the variance parameter σtrans2\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,,zdz = {z1, \ldots, zd} from multivariate Gaussian distribution

z MVN(μ,V)z ~ MVN(\mu, V)

, where μ\mu and VV are specified by eff.structure and eff.Sigma, respectively. Define ϕ\phi be the density of N(0,σ2)N(0, \sigma^2) with CDF Φ\Phi, where σ2\sigma^2 is set by eff.sd_trans. Then the efficacy measure is generated by taking the CDF of zz:

x=x1,,xd=Φ(z)=Φ(z1),,Φ(zd)x={x1, \ldots, xd} = \Phi(z) = { \Phi(z1), \ldots, \Phi(zd)}

. Notice here the variance parameter σtrans2\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)>ptox1P(nTTP1 < thrd1) > p_tox1

and for cycle > 1:

p(nTTP2<thrd2)>ptox2p(nTTP2 < thrd2) > p_tox2

, where nTTP1nTTP1 and nTTP2nTTP2 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)>ICDthrdP(nTTPi < target.tox) > ICD_thrd

, where nTTPinTTPi 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.

Value

senerio_sum

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

eff_sum

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

list_simul

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.

chSize

The input argument chSize

sim.time

Time cost in simulation

doses

The input argument doese

cycles

The input argument cycles

effcy.flag

The input argument effcy.flag

proxy.thrd

The input argument proxy.thrd

DLT.drop.flag

The input argument DLT.drop.flag

Examples

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

Description

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.

Usage

## S3 method for class 'RunPRMD'
summary(object, ...)

Arguments

object

RunPRMD object to summarise

...

other arguments ignored (for compatibility with generic)

Value

object

The output of function RunPRMD

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 NULL when object$effcy.flag == TRUE

Examples

## Check ?RunPRMD for example

Summary a SimPRMD object

Description

Summary a SimPRMD object

Usage

## S3 method for class 'SimPRMD'
summary(object, ...)

Arguments

object

SimPRMD object to summarise

...

other arguments ignored (for compatibility with generic)

Value

senerio_sum

Output senerio_sum of function SimPRMD

eff_sum

Output eff_sum of function SimPRMD

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 effcy.flag of function SimPRMD

DLT.drop.flag

Argument DLT.drop.flag of function SimPRMD

Examples

## Check ?SimPRMD for example