% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make_AUC.R
\name{make_AUC}
\alias{make_AUC}
\title{Calculation of AUCs}
\usage{
make_AUC(
  data = NULL,
  formula = NULL,
  include = NULL,
  exclude = NULL,
  start = 0,
  end = Inf,
  icen = "median",
  outeq = 1,
  block = 1,
  method = "linear",
  addZero = FALSE
)
}
\arguments{
\item{data}{A suitable data object, i.e. \link{PM_pop}, \link{PM_post}, \link{PM_op},
\link{PM_sim}, or some other suitable dataframe
with at least time/observation columns referred to by \code{formula}.}

\item{formula}{A formula of the form \code{obs ~ time | group}. Default value for
\code{group} is "id", so when if the data contain an "id" column, the formula can simply
be \code{obs ~ time}.  If the data contain a grouping variable, it can be specified
as \code{obs ~ time | group}, where \code{group} is the name of the grouping variable.
This is only required with data that is not of class PM_pop, PM_post, PM_op or PM_sim.}

\item{include}{A vector of subject IDs to include in the plot, e.g. c(1:3,5,15)}

\item{exclude}{A vector of subject IDs to exclude in the plot, e.g. c(4,6:14,16:20)}

\item{start}{Specify the time to begin AUC calculations. Default is 0.}

\item{end}{Specify the time to end AUC calculations so that AUC is calculated
from \code{start} to \code{end}.  Default for end is the maximum observation
time for each subject.  Subjects with insufficient data for a specified interval will have
AUC calculated for the available data, not to exceed the specified interval.}

\item{icen}{Can be either "median" for the predictions based on medians of\code{pred.type}  parameter value distributions, or "mean".  Default is "median".
Only relevant for PMpost or PMpop objects.}

\item{outeq}{Which output equation to plot. Default is 1.}

\item{block}{Which block to plot, where blocks are defined by dose reset events (EVID = 4) in the data.}

\item{method}{Default is "linear" for AUC trapezoidal calculation.  Any other value will result in
linear up, log down.}

\item{addZero}{Boolean to add a zero concentration at time 0. Default is \code{FALSE}.}
}
\value{
A dataframe of class \emph{PMauc}, which has 2 columns:
\itemize{
\item \code{group} - Subject identification, usually "id"
\item tau - AUC from \code{start} to \code{end}
}
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}

Calculates AUC from a variety of inputs
}
\details{
Calculates the area under the time concentration curve using the
trapezoidal approximation from a variety of inputs.
If a PM_pop, PM_post, PM_op, or PMsim object is specified,
\code{formula} is not required.
}
\examples{
\dontrun{
NPex$cov$plot(V ~ wt)
NPex$cov$plot(Ke ~ wt, line = list(lm = TRUE, ref = FALSE, loess = FALSE))
NPex$cov$plot(Ke ~ wt, line = list(loess = list(ci = 0.9, color = "green")))
NPex$cov$plot(V ~ time, marker = list(color = "blue"))
NPex$cov$plot(V ~ wt,
  line = list(lm = TRUE, loess = FALSE),
  stats = list(x = 0.5, y = 0.2, font = list(size = 7, color = "blue"))
)
}
}
\seealso{
\link{PM_result}, \link{PM_sim}, \link{PM_op}
}
\author{
Michael Neely
}
