predict_10yr_ascvd_risk: CVD Risk Calculator

View source: R/predict_risk.R

predict_10yr_ascvd_riskR Documentation

CVD Risk Calculator

Description

This function implements

  • the Pooled Cohort Risk equations from Goff et al, 2013.

  • the updated Pooled Cohort Risk equations from Yadlowski et al, 2018

  • The PREVENT equations from Khan et al, 2023

These equations predict 10-year risk of a first atherosclerotic cardiovascular disease (ASCVD) event, such as a stroke or myocardial infarction. The 2017 American College of Cardiology and American Heart Association blood pressure guideline recommends using 10-year predicted atherosclerotic cardiovascular disease risk to guide the decision to initiate or intensify antihypertensive medication. The guideline recommends using the Pooled Cohort risk prediction equations to predict 10-year atherosclerotic cardiovascular disease risk in clinical practice.

Usage

predict_10yr_ascvd_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Goff_2013",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_10yr_cvd_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_10yr_hf_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_10yr_chd_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_10yr_stroke_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_30yr_ascvd_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_30yr_cvd_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_30yr_hf_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_30yr_chd_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_30yr_stroke_risk(
  age_years,
  race = NULL,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  statin_meds = NULL,
  diabetes,
  bmi = NULL,
  egfr_mlminm2 = NULL,
  acr = NULL,
  hba1c = NULL,
  sdi = NULL,
  equation_version = "Khan_2023",
  prevent_type = "base",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  statin_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

predict_5yr_ascvd_risk(
  age_years,
  race,
  sex,
  smoke_current,
  chol_total_mgdl,
  chol_hdl_mgdl,
  bp_sys_mmhg,
  bp_meds,
  diabetes,
  equation_version = "Goff_2013",
  override_boundary_errors = FALSE,
  race_levels = list(black = "black", white = "white"),
  sex_levels = list(female = "female", male = "male"),
  smoke_current_levels = list(no = "no", yes = "yes"),
  bp_meds_levels = list(no = "no", yes = "yes"),
  diabetes_levels = list(no = "no", yes = "yes")
)

Arguments

age_years

numeric vector of age values, in years.

race

character vector of race values. Categories should include only 'black' or 'white'. If the race variable has additional categories other than 'black' or 'white', then group all non 'black' values into the 'white' category. This variable is not required if equation_version = 'Khan_2023'

sex

character vector of sex values. Categories should include only 'male' or 'female'.

smoke_current

character vector of current smoking habits. Categories should include only 'no' and 'yes'.

chol_total_mgdl

total cholesterol, in mg/dL.

chol_hdl_mgdl

HDL-cholesterol, in mg/dL.

bp_sys_mmhg

systolic blood pressure, in mm Hg.

bp_meds

character vector of blood pressure medication use habits. Categories should include only 'no' and 'yes'. For example, if currently using medication to lower blood pressure, the value should be 'yes'.

statin_meds

character vector of statin medication use habits. Categories should include only 'no' and 'yes'. For example, if currently using a statin, the value should be 'yes'. This variable is only required if equation_version = 'Khan_2023'

diabetes

character vector of diabetes status. Categories should include only 'no' and 'yes'. For example, if diabetes is present, the value should be 'yes'.

bmi

numeric vector of bmi values. Only required if equation_version = "Khan_2023"

egfr_mlminm2

numeric vector of egfr_mlminm2 values. Only required if equation_version = "Khan_2023"

acr

numeric vector of acr values. Only required if equation_version = "Khan_2023" and prevent_type is "acr" or "full".

hba1c

numeric vector of hba1c values. Only required if equation_version = "Khan_2023" and prevent_type is "hba1c" or "full".

sdi

numeric vector of sdi values. Only required if equation_version = "Khan_2023" and prevent_type is "sdi" or "full".

equation_version

a character value of length 1. Valid options are

  • 'Goff_2013'

  • 'Yadlowsky_2018'

  • 'Khan_2023'

If 'Goff_2013' (the default option) is selected, the original Pooled Cohort risk equations are used (See Goff et al., 2013).

If 'Yadlowsky_2018' is selected, the equations recommended by Yadlowsky et al., 2018 are used.

If 'Khan_2023' is selected, the equations recommended by Khan et al., 2023 are used.

prevent_type

a character value of length 1. Only required if equation_version = "Khan_2023". Valid options are:

  • 'base': computes the base PREVENT equation (default).

  • 'acr': computes the PREVENT equation using albumin-to-creatinine ratio.

  • 'hba1c': computes the PREVENT equation using hemoglobin A1c.

  • 'sdi': computes the PREVENT equation using social deprivation index.

  • 'full': computes the PREVENT equation using all novel predictors.

override_boundary_errors

a logical vector of length 1. If FALSE (the default), then predict_10yr_ascvd_risk() will throw hard errors if you give it continuous input values that are outside the bounaries of what the Pooled Cohort risk calculator recommends. If TRUE, errors will not be thrown. Please use with caution.

race_levels

a list of length 2 with names 'black' and 'white'. values in the list should be character vectors of any length, and values in the character vectors should indicate what values in race belong to the 'black' and 'white' categories. For example, race may contain values of 'african_american', 'white', and 'hispanic'. In this case, race_levels should be list(white = c('white', 'hispanic'), black = 'african_american').

sex_levels

a list of length 2 with names 'female' and 'male'. values in the list should be character vectors of any length, and values in the character vectors should indicate what values in sex belong to the 'female' and 'male' categories (see examples).

smoke_current_levels

a list of length 2 with names 'no' and 'yes'. values in the list should be character vectors of any length, and values in the character vectors should indicate what values in smoke_current belong to the 'no' and 'yes' categories (see examples).

bp_meds_levels

