
Computing Toxicity Probabilities for a Given Dose, Model and Samples
Source:R/Model-methods.R
prob.RdA function that computes the probability of the occurrence of a DLE at a specified dose level, based on the model parameters (samples).
Usage
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticNormal,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticLogNormal,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticLogNormalSub,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,ProbitLogNormal,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,ProbitLogNormalRel,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticLogNormalGrouped,Samples'
prob(dose, model, samples, group, ...)
# S4 method for class 'numeric,TwoDrugsCombo,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'matrix,TwoDrugsCombo,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticKadane,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticKadaneBetaGamma,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticNormalMixture,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticNormalFixedMixture,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticLogNormalMixture,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,DualEndpoint,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticIndepBeta,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticIndepBeta,missing'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,OneParLogNormalPrior,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,OneParExpPrior,Samples'
prob(dose, model, samples, ...)
# S4 method for class 'numeric,LogisticLogNormalOrdinal,Samples'
prob(dose, model, samples, grade, cumulative = TRUE, ...)Arguments
- dose
(
numberornumeric)
the dose which is targeted. The following recycling rule applies whensamplesis not missing: vectors of size 1 will be recycled to the size of the sample (i.e.size(samples)). Otherwise,dosemust have the same size as the sample.- model
(
GeneralModelorModelTox)
the model for single agent dose escalation or pseudo DLE (dose-limiting events)/toxicity model.- samples
(
Samples)
the samples of model's parameters that will be used to compute toxicity probabilities. Can also be missing for some models.- ...
model specific parameters when
samplesare not used.- group
(
characterorfactor)
forLogisticLogNormalGrouped, indicating whether to calculate the probability for themonoor for thecomboarm.- grade
(
integerorinteger_vector)
The toxicity grade for which probabilities are required- cumulative
(
flag)
Should the returned probability be cumulative (the default) or grade-specific?
Value
A proportion or numeric vector with the toxicity probabilities,
or a numeric matrix for methods that evaluate multiple dose combinations at
once. If non-scalar samples were used, then every element in the returned
vector corresponds to one element of a sample. Hence, in this case, the
output vector is of the same length as the sample vector. If scalar
samples were used or no samples were used, e.g. for pseudo
DLE/toxicity model, then the output is of the same length as the length
of the dose. For matrix-valued dose inputs, the returned matrix contains
one column per dose combination. In the case of LogisticLogNormalOrdinal,
the probabilities relate to toxicities of grade given by grade.
Details
The prob() function computes the probability of toxicity for given
doses, using samples of the model parameter(s).
If you work with multivariate model parameters, then assume that your model
specific prob() method receives a samples matrix where the rows
correspond to the sampling index, i.e. the layout is then
nSamples x dimParameter.
Functions
prob(dose = numeric, model = LogisticNormal, samples = Samples): Calculate toxicity probabilities for aLogisticNormalmodel.prob(dose = numeric, model = LogisticLogNormal, samples = Samples): Calculate toxicity probabilities for aLogisticLogNormalmodel.prob(dose = numeric, model = LogisticLogNormalSub, samples = Samples): Calculate toxicity probabilities for aLogisticLogNormalSubmodel.prob(dose = numeric, model = ProbitLogNormal, samples = Samples): Calculate toxicity probabilities for aProbitLogNormalmodel.prob(dose = numeric, model = ProbitLogNormalRel, samples = Samples): Calculate toxicity probabilities for aProbitLogNormalRelmodel.prob(dose = numeric, model = LogisticLogNormalGrouped, samples = Samples): method forLogisticLogNormalGroupedwhich needsgroupargument in addition.prob(dose = numeric, model = TwoDrugsCombo, samples = Samples): method forTwoDrugsCombofor a single dose combination provided as a named numeric vector.prob(dose = matrix, model = TwoDrugsCombo, samples = Samples): method forTwoDrugsCombofor one or more dose combinations provided in the rows of a numeric matrix.prob(dose = numeric, model = LogisticKadane, samples = Samples): Calculate toxicity probabilities for aLogisticKadanemodel.prob(dose = numeric, model = LogisticKadaneBetaGamma, samples = Samples): Calculate toxicity probabilities for aLogisticKadaneBetaGammamodel.prob(dose = numeric, model = LogisticNormalMixture, samples = Samples): Calculate toxicity probabilities for aLogisticNormalMixturemodel.prob(dose = numeric, model = LogisticNormalFixedMixture, samples = Samples): Calculate toxicity probabilities for aLogisticNormalFixedMixturemodel.prob(dose = numeric, model = LogisticLogNormalMixture, samples = Samples): Calculate toxicity probabilities for aLogisticLogNormalMixturemodel.prob(dose = numeric, model = DualEndpoint, samples = Samples): Calculate toxicity probabilities for aDualEndpointmodel.prob(dose = numeric, model = LogisticIndepBeta, samples = Samples): compute toxicity probabilities of the occurrence of a DLE at a specified dose level, based on the samples ofLogisticIndepBetamodel parameters.prob(dose = numeric, model = LogisticIndepBeta, samples = missing): compute toxicity probabilities of the occurrence of a DLE at a specified dose level, based on theLogisticIndepBetamodel parameters. All model parameters (exceptdose) should be present in themodelobject.prob(dose = numeric, model = OneParLogNormalPrior, samples = Samples): Calculate toxicity probabilities for aOneParLogNormalPriormodel.prob(dose = numeric, model = OneParExpPrior, samples = Samples): Calculate toxicity probabilities for aOneParExpPriormodel.prob(dose = numeric, model = LogisticLogNormalOrdinal, samples = Samples): Calculate grade-specific toxicity probabilities for aLogisticLogNormalOrdinalmodel.
Note
The prob() and dose() functions are the inverse of
each other, for all dose() methods for which its first argument, i.e. a
given independent variable that dose depends on, represents toxicity
probability.
Examples
# Create some data.
my_data <- Data(
x = c(0.1, 0.5, 1.5, 3, 6, 10, 10, 10),
y = c(0, 0, 0, 0, 0, 0, 1, 0),
cohort = c(0, 1, 2, 3, 4, 5, 5, 5),
doseGrid = c(0.1, 0.5, 1.5, 3, 6, seq(from = 10, to = 80, by = 2))
)
#> Used default patient IDs!
# Initialize a model, e.g. 'LogisticLogNormal'.
my_model <- LogisticLogNormal(
mean = c(-0.85, 1),
cov = matrix(c(1, -0.5, -0.5, 1), nrow = 2),
ref_dose = 56
)
# Get samples from posterior.
my_options <- McmcOptions(burnin = 100, step = 2, samples = 20)
my_samples <- mcmc(data = my_data, model = my_model, options = my_options)
# Posterior for Prob(DLT | dose = 50).
prob(dose = 50, model = my_model, samples = my_samples)
#> [1] 0.4665401 0.1890683 0.3162080 0.5727320 0.5727320 0.3431303 0.3431303
#> [8] 0.3431303 0.3711676 0.3711676 0.3711676 0.3251602 0.3251602 0.5028755
#> [15] 0.5028755 0.5835603 0.5835603 0.1981376 0.2479874 0.2574285
# Create data from the 'DataDual' class.
data_dual <- DataDual(
x = c(25, 50, 25, 50, 75, 300, 250, 150),
y = c(0, 0, 0, 0, 0, 1, 1, 0),
w = c(0.31, 0.42, 0.59, 0.45, 0.6, 0.7, 0.6, 0.52),
doseGrid = seq(from = 25, to = 300, by = 25)
)
#> Used default patient IDs!
#> Used best guess cohort indices!
# Initialize a toxicity model using 'LogisticIndepBeta' model.
dlt_model <- LogisticIndepBeta(
binDLE = c(1.05, 1.8),
DLEweights = c(3, 3),
DLEdose = c(25, 300),
data = data_dual
)
# Get samples from posterior.
dlt_sample <- mcmc(data = data_dual, model = dlt_model, options = my_options)
# Posterior for Prob(DLT | dose = 100).
prob(dose = 100, model = dlt_model, samples = dlt_sample)
#> [1] 0.3331095 0.3331095 0.3331095 0.3331095 0.3780942 0.3780942 0.4100337
#> [8] 0.4100337 0.4100337 0.4100337 0.4070378 0.4070378 0.4070378 0.4070378
#> [15] 0.4070378 0.4070378 0.4070378 0.5868325 0.6399562 0.1724915
prob(dose = c(50, 150), model = dlt_model)
#> [1] 0.1981823 0.4601234