% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ogtt_is.R
\name{ogtt_is}
\alias{ogtt_is}
\title{Calculate OGTT-based insulin sensitivity indices}
\usage{
ogtt_is(
  data,
  col_map = NULL,
  normalize = "none",
  verbose = TRUE,
  na_action = c("keep", "omit", "error"),
  na_warn_prop = 0.2
)
}
\arguments{
\item{data}{A data.frame or tibble containing at least the columns mapped by \code{col_map}.}

\item{col_map}{Named list mapping:
\itemize{
\item G0, G30, G120 -> glucose at 0, 30, 120 min (mmol/L)
\item I0, I30, I120 -> insulin at 0, 30, 120 min (pmol/L)
\item weight -> body weight (kg)
\item bmi -> body-mass index (kg/m^2)
\item age -> age (years)
\item sex -> sex (1 = male, 2 = female)
}}

\item{normalize}{One of c("none","z","inverse","range","robust") used by normalize_vec().}

\item{verbose}{Logical; if \code{TRUE} (default), prints column mapping, the list
of indices being computed, and a per-column results summary.}

\item{na_action}{One of c("keep","omit","error") for missing/non-finite required inputs. Default "keep".}

\item{na_warn_prop}{Proportion (0-1) for high-missingness diagnostics (debug). Default 0.2.}
}
\value{
A tibble with the OGTT-based index columns 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{
Given glucose & insulin at 0, 30, 120 min (plus weight, BMI, age, sex),
computes:
\itemize{
\item Isi_120
\item Cederholm_index
\item Gutt_index
\item Avignon_Si0
\item Avignon_Si120
\item Avignon_Sim
\item Modified_stumvoll
\item Stumvoll_Demographics
\item Matsuda_AUC
\item Matsuda_ISI
\item BigttSi
\item Ifc_inv
\item HIRI_inv
\item Belfiore_isi_gly
}
}
\details{
Units assumed:
\itemize{
\item OGTT glucose in mmol/L (internally converted to mg/dL via *18 for select indices)
\item OGTT insulin in pmol/L (internally converted to muU/mL via /6 for select indices)
\item weight in kg; BMI in kg/m^2; age in years; sex coded 1 = male, 2 = female
}

Notes
\itemize{
\item Conversions mirror existing implementation to preserve outputs. Some
formulas intentionally use unconverted inputs (as in prior code).
\item Modified_stumvoll and Stumvoll_Demographics use raw pmol/L and mmol/L
as published in Stumvoll et al. (2000). BigttSi likewise uses raw units.
\item Matsuda_AUC is a non-standard AUC-based variant; the original Matsuda
index (Matsuda_ISI) uses time-point means, not AUCs.
\item Cederholm_index uses log(I0 + I120) as implemented (sum, not mean);
Gutt_index uses log((I0 + I120)/2) (mean). This mirrors published
implementations; the difference is a constant log(2) offset.
\item Ifc_inv and HIRI_inv are derived composite proxies not attributed to a
single formula publication; treat as research tools.
\item Logs are safe: log(x) becomes NA when x <= 0 or non-finite.
}
}
\examples{
df <- tibble::tibble(
  G0 = 5.5, I0 = 60,
  G30 = 7.8, I30 = 90,
  G120 = 6.2, I120 = 50,
  weight = 70, bmi = 24, age = 30, sex = 1
)
ogtt_is(
  df,
  col_map = list(
    G0 = "G0", I0 = "I0",
    G30 = "G30", I30 = "I30",
    G120 = "G120", I120 = "I120",
    weight = "weight", bmi = "bmi",
    age = "age", sex = "sex"
  ),
  normalize = "none",
  verbose = TRUE
)
}
\references{
\insertRef{matsuda1999ogtt}{HealthMarkers}
\insertRef{gutt2000isi}{HealthMarkers}
\insertRef{stumvoll2000ogtt}{HealthMarkers}
\insertRef{hansen2007bigtt}{HealthMarkers}
\insertRef{avignon1999ogtt}{HealthMarkers}
\insertRef{belfiore1998insulin}{HealthMarkers}
\insertRef{matthews1985homa}{HealthMarkers}
\insertRef{suleman2024is}{HealthMarkers} (genetic epidemiology study reviewing IS indices)
}
\seealso{
\code{\link[=fasting_is]{fasting_is()}}, \code{\link[=normalize_vec]{normalize_vec()}}
}
