AUCtrap: Calculate AUC Using Trapezoidal Rule

Description Usage Arguments Details Value Examples

View source: R/AUCtrap.R

Description

AUCtrap implements several methods for calculating the area under a piecewise linear function defined by longitudinally measured values of a variable.

Usage

1
2
3
4
5
6
7
AUCtrap(x, ...)

## Default S3 method:
AUCtrap(x, y, method = c("AUC", "iAUC", "netAUC", "minAUC"), ...)

## S3 method for class 'formula'
AUCtrap(formula, data, subset, na.action, ...)

Arguments

x

numeric vector giving the measurement times (x-values)

...

further arguments passed to methods

y

numeric vector with the measurements corresponding to x

method

character value defining the calculation method. Defaults to "AUC", which is the total area under the curve

formula

a formula of the form y ~ x where y is the measured response and x are the measurement times

data

an optional matrix or data frame containing the variables in formula. By default, the variables are taken from environment(formula).

subset

an optional vector specifying a subset of observations to be taken

na.action

a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").

Details

The implemented methods are total AUC ("AUC"), incremental AUC measured from the first as baseline ("iAUC"), net AUC ("netAUC"), and AUC from the minimum as baseline ("minAUC").

Value

an object of class auctrap with the following elements

value

calculated area

x

sorted x values

y

y values sorted with x

method

calculation method

Examples

1
AUCtrap(0:3, c(3,4,1,2))

anikoszabo/AUCtrap documentation built on Dec. 19, 2021, 3:37 a.m.