calculate_esc_2024_num_of_rf {pretestcad} | R Documentation |
Calculate Number Of Risk Factors (ESC 2024)
Description
A function used to calculate the number of risk factors the patient has. This is used to calculate the pretest probability of coronary artery disease (CAD) based on the ESC 2024 guidelines.
Usage
calculate_esc_2024_num_of_rf(
have_family_history,
have_smoking_history,
have_dyslipidemia,
have_hypertension,
have_diabetes,
max_na = 0
)
Arguments
have_family_history |
Input characters (no, yes) to indicate if the patient has a family history of CAD.
|
have_smoking_history |
Input characters (no, yes) to indicate if the patient has a smoking history (current or past smoker).
|
have_dyslipidemia |
Input characters (no, yes) to indicate if the patient has dyslipidemia.
|
have_hypertension |
Input characters (no, yes) to indicate if the patient has hypertension.
|
have_diabetes |
Input characters (no, yes) to indicate if the patient has diabetes.
|
max_na |
Input integer 0 to 5 to indicate the maximum number of
missing risk factors to tolerate before outputting an |
Value
An integer indicating the number of risk factors the patient has.
It can also be NA
if the number of missing risk factors exceeds the max_na
input value.
Examples
calculate_esc_2024_num_of_rf(
have_family_history = "yes",
have_smoking_history = "yes",
have_dyslipidemia = "yes",
have_hypertension = "yes",
have_diabetes = "no"
)
calculate_esc_2024_num_of_rf(
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = NA,
have_diabetes = "no",
max_na = 0
)
calculate_esc_2024_num_of_rf(
have_family_history = "no",
have_smoking_history = "no",
have_dyslipidemia = "no",
have_hypertension = NA,
have_diabetes = "no",
max_na = 1
)