% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fasting_is.R
\name{fasting_is}
\alias{fasting_is}
\title{Calculate fasting-based insulin sensitivity indices}
\usage{
fasting_is(
  data,
  col_map = NULL,
  normalize = c("none", "z", "inverse", "range", "robust"),
  na_action = c("keep", "omit", "error", "warn"),
  verbose = TRUE
)
}
\arguments{
\item{data}{Data frame with required inputs.}

\item{col_map}{Named list mapping required keys:
\itemize{
\item G0: fasting glucose (mmol/L)
\item I0: fasting insulin (pmol/L)
}}

\item{normalize}{One of: "none","z","inverse","range","robust".}

\item{na_action}{One of:
\itemize{
\item "keep"  (retain all rows; indices become NA where inputs missing/non-finite)
\item "omit"  (drop rows with any missing/non-finite required inputs)
\item "error" (abort if any required input is missing/non-finite)
\item "warn"  (emit a warning for rows with missing inputs, then keep them)
}}

\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 10 columns (indices listed above). If an ID column is
detected in \code{data} (e.g. \code{id}, \code{IID}, \code{participant_id}), it is prepended
as the first output column.
}
\description{
Compute 10 fasting indices from glucose (mmol/L) and insulin (pmol/L):
Fasting_inv, Raynaud, HOMA_IR_inv, FIRI, QUICKI, Belfiore_basal, Ig_ratio_basal,
Isi_basal, Bennett, HOMA_IR_rev_inv. Units converted internally:
G0_mg = G0*18 (mg/dL), I0_u = I0/6 (muU/mL).
}
\examples{
# Minimal example (units: G0 in mmol/L, I0 in pmol/L)
df <- data.frame(G0 = c(5.2, 6.1, 4.8), I0 = c(60, 120, 80))
res <- fasting_is(df, col_map = list(G0 = "G0", I0 = "I0"))
head(res)

# With NA handling
df2 <- data.frame(G0 = c(5.0, NA), I0 = c(90, 150))
fasting_is(df2, col_map = list(G0 = "G0", I0 = "I0"), na_action = "keep")
}
\references{
\insertRef{matthews1985homa}{HealthMarkers}
\insertRef{katz2000quicki}{HealthMarkers}
\insertRef{raynaud1999fasting}{HealthMarkers}
\insertRef{avignon1999ogtt}{HealthMarkers}
\insertRef{belfiore1998insulin}{HealthMarkers}
\insertRef{sluiter1976gtolerance}{HealthMarkers}
\insertRef{hanson2000evaluation}{HealthMarkers}
\insertRef{anderson1995exploration}{HealthMarkers}
}