a list of length 2 with names 'no' and 'yes'. values in the list should be character vectors of any length, and values in the character vectors should indicate what values in bp_meds belong to the 'no' and 'yes' categories (see examples).

statin_meds_levels

a list of length 2 with names 'no' and 'yes'. values in the list should be character vectors of any length, and values in the character vectors should indicate what values in statin_meds belong to the 'no' and 'yes' categories (see examples).

diabetes_levels

a list of length 2 with names 'no' and 'yes'. values in the list should be character vectors of any length, and values in the character vectors should indicate what values in diabetes belong to the 'no' and 'yes' categories (see examples).

Details

The 2017 American College of Cardiology (ACC) / American Heart Association (AHA) blood pressure (BP) guideline recommends using 10-year predicted atherosclerotic cardiovascular disease (ASCVD) risk to guide the decision to initiate antihypertensive medication. The guideline recommends using the Pooled Cohort risk prediction equations (Goff et al, 2013) to predict 10-year ASCVD risk. The Pooled Cohort risk prediction equations have been externally validated in several studies and, in some populations, are known to overestimate 10-year ASCVD risk. In 2018, an updated set of equations were developed by Yadlowsky et al. using more contemporary data and statistical methods.

Value

a numeric vector with 10-year predicted risk values for ASCVD events.

References

Goff DC, Lloyd-Jones DM, Bennett G, Coady S, D’agostino RB, Gibbons R, Greenland P, Lackland DT, Levy D, O’donnell CJ, Robinson JG. 2013 ACC/AHA guideline on the assessment of cardiovascular risk: a report of the American College of Cardiology/American Heart Association Task Force on Practice Guidelines. Journal of the American College of Cardiology. 2014 Jul 1;63(25 Part B):2935-59. DOI: 10.1016/j.jacc.2014.03.006

Yadlowsky S, Hayward RA, Sussman JB, McClelland RL, Min YI, Basu S. Clinical implications of revised pooled cohort equations for estimating atherosclerotic cardiovascular disease risk. Annals of internal medicine. 2018 Jul 3;169(1):20-9. DOI: 10.7326/M17-3011

Khan SS, Coresh J, Pencina MJ, Ndumele CE, Rangaswami J, Chow SL, Palaniappan LP, Sperling LS, Virani SS, Ho JE, Neeland IJ, Tuttle KR, Rajgopal Singh R, Elkind MSV, Lloyd-Jones DM; American Heart Association. Novel Prediction Equations for Absolute Risk Assessment of Total Cardiovascular Disease Incorporating Cardiovascular-Kidney-Metabolic Health: A Scientific Statement From the American Heart Association. Circulation. 2023 Dec 12;148(24):1982-2004. PMID: 37947094.

Examples


# example taken from Goff et al, 2013

sex = c('female', 'female', 'male', 'male')
race = c('black', 'white', 'black', 'white')
# 55 years of age
age_years = rep(55, times = 4)
# total cholesterol 213 mg/dL
chol_total_mgdl = rep(213, times = 4)
# HDL cholesterol 50 mg/dL
chol_hdl_mgdl = rep(50, times = 4)
# untreated systolic BP 120 mm Hg
bp_sys_mmhg = rep(120, times = 4)
bp_meds = rep('no', times = 4)
# nonsmoker
smoke_current = rep('no', times = 4)
# without diabetes
diabetes = rep('no', times = 4)

pcr_probs <- predict_10yr_ascvd_risk(
  sex = sex,
  race = race,
  age_years = age_years,
  chol_total_mgdl = chol_total_mgdl,
  chol_hdl_mgdl = chol_hdl_mgdl,
  bp_sys_mmhg = bp_sys_mmhg,
  bp_meds = bp_meds,
  smoke_current = smoke_current,
  diabetes = diabetes
)

# note that this isn't an exact match of Table 4 in
# Goff et al supplement - this is because the table's
# coefficients are rounded to a lower decimal count than
# the coefficients used in predict_10yr_ascvd_risk()
round(100 * pcr_probs, 1)

# using a data frame with more granular categories and names

some_data <- data.frame(
  gender = c('woman', 'woman', 'man', 'male'),
  race_3cats = c('AA', 'white', 'AA', 'other'),
  # 55 years of age
  age_years = rep(55, times = 4),
  # total cholesterol 213 mg/dL
  chol_total_mgdl = rep(213, times = 4),
  # HDL cholesterol 50 mg/dL
  chol_hdl_mgdl = rep(50, times = 4),
  # untreated systolic BP 120 mm Hg
  bp_sys_mmhg = rep(120, times = 4),
  bp_meds = rep('No', times = 4),
  # nonsmoker
  smoke_current = c("no", "former", "no", "never"),
  # without diabetes
  diabetes = rep('No', times = 4),
  stringsAsFactors = FALSE
)

pcr_probs <- with(
  some_data,
  predict_10yr_ascvd_risk(
    sex = gender,
    sex_levels = list(female = 'woman', male = c('man', 'male')),
    race = race_3cats,
    age_years = age_years,
    chol_total_mgdl = chol_total_mgdl,
    chol_hdl_mgdl = chol_hdl_mgdl,
    bp_sys_mmhg = bp_sys_mmhg,
    bp_meds = bp_meds,
    smoke_current = smoke_current,
    diabetes = diabetes,
    race_levels = list(black = 'AA', white = c('white', 'other')),
    smoke_current_levels = list(no = c('no', 'former', 'never'), yes = 'Yes'),
    bp_meds_levels = list(no = 'No', yes = 'Yes'),
    diabetes_levels = list(no = 'No', yes = 'Yes')
  )
)



bcjaeger/PooledCohort documentation built on March 10, 2024, 2:12 a.m.