fitModel: Fit drug interaction index model according to Harbron's...

Description Usage Arguments Details Value Author(s) Examples

View source: R/fitModel.R

Description

This is the main function to fit an interaction index model to drug combination data based on the Loewe additivity model. The interaction index can be specified in a flexible way as a function of doses and other variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fitModel(
  data,
  mono = NULL,
  model = NULL,
  tauFormula = NULL,
  tauLog = FALSE,
  tauStart = 1 * (!tauLog),
  stage = 1,
  fixed = NULL,
  inactiveIn = 0,
  verbose = FALSE,
  ...
)

Arguments

data

A (long) data frame to fit the model to. Required columns are "d1", "d2" and "effect". Other variables are allowed and can be used in tauFormula.

mono

An optional "MarginalFit" object, obtained from fitMarginals.

model

A pre-defined model to use for the interaction index tau. One of "additive", "uniform", "linear1", "separate1", "linear2", "separate2", "separate12" or "zhao". See details.

tauFormula

A formula to define the interaction index tau, using either 'literal' (as in nls) or 'symbolic' (as in lm) specification.

tauLog

Whether to fit the model using log-transformed tau parameters. This is mostly useful for "separate"-type tau models for better convergence. Note that if TRUE, tau cannot be negative, which may be not approriate for some models, such as "linear1" and "linear2". Note that this affects the coefficient names in the result ("logtau1", "logtau2", ... instead of "tau1", "tau2", ...), so if fixed argument is used, this should be taken into account.

tauStart

Vector of starting values for tau parameters, either of length 1 or of the same length as the total number of tau parameters.

stage

Whether to run a 1-stage or 2-stage estimation.

fixed

Constraints on monotherapy and/or tau parameters as a vector of the form 'name = value', if NULL (default), taken from mono. Note that the tau parameters should be named "tau1", "tau2", ... if tauLog = FALSE (default), or "logtau1", "logtau2", ... if tauLog = TRUE.

inactiveIn

which compound is inactive (1 or 2), or 0 (default) when both compounds are active.

verbose

Whether to show extra information useful for debugging.

...

Further arguments passed to the nlsLM call. For example, trace = TRUE is useful to see the trace of the fitting process and may help identify issues with convergence.

Details

There are different ways to specify a model for the interaction index tau:

Value

Fitted object of class "HarbronFit" which is an nls-like object with extra elements.

Author(s)

Maxim Nazarov

Examples

1
2
3
4
5
6
7
data("checkerboardData", package = "drugCombo")
data1 <- checkerboardData[checkerboardData$exp == 1, ]
mono1 <- fitMarginals(data1, fixed = c(b = 1))
# all three ways below are equivalent
fitLin1 <- fitModel(data = data1, mono = mono1, model = "linear1")
fitLin1b <- fitModel(data1, mono1, tauFormula = ~ log10(d1))
fitLin1c <- fitModel(data1, mono1, tauFormula = ~ tau1+tau2*log10(d1))

drugCombo documentation built on June 30, 2021, 1:07 a.m.