efficacy: Computing Expected Efficacy for a Given Dose, Model and...

efficacyR Documentation

Computing Expected Efficacy for a Given Dose, Model and Samples

Description

[Stable]

A function that computes the value of expected efficacy at a specified dose level, based on the model specific parameters. The model parameters (samples) are obtained based on prior specified in form of pseudo data combined with observed responses (if any).

Usage

efficacy(dose, model, samples, ...)

## S4 method for signature 'numeric,Effloglog,Samples'
efficacy(dose, model, samples)

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

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

Arguments

dose

(numeric)
the dose which is targeted. 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, dose must have the same size as the sample.

model

(ModelEff)
the efficacy model with pseudo data prior.

samples

(Samples)
samples of model's parameters that will be used to compute expected efficacy values. Can also be missing for some models.

...

model specific parameters when samples are not used.

Details

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

Value

A numeric vector with the values of expected efficacy. 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.

Functions

  • efficacy(dose = numeric, model = Effloglog, samples = Samples): compute the expected efficacy at a specified dose level, based on the samples of Effloglog model parameters.

  • efficacy(dose = numeric, model = Effloglog, samples = missing): compute the expected efficacy at a specified dose level, based on the Effloglog model parameters. All model parameters (except dose) should be present in the model object.

  • efficacy(dose = numeric, model = EffFlexi, samples = Samples): compute the expected efficacy at a specified dose level, based on the samples of EffFlexi model parameters. If a given dose in the dose vector is from outside of the dose grid range, the NA_real is returned for this dose and the warning is thrown.

See Also

dose(), prob().

Examples

# Obtain the expected efficacy value for a given dose, a given pseudo efficacy
# model (in flexible form for prior) and efficacy samples.

# Empty data (i.e. no observed data), dose grid only.
my_data <- DataDual(doseGrid = seq(25, 300, 25))

my_model <- EffFlexi(
  eff = c(1.223, 2.513),
  eff_dose = c(25, 300),
  sigma2W = c(a = 0.1, b = 0.1),
  sigma2betaW = c(a = 20, b = 50),
  rw1 = FALSE,
  data = my_data
)

my_options <- McmcOptions(
  burnin = 100, step = 2, samples = 200, rng_kind = "Mersenne-Twister", rng_seed = 94
)

my_samples <- mcmc(data = my_data, model = my_model, options = my_options)

# Efficacy for dose 75.
efficacy(dose = 75, model = my_model, samples = my_samples)

# Obtain the expected efficacy value for a given dose, a given pseudo efficacy
# model (linear log-log efficacy) and no samples.
my_model_ll <- Effloglog(
  eff = c(1.223, 2.513),
  eff_dose = c(25, 300),
  nu = c(a = 1, b = 0.025),
  data = my_data,
  const = 0
)

efficacy(dose = 75, model = my_model_ll)

Roche/crmPack documentation built on April 30, 2024, 3:19 p.m.