Computes log10(TG / HDL_c) with input validation and HM-CS NA handling.
Usage
cvd_marker_aip(
data,
col_map = NULL,
na_action = c("keep", "omit", "error"),
verbose = TRUE
)Arguments
- data
A data frame with numeric columns TG and HDL_c (mg/dL).
- col_map
Named list mapping required keys:
TG: triglycerides
HDL_c: HDL cholesterol
- na_action
One of:
"keep" (retain rows; AIP is NA where inputs missing/non-finite)
"omit" (drop rows with any missing/non-finite inputs)
"error" (abort if any required input missing/non-finite)
- verbose
Logical; if TRUE, emit hm_inform() progress messages.
References
Dobiášová M (2004). “Atherogenic Index of Plasma (AIP) log(Triglycerides/HDL-Cholesterol): Theoretical and Practical Implications.” Clinical Chemistry, 50(7), 1113–1115. doi:10.1373/clinchem.2004.033175 .
Examples
df <- data.frame(TG = c(150, 200), HDL_c = c(50, 40))
cvd_marker_aip(df)
#> cvd_marker_aip(): col_map (inferred): TG -> 'TG', HDL_c -> 'HDL_c'
#> cvd_marker_aip(): computing markers:
#> AIP [TG, HDL_c]
#> cvd_marker_aip(): results: AIP 2/2
#> # A tibble: 2 × 2
#> model value
#> <chr> <dbl>
#> 1 AIP 0.477
#> 2 AIP 0.699