View source: R/calculate_ascvd_risk.R
calculate_ascvd_risk_ | R Documentation |
Calculate 10-year ASCVD Risk (2014 original formula)
calculate_ascvd_risk_(
age,
sex,
race,
total_chol,
hdl_chol,
sbp,
using_antihypertensive_medication = FALSE,
current_smoker = FALSE,
diabetes = FALSE,
chol_units = "mg/dL"
)
age |
Age in years |
sex |
Sex assigned at birth (Male/Female) |
race |
Race self-identified |
total_chol |
Total Cholesterol, mg/dL |
hdl_chol |
HDL Cholesterol, mg/dL |
sbp |
Systolic Blood Pressure, mmHg |
using_antihypertensive_medication |
Hypertension medication use (TRUE/FALSE) |
current_smoker |
Currently Smoking (TRUE/FALSE) |
diabetes |
Diabetes diganosis (TRUE/FALSE) |
chol_units |
Cholesterol units (default "mg/dL") |
A single value for 10-year Cardiovascular Risk. Multiple *100 to obtain as a percentage.
calculate_ascvd_risk(sex = "female",
race = "white",
age= 55,
total_chol = 213,
hdl_chol = 50,
sbp=120,
using_antihypertensive_medication=FALSE,
current_smoker=FALSE,
diabetes=FALSE)
n = 10
tibble(id = 1:n,
sex = sample(c("female","male"), n, replace = T),
race = sample(c("white","black"), n, replace = T),
age= rnorm(n, 55),
total_chol = rnorm(n, 213),
hdl_chol = rnorm(n, 50),
sbp=rnorm(n, 120),
using_antihypertensive_medication=sample(c(TRUE, FALSE), n, replace = T),
current_smoker=sample(c(TRUE, FALSE), n, replace = T),
diabetes=sample(c(TRUE, FALSE), n, replace = T)) |>
mutate(ascvd_r = calculate_ascvd_risk(age = age, sex = sex, race=race,
total_chol = total_chol, hdl_chol=hdl_chol,
sbp=sbp, using_antihypertensive_medication=using_antihypertensive_medication,
current_smoker=current_smoker,
diabetes=diabetes))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.