| trapezoidal_linear | R Documentation |
Computes the area under the curve (AUC) or the area under the moment curve (AUMC) using the linear trapezoidal rule.
If moment = TRUE, the function estimates AUMC by integrating time * concentration.
trapezoidal_linear(x, y, moment = FALSE)
x |
A numeric vector representing the time points. |
y |
A numeric vector representing the corresponding concentration values at each time point. |
moment |
Logical. If |
A numeric value representing the estimated AUC or AUMC using the linear trapezoidal rule.
x <- c(0.5, 1, 2, 4, 6, 8)
y <- c(12, 8, 5, 3, 2, 1)
trapezoidal_linear(x, y) # AUC
trapezoidal_linear(x, y, moment = TRUE) # AUMC
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.