% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/atherogenic_indices.R
\name{atherogenic_indices}
\alias{atherogenic_indices}
\title{Compute atherogenic indices}
\usage{
atherogenic_indices(
  data,
  col_map = NULL,
  na_action = c("keep", "omit", "error"),
  normalize = c("none", "log10"),
  verbose = TRUE
)
}
\arguments{
\item{data}{data.frame/tibble with lipid columns.}

\item{col_map}{named list mapping keys to columns, e.g. list(TG="TG", HDL_c="HDL_c", TC="TC", LDL_c="LDL_c").}

\item{na_action}{one of c("keep","omit","error").}

\item{normalize}{one of c("none","log10"). Reserved; AIP always uses log10(TG/HDL_c).}

\item{verbose}{Logical; if \code{TRUE} (default), prints column mapping, the list
of indices being computed, and a per-column results summary.}
}
\value{
tibble with columns AIP, CRI_I, CRI_II. If an ID column is detected
in \code{data} (e.g. \code{id}, \code{IID}, \code{participant_id}), it is prepended.
}
\description{
Calculates:
\itemize{
\item AIP: Atherogenic Index of Plasma = log10(TG / HDL_c)
\item CRI_I: Castelli Risk Index I = TC / HDL_c
\item CRI_II: Castelli Risk Index II = LDL_c / HDL_c
}
}
\details{
Behavior:
\itemize{
\item Required keys: TG, HDL_c. Optional: TC, LDL_c.
\item NA policy via \code{na_action}: "keep" (default), "omit" (drop rows with any NA in used lipids), "error".
\item Extreme screening via \code{check_extreme} and \code{extreme_action} ("warn","cap","error","ignore","NA").
Default bounds (mg/dL) used only for screening: TG (0, 10000), HDL_c (0, 1000), LDL_c (0, 10000), TC (0, 10000).
Note: All indices are unitless ratios; units cancel in computations.
\item Emits progress via \code{hm_inform()} when \code{verbose = TRUE} or when package option enables logs.
}
}
\examples{
df <- tibble::tibble(
  TG = c(150, 200),
  HDL_c = c(50, 40),
  TC = c(200, 220),
  LDL_c = c(120, 150)
)
cm <- list(TG = "TG", HDL_c = "HDL_c", TC = "TC", LDL_c = "LDL_c")
atherogenic_indices(df, col_map = cm)

}
\references{
\insertRef{dobiasova2004aip}{HealthMarkers}
\insertRef{castelli1977framingham}{HealthMarkers}
}
