% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/metss.R
\name{metss}
\alias{metss}
\title{Metabolic Syndrome Severity Score (MetSSS)}
\usage{
metss(
  data,
  params = list(NHW_M = list(intercept = -2.344, waist = c(mean = 94, sd = 12.4, coef =
    0.846), TG = c(mean = 1.5, sd = 0.6, coef = 0.701), HDL = c(mean = 1.1, sd = 0.3,
    coef = -0.663), glucose = c(mean = 5.3, sd = 0.6, coef = 0.658), MAP = c(mean = 97,
    sd = 11, coef = 0.466)), NHW_F = list(intercept = -2.381, waist = c(mean = 89.7, sd =
    14.8, coef = 0.817), TG = c(mean = 1.28, sd = 0.91, coef = 0.679), HDL = c(mean =
    1.5, sd = 0.4, coef = -0.727), glucose = c(mean = 5.08, sd = 0.52, coef = 0.622), MAP
    = c(mean = 91, 
     sd = 11, coef = 0.557)), NHB_M = list(intercept = -2.399, waist
    = c(mean = 92.8, sd = 13.1, coef = 0.83), TG = c(mean = 1.18, sd = 0.75, coef =
    0.551), HDL = c(mean = 1.27, sd = 0.37, coef = -0.598), glucose = c(mean = 5.55, sd =
    0.85, coef = 0.702), MAP = c(mean = 98, sd = 13, coef = 0.564)), NHB_F =
    list(intercept = -2.395, waist = c(mean = 96.4, sd = 16.4, coef = 0.858), TG = c(mean
    = 1.14, sd = 0.7, coef = 0.57), HDL = c(mean = 1.36, sd = 0.39, coef = -0.634),
    glucose = c(mean = 5.42, sd = 0.84, 
     coef = 0.687), MAP = c(mean = 95, sd = 13,
    coef = 0.577)), HW_M = list(intercept = -2.377, waist = c(mean = 98.5, sd = 11.5,
    coef = 0.864), TG = c(mean = 1.95, sd = 1.19, coef = 0.724), HDL = c(mean = 1.13, sd
    = 0.3, coef = -0.62), glucose = c(mean = 5.67, sd = 0.9, coef = 0.624), MAP = c(mean
    = 97, sd = 11, coef = 0.448)), HW_F = list(intercept = -2.388, waist = c(mean = 97.9,
    sd = 14.2, coef = 0.858), TG = c(mean = 1.66, sd = 1.06, coef = 0.715), HDL = c(mean
    = 1.29, sd = 0.35, coef = -0.657), 
     glucose = c(mean = 5.53, sd = 0.87, coef =
    0.644), MAP = c(mean = 91, sd = 11, coef = 0.512))),
  col_map = NULL,
  verbose = TRUE,
  na_action = c("keep", "omit", "error", "ignore", "warn"),
  na_warn_prop = 0.2,
  diagnostics = TRUE
)
}
\arguments{
\item{data}{data.frame / tibble.}

\item{params}{Named list keyed by "RACE_SEX" (e.g. "NHW_M"). Each element:
list(intercept, waist, TG, HDL, glucose, MAP) where each component (except intercept)
is a named numeric vector c(mean=, sd=, coef=). Default parameters are provided
for NHW, NHB, and HW (male and female); no default HA parameters are included
because Gurka et al. (2014) did not publish HA-specific coefficients. Passing
\code{race = "HA"} with default params will raise an error; supply custom params if needed.}

\item{col_map}{Optional named list mapping canonical keys (\code{waist}, \code{TG}, \code{HDL},
\code{glucose}, \code{MAP}) to actual column names in \code{data}. If \code{NULL}, column names
are inferred automatically.}

\item{verbose}{Logical; if TRUE, prints column mapping and computing messages.}

\item{na_action}{One of c("keep","omit","error","ignore","warn") for required-input NAs. Default "keep".}

\item{na_warn_prop}{Proportion (0-1) above which high-missingness warning fires when na_action='warn'. Default 0.2.}

\item{diagnostics}{Logical; if TRUE (default) emit value/range diagnostic warnings
(negative, out-of-range checks).}
}
\value{
tibble with one numeric column: MetSSS
}
\description{
Computes a continuous metabolic syndrome severity z-score using sex- and
race-specific standardized components and coefficients (factor-loading style).

Behavior note:
\itemize{
\item Parameters are selected per-row based on each row's (race, sex) key.
\item All unique keys present in the data must have a matching entry in \code{params}.
}

Required columns (no unit conversion performed):
\itemize{
\item waist (cm), bp_sys (mmHg), bp_dia (mmHg)
\item TG, HDL_c, glucose (mmol/L)
\item sex (1=male, 2=female)
\item race (one of "NHW","NHB","HW", or accepted synonyms; "HA" is recognised
by the normaliser but has no default params — see \code{params} argument)
}
}
\details{
Calculate Metabolic Syndrome Severity Score (MetSSS)
}
\examples{
df <- data.frame(
  waist = 95, bp_sys = 120, bp_dia = 80, TG = 1.5, HDL_c = 1.2,
  glucose = 5.5, sex = 1, race = "NHW", age = 45
)
metss(df)

}
\references{
\insertRef{gurka2014metsss}{HealthMarkers}
\insertRef{deboer2015metss}{HealthMarkers} (clinical application)
\insertRef{gurka2017metss}{HealthMarkers} (clinical application)
\insertRef{deboer2018metss}{HealthMarkers} (clinical application)
}
