Package 'eadrm'

Title: Fitting Dose-Response Models Using an Evolutionary Algorithm
Description: Fits dose-response models using an evolutionary algorithm to estimate the model parameters. The procedure currently can fit 3-parameter, 4-parameter, and 5-parameter log-logistic models as well as exponential models. Functions are also provided to plot, make predictions, and calculate confidence intervals for the resulting models. For details see "Nonlinear Dose-response Modeling of High-Throughput Screening Data Using an Evolutionary Algorithm", Ma, J., Bair, E., Motsinger-Reif, A.; Dose-Response 18(2):1559325820926734 (2020) <doi:10.1177/1559325820926734>.
Authors: Eric Bair [aut, cre], Jun Ma [aut]
Maintainer: Eric Bair <[email protected]>
License: GPL-3
Version: 0.1.4
Built: 2024-11-04 21:42:33 UTC
Source: https://github.com/cran/eadrm

Help Index


Calculates EC50 (or some other specified EC value)

Description

Calculates the concentration that induces a response corresponding to a specific proportion between the baseline and maximum. It is most commonly used to compute EC50.

Usage

calc.ec(eadrm.obj, ec.in = 0.5, ci.obj = NULL)

Arguments

eadrm.obj

Fitted eadrm model object.

ec.in

A value between 0 and 1 corresponding to the desired proportion. Defaults to 0.5, in which case EC50 is computed.

ci.obj

Output from eadrm.ci that is used to compute confidence intervals. Defaults to NULL, in which case no confidence intervals are computed.

Value

If no confidence intervals are requested, it returns the concentration corresponding to the requested proportion. Otherwise returns a list of three values ec.med, ec.l95, and ec.u95, which correspond to the median concentration and the corresponding lower/upper 95% confidence bounds.

See Also

eadrm, eadrm.ci

Examples

ea.fit <- eadrm(CarboA$y, CarboA$x)
calc.ec(ea.fit)

Finds the dose that corresponds to a particular level of the response

Description

Calculates the concentration that induces a particular level of the response.

Usage

calc.ed(eadrm.obj, response, ci.obj = NULL)

Arguments

eadrm.obj

Fitted eadrm model object.

response

The desired response level.

ci.obj

Output from eadrm.ci that is used to compute confidence intervals. Defaults to NULL, in which case no confidence intervals are computed.

Value

If no confidence intervals are requested, it returns the concentration corresponding to the specified response. Otherwise returns a list of three values ed.med, ed.l95, and ed.u95, which correspond to the median concentration and the corresponding lower/upper 95% confidence bounds.

See Also

eadrm, eadrm.ci

Examples

ea.fit <- eadrm(CarboA$y, CarboA$x)
calc.ec(ea.fit)

Example dose response dataset

Description

A simple dose response dataset used to illustrate the use of the eadrm functions.

Usage

CarboA

Format

A list containing two elements:

x

The drug concentration levels

y

The response values

...


Fits a dose-response curve using an evolutionary algorithm

Description

Uses an evolutionary algorithm to fit a set of four possible dose-response models. The evolutionary parameters and stopping rules can be customized by the user.

Usage

eadrm(
  obs,
  xvals,
  model = "h4",
  pop.size = 1000,
  stable.pop.size = 200,
  num.tournaments = 20,
  tournament.size = 10,
  max.generations = 500,
  stop.generations = 50,
  epsilon = 0.1
)

Arguments

obs

A vector of response values (y-values).

xvals

A vector of doses (x-values).

model

Type of dose-response model to fit. Possible values include "h3", "h4", and "h5" (corresponding to 3-parameter, 4-parameter, and 5-parameter log-logistic models, respectively), "e" (corresponding to an exponential model) and "all" (which allows the procedure to evaluate all four types of models). Defaults to "h4".

pop.size

The number of initial potential solutions. Defaults to 1000.

stable.pop.size

This quantity is divided by the number of tournaments to calculate the number of children in each generation. Defaults to 200.

num.tournaments

The number of tournaments in each generation. Defaults to 20.

tournament.size

The number of players (i.e., models to consider) in each tournament. Defaults to 10.

max.generations

The maximum number of generations. If this number is reached, the algorithm immediately terminates. Defaults to 500.

stop.generations

The algorithm will also terminate if there is no improvement in fitness in stop.generation generations. Defaults to 50.

epsilon

If three successive new models produce an improvement of less than epsilon in fitness, the procedure will terminate. Defaults to 0.1.

Value

An object of class eadrm, which is a list containing the following elements:

Model:

Specifies the type of model (i.e., "h3", "h4", "h5", or "e")

R2:

Fitness for the final model

params:

A vector of coefficients for the final model

xvals:

The original x values (concentrations) for the model

yvals:

The original y values (responses) for the model

Details

The procedure will initially generate pop.size possible solutions. The fitness for each solution will be calculated. In each generation, a series of tournaments are performed. The children of the surviving models from the previous generation are mutated. The model with the best fitness "wins" each tournament and survives to the next generation. The procedure continues until the maximum number of generations is reached or the fitness fails to improve substantially over a sufficient number of generations.

References

Ma, J., Bair, E., Motsinger-Reif, A. "Nonlinear Dose-response Modeling of High-Throughput Screening Data Using an Evolutionary Algorithm", Dose Response 18(2):1559325820926734 (2020).

Examples

ea.fit <- eadrm(CarboA$y, CarboA$x)

Computes confidence intervals for an eadrm model fit

Description

Calculates confidence intervals for an eadrm model fit by repeatedly fitting the model to the same data set and examining the distribution of the coefficients.

Usage

eadrm.ci(obs, xvals, model = "h4", ..., B = 1000)

Arguments

obs

A vector of response values (y-values).

xvals

A vector of doses (x-values).

model

Type of dose-response model to fit. Possible values include "h3", "h4", and "h5" (corresponding to 3-parameter, 4-parameter, and 5-parameter log-logistic models, respectively) and "e" (corresponding to an exponential model). Defaults to "h4".

...

Additional parameters for the eadrm function.

B

Number of replicate models to fit. Defaults to 1000.

Value

A list containing the following elements:

med.est:

A vector of the median values of the coefficients across the B iterations

l95.est,u95est:

Vectors of the lower/upper 95% confidence bounds for the coefficients across the B iterations

replicate.mat:

A p x B matrix, where p is the number of coefficients in the model. Each column of B corresponds to the coefficients for one fitted model.

Details

This function calls the eadrm function B times with the same parameters and records the model coefficients for each iteration of the model. Confidence intervals for the coefficients are calculated by examining the quantiles of the distribution of the coefficients over the B iterations. A matrix of the coefficients for each iteration is also calculated. This matrix can be used to compute confidence intervals for predicted values and estimates of EC50.

See Also

eadrm, predict.eadrm, calc.ec, calc.ed

Examples

ea.ci <- eadrm.ci(CarboA$y, CarboA$x)

Plot an eadrm object

Description

Plots the data used to fit an eadrm object as well as the fitted dose-response curve

Usage

## S3 method for class 'eadrm'
plot(x, ...)

Arguments

x

Object of class eadrm to plot.

...

Additional arguments to plot. Currently ignored.

See Also

eadrm

Examples

ea.fit <- eadrm(CarboA$y, CarboA$x)
plot(ea.fit)

Makes predictions from an eadrm object

Description

Similar to other predict methods, this function predicts fitted values (and optionally confidence intervals) for a eadrm object.

Usage

## S3 method for class 'eadrm'
predict(object, newx = object$xvals, ci.obj = NULL, ...)

Arguments

object

Fitted model of class eadrm.

newx

Vector of new concentration values at which predictions are to be made. Defaults to the concentration values that were used to fit the model.

ci.obj

Output from eadrm.ci that is used to compute confidence intervals. Defaults to NULL, in which case no confidence intervals are computed.

...

Additional arguments passed to or from other methods. Currently ignored.

Value

If no confidence intervals are requested, a vector of predicted responses for each concentration in newx is returned. Otherwise returns a list of three vectors yhat.med, yhat.l95, and yhat.u95, which correspond to the median predicted response and lower/upper 95% confidence bounds for each concentration in newx.

See Also

eadrm, eadrm.ci

Examples

ea.fit <- eadrm(CarboA$y, CarboA$x)
predict(ea.fit)