dose: Computing the Doses for a given independent variable, Model...

doseR Documentation

Computing the Doses for a given independent variable, Model and Samples

Description

[Stable]

A function that computes the dose reaching a specific target value of a given variable that dose depends on. The meaning of this variable depends on the type of the model. For instance, for single agent dose escalation model or pseudo DLE (dose-limiting events)/toxicity model, this variable represents the a probability of the occurrence of a DLE. For efficacy models, it represents expected efficacy. The doses are computed based on the samples of the model parameters (samples).

Usage

dose(x, model, samples, ...)

## S4 method for signature 'numeric,LogisticNormal,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticLogNormal,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticLogNormalOrdinal,Samples'
dose(x, model, samples, grade)

## S4 method for signature 'numeric,LogisticLogNormalSub,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,ProbitLogNormal,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,ProbitLogNormalRel,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticLogNormalGrouped,Samples'
dose(x, model, samples, group)

## S4 method for signature 'numeric,LogisticKadane,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticKadaneBetaGamma,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticNormalMixture,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticNormalFixedMixture,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticLogNormalMixture,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,DualEndpoint,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticIndepBeta,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,LogisticIndepBeta,missing'
dose(x, model)

## S4 method for signature 'numeric,Effloglog,missing'
dose(x, model)

## S4 method for signature 'numeric,EffFlexi,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,OneParLogNormalPrior,Samples'
dose(x, model, samples)

## S4 method for signature 'numeric,OneParExpPrior,Samples'
dose(x, model, samples)

Arguments

x

(proportion or numeric)
a value of an independent variable on which dose depends. The following recycling rule applies when samples is not missing: vectors of size 1 will be recycled to the size of the sample (i.e. size(samples)). Otherwise, x must have the same size as the sample.

model

(GeneralModel or ModelPseudo)
the model.

samples

(Samples)
the samples of model's parameters that will be used to compute the resulting doses. Can also be missing for some models.

...

model specific parameters when samples are not used.

grade

(integer)
The toxicity grade for which probabilities are required

group

(character or factor)
for LogisticLogNormalGrouped, indicating whether to calculate the dose for the mono or for the combo arm.

Details

The dose() function computes the doses corresponding to a value of a given independent variable, using samples of the model parameter(s). If you work with multivariate model parameters, then assume that your model specific dose() method receives a samples matrix where the rows correspond to the sampling index, i.e. the layout is then ā nSamples x dimParameterā .

Value

A number or numeric vector with the doses. 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 prob.

Functions

  • dose(x = numeric, model = LogisticNormal, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticLogNormal, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticLogNormalOrdinal, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

    In the case of a LogisticLogNormalOrdinal model, dose returns only the probability of toxicity at the given grade or higher

  • dose(x = numeric, model = LogisticLogNormalSub, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = ProbitLogNormal, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = ProbitLogNormalRel, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticLogNormalGrouped, samples = Samples): method for LogisticLogNormalGrouped which needs group argument in addition.

  • dose(x = numeric, model = LogisticKadane, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticKadaneBetaGamma, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticNormalMixture, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticNormalFixedMixture, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticLogNormalMixture, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = DualEndpoint, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticIndepBeta, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x).

  • dose(x = numeric, model = LogisticIndepBeta, samples = missing): compute the dose level reaching a specific target probability of the occurrence of a DLE (x). All model parameters (except x) should be present in the model object.

  • dose(x = numeric, model = Effloglog, samples = missing): compute the dose level reaching a specific target probability of the occurrence of a DLE (x). All model parameters (except x) should be present in the model object.

  • dose(x = numeric, model = EffFlexi, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLE (x). For this method x must be a scalar.

  • dose(x = numeric, model = OneParLogNormalPrior, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLT (x).

  • dose(x = numeric, model = OneParExpPrior, samples = Samples): compute the dose level reaching a specific target probability of the occurrence of a DLT (x).

Note

The dose() and prob() methods 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.

See Also

doseFunction(), prob(), efficacy().

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

# 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 the dose achieving Prob(DLT) = 0.45.
dose(x = 0.45, model = my_model, samples = my_samples)

# Create data from the 'Data' (or 'DataDual') class.
dlt_data <- Data(
  x = c(25, 50, 25, 50, 75, 300, 250, 150),
  y = c(0, 0, 0, 0, 0, 1, 1, 0),
  doseGrid = seq(from = 25, to = 300, by = 25)
)

# 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 = dlt_data
)

# Get samples from posterior.
dlt_sample <- mcmc(data = dlt_data, model = dlt_model, options = my_options)

# Posterior for the dose achieving Prob(DLT) = 0.45.
dose(x = 0.45, model = dlt_model, samples = dlt_sample)
dose(x = c(0.45, 0.6), model = dlt_model)
data_ordinal <- .DefaultDataOrdinal()
model <- .DefaultLogisticLogNormalOrdinal()
options <- .DefaultMcmcOptions()
samples <- mcmc(data_ordinal, model, options)

dose(0.25, model, samples, grade = 2L)

Roche/crmPack documentation built on April 15, 2024, 8:06 a.m.