% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions_wrapper.R
\name{calculate_summary_statistic}
\alias{calculate_summary_statistic}
\title{calculate_summary_statistic}
\usage{
calculate_summary_statistic(model, stat, expr, default = NULL)
}
\arguments{
\item{model}{(Model) Pharmpy model}

\item{stat}{(str) The summary statistic. Can be "max", "min", "median" or "mean"}

\item{expr}{(str (optional)) A mathematical expression containing column or variable names}

\item{default}{(numeric (optional)) An optional default value to use in case the statistic couldn't be calculated.
For example if the model has no dataset.}
}
\value{
(numeric) The summary statistic
}
\description{
Calculate a summary statistic for an expression over the dataset

The expression can be a dataset column name, a variable from the model, e.g. a derived
covariate or a matematical expression involving dataset columns or model variables.
If a calculation involves population parameters, the initial estimates will be used.
}
\examples{
\dontrun{
model <- load_example_model("pheno")
calculate_summary_statistic(model, "max", "TIME")
calculate_summary_statistic(model, "median", "log(WGT)")
calculate_summary_statistic(model, "median", "TVCL")
}

}
