% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/allostatic_load.R
\name{allostatic_load}
\alias{allostatic_load}
\title{Allostatic Load Index}
\usage{
allostatic_load(
  data,
  thresholds,
  col_map = NULL,
  na_action = c("keep", "omit", "error"),
  return_summary = FALSE,
  verbose = TRUE
)
}
\arguments{
\item{data}{data.frame or tibble of numeric biomarker columns.}

\item{thresholds}{named list of scalar numeric cutoffs (names must match columns).}

\item{col_map}{optional named list mapping keys in \code{thresholds} to column names in \code{data}.}

\item{na_action}{one of c("keep","omit","error") ("keep" treats NA as zero contribution).}

\item{return_summary}{logical; TRUE returns list(data, summary, warnings).}

\item{verbose}{logical; print progress messages via hm_inform() (also gated by options(healthmarkers.verbose)).}
}
\value{
tibble with AllostaticLoad or list when return_summary = TRUE.
}
\description{
Computes a composite Allostatic Load (AL) score by flagging biomarkers that
exceed user-specified high-risk thresholds (strict > when multiple biomarkers;
inclusive >= when only one biomarker). Aligned with HM-CS v3: structured
validation, diagnostic control, verbose reporting, and optional summary output.
}
\details{
\strong{API pattern note:} Unlike most HealthMarkers functions which follow the
standard \verb{(data, col_map, ...)} signature, \code{allostatic_load()} uses
\verb{(data, thresholds, col_map = NULL, ...)} because \code{thresholds} is a
domain-specific required argument that cannot be inferred from column names
alone. As a result, this function is not directly dispatchable through the
standard \code{all_health_markers()} registry; a custom wrapper that supplies
\code{thresholds} explicitly would be required.
}
\examples{
df <- tibble::tibble(
  SBP = c(118, 142, 130),
  DBP = c(76, 92, 85),
  CRP = c(1.2, 4.8, 2.1)
)
thr <- list(SBP = 130, DBP = 85, CRP = 3)
allostatic_load(df, thresholds = thr, na_action = "keep", verbose = FALSE)

# Single biomarker uses inclusive >= rule
allostatic_load(df, thresholds = list(CRP = 3))

}
\references{
\insertRef{seeman1997price}{HealthMarkers}
}
\seealso{
\code{\link{adiposity_sds}}, \code{\link{adiposity_sds_strat}}
}
