% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/PM_sim.R
\name{summary.PM_sim}
\alias{summary.PM_sim}
\title{Summarize Pmetrics Simulation Objects}
\usage{
\method{summary}{PM_sim}(
  object,
  include,
  exclude,
  field = "obs",
  group = NULL,
  statistics = c("mean", "sd", "median", "min", "max"),
  digits = getPMoptions("digits"),
  ...
)
}
\arguments{
\item{object}{The simulation object to summarize}

\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{field}{Quoted character value, one of
\itemize{
\item \strong{obs} for simulated observations (the default)
\item \strong{amt} for simulated amounts in each compartment
\item \strong{parValues} for simulated parameter values
}}

\item{group}{Optional quoted values to group by, e.g. \code{group = "outeq"} or
\code{group = c("id", "outeq")}.}

\item{statistics}{The summary statistics to report.
Default is  \code{c("mean", "sd", "median", "min", "max")}, but
can be any subset of these and can also include specific quantiles, e.g. \code{c(25, "median", 75)}.}

\item{digits}{Integer, used for number of digits to print. Default is value set with \code{setPMoptions()}.}

\item{...}{Not used.}
}
\value{
If \code{group} is omitted, a data frame with rows for each data element except ID,
and columns labeled according to the selected \code{statistics}. If \code{group} is specified,
return will be a list with named elements according to the selected \code{statistics},
each containing a data frame with the summaries for each group in \code{group}.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}

Summarize simulation
}
\details{
Summarizes simulated observations, compartment amounts or parameter values.
Can be ungrouped (i.e. the entire simulation), average values grouped by simulated id,
outeq, or both, as well as summary statistics for each individual.
Default statistics reported
are mean, sd, median, min, max, but could include individual quantiles. See
\code{statistics} below.
}
\examples{
\dontrun{
simEx$summary() # preferred
summary(simEx) # alternative
simEx$summary(include = 2, field = "amt", group = "comp") # group amounts by compartment
}
}
\seealso{
\link{PM_sim}
}
\author{
Michael Neely
}
