% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/cvd_risk.R
\name{cvd_risk_ascvd}
\alias{cvd_risk_ascvd}
\title{ASCVD risk (ACC/AHA Pooled Cohort Equations)}
\usage{
cvd_risk_ascvd(
  data,
  year = 10,
  col_map = NULL,
  na_warn_prop = 0.2,
  verbose = TRUE,
  ...
)
}
\arguments{
\item{data}{A data frame with the required cardiovascular risk columns.}

\item{year}{Risk horizon: 10 or 30.}

\item{col_map}{Optional named list mapping internal keys (\code{age}, \code{sex},
\code{race}, \code{smoker}, \code{total_chol}, \code{HDL_c}, \code{sbp},
\code{bp_treated}, \code{diabetes}, \code{bmi}) to actual column names in
\code{data}. If \code{NULL} (default), column names are auto-inferred then fall
back to the key names themselves. \code{sex} accepts \code{1}/\code{0},
\code{"m"}/\code{"f"}, or \code{"male"}/\code{"female"} (case-insensitive).}

\item{na_warn_prop}{Proportion (0-1) to flag high missingness warnings (default 0.2).
Only used when \code{verbose = TRUE}; underlying backend handles NA as per its API.}

\item{verbose}{Logical; if TRUE, prints progress and a short summary.}

\item{...}{Passed to the underlying PooledCohort function.}
}
\value{
A tibble with columns \code{model}, \code{year}, \code{risk} (percentage).
}
\description{
Wrapper around the PooledCohort ASCVD calculators with added input validation,
optional data-quality warnings, and quiet failure to NA if the backend errors.
}
\examples{
df <- tibble::tibble(
  age = 55, sex = 1, race = "white", smoker = FALSE,
  total_chol = 200, HDL_c = 50, sbp = 140, bp_treated = FALSE,
  diabetes = FALSE, bmi = 27
)
if (requireNamespace("PooledCohort", quietly = TRUE)) {
  cvd_risk_ascvd(df, year = 10, verbose = TRUE)
}

}
\references{
\insertRef{goff2014accaha}{HealthMarkers}
}
