generateData {BIGL}R Documentation

Generate data from parameters of marginal monotherapy model

Description

This function is used to generate data for bootstrapping of the null distribution for various estimates. Optional arguments such as specific choice of sampling vector or corrections for heteroskedasticity can be specified in the function arguments.

Usage

generateData(
  pars,
  sigma,
  data = NULL,
  transforms = NULL,
  null_model = c("loewe", "hsa", "bliss", "loewe2"),
  error = 1,
  sampling_errors = NULL,
  means = NULL,
  model = NULL,
  method = "equal",
  wild_bootstrap = FALSE,
  wild_bootType = "normal",
  rescaleResids,
  invTransFun,
  newtonRaphson = FALSE,
  bootmethod = method,
  ...
)

Arguments

pars

Coefficients of the marginal model along with their appropriate naming scheme. These will typically be estimated using fitMarginals. Futhermore, pars can simply be a MarginalFit object and transforms object will be automatically extracted.

sigma

Standard deviation to use for randomly generated error terms. This argument is unused if error = 4 so that sampling error vector is provided.

data

Data frame with dose columns ("d1", "d2") to generate the effect for. Only "d1" and "d2" columns of the dose-response dataframe should be passed to this argument. "effect" column should not be passed and if it is, the column will be replaced by simulated data.

transforms

Transformation functions. If non-null, transforms is a list containing 5 elements, namely biological and power transformations along with their inverse functions and compositeArgs which is a list with argument values shared across the 4 functions. See vignette for more information.

null_model

Specified null model for the expected response surface. Currently, allowed options are "loewe" for generalized Loewe model, "hsa" for Highest Single Agent model, "bliss" for Bliss additivity, and "loewe2" for the alternative Loewe generalization.

error

Type of error for resampling. error = 1 (Default) adds normal errors to the simulated effects, error = 2 adds errors sampled from a mixture of two normal distributions, error = 3 generates errors from a rescaled chi-square distribution. error = 4 will use bootstrap. Choosing this option, the error terms will be resampled from the vector specified in sampling_errors.

sampling_errors

Sampling vector to resample errors from. Used only if error = 4.

means

The vector of mean values of the response surface, for variance modelling

model

The mean-variance model

method

What assumption should be used for the variance of on- and off-axis points. This argument can take one of the values from c("equal", "model", "unequal"). With the value "equal" as the default. "equal" assumes that both on- and off-axis points have the same variance, "unequal" estimates a different parameter for on- and off-axis points and "model" predicts variance based on the average effect of an off-axis point. If no transformations are used the "model" method is recommended. If transformations are used, only the "equal" method can be chosen.

wild_bootstrap

Whether special bootstrap to correct for heteroskedasticity should be used. If wild_bootstrap = TRUE, errors are generated from sampling_errors multiplied by a random variable following Rademacher distribution. Argument is used only if error = 4.

wild_bootType

Type of distribution to be used for wild bootstrap. If wild_bootstrap = TRUE, errors are generated from "rademacher", "gamma", "normal" or "two-point" distribution.

rescaleResids

a boolean indicating whether to rescale residuals, or else normality of the residuals is assumed.

invTransFun

the inverse transformation function, back to the variance domain

newtonRaphson

A boolean, should Newton-Raphson be used to find Loewe response surfaces? May be faster but also less stable to switch on

bootmethod

The resampling method to be used in the bootstraps. Defaults to the same as method

...

Further arguments

Value

Dose-response dataframe with generated data including "effect" as well as "d1" and "d2" columns.

Examples

  coefs <- c("h1" = 1, "h2" = 1.5, "b" = 0,
             "m1" = 1, "m2" = 2, "e1" = 0.5, "e2" = 0.1)

  ## Dose levels are set to be integers from 0 to 10
  generateData(coefs, sigma = 1)

  ## Dose levels are taken from existing dataset with d1 and d2 columns
  data <- subset(directAntivirals, experiment == 1)
  generateData(data = data[, c("d1", "d2")], pars = coefs, sigma = 1)

[Package BIGL version 1.9.0 Index]