get_AUC: Calculate Area Under the Curve (AUC)

View source: R/get_AUC.R

get_AUCR Documentation

Calculate Area Under the Curve (AUC)

Description

Function that calculates the area under the curve (AUC) for dose-response curves.

Usage

get_AUC(fit_method, lower, upper, ps, return.abs = FALSE, use.log = FALSE)

Arguments

fit_method

Name of the model to calculate the area under the curve (AUC) for.

lower

Lower concentration bound, usually is the lowest concentration in the data.

upper

Upper concentration bound, usually is the highest concentration in the data.

ps

Numeric vector (or list) of model parameters for the specified model in 'fit_method'.

return.abs

Logical argument, if TRUE, returns the absolute value of the AUC. Defaults to FALSE.

use.log

Logical argument, defaults to FALSE. By default, the function estimates AUC with concentrations in normal unit. If set to TRUE, will use concentration in log10-scale for estimating AUC.

Details

This function takes in a model name and the respective set of model parameters, and returns the area under the curve (AUC) between the specified lower and upper concentration bounds. The AUC can be used to compute an efficacy/potency metric for "active" dose-response curves. For decreasing curves, the AUC returned will be negative. However, users have the option to return a positive AUC in these cases. Model parameters should be entered as a numeric list or vector. Models optimized on the log10-scale (hill and gain-loss), the lower and upper concentration bounds, parameters "ga" (gain AC50) and "la" (loss AC50) will be converted to log10-scale.

Value

AUC value (numeric)

Examples

conc <- c(.03,.1,.3,1,3,10,30,100)
fit_method <- "gnls"
modpars <- list(tp = 1.023, ga = 2.453, p = 1.592,
                la = 4288.993, q = 5.770, er = -3.295)
get_AUC("exp2", min(conc), max(conc), ps = modpars)


tcplfit2 documentation built on Sept. 24, 2024, 1:07 a.m.