
Calculate Number Of Risk Factors (CONFIRM 2015)
Source:R/confirm_ptp.R
calculate_confirm_2015_num_of_rf.Rd
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 2015 CONFIRM Risk Score.
Usage
calculate_confirm_2015_num_of_rf(
have_typical_chest_pain,
have_diabetes,
have_hypertension,
have_family_history,
is_current_smoker,
max_na = 0
)
Arguments
- have_typical_chest_pain
Input characters (no, yes) to indicate if the patient has typical chest pain.
no stands for not having typical chest pain.
yes stands for having typical chest pain.
- have_diabetes
Input characters (no, yes) to indicate if the patient only has diabetes.
no stands for not having diabetes.
yes stands for having diabetes.
- have_hypertension
Input characters (no, yes) to indicate if the patient only has hypertension.
no stands for not having hypertension.
yes stands for having a hypertension.
- have_family_history
Input characters (no, yes) to indicate if the patient only has a family history of CAD.
no stands for not having a family history of CAD.
yes stands for having a family history of CAD.
- is_current_smoker
Input characters (no, yes) to indicate if the patient is a current smoker.
no stands for patient is a current smoker.
yes stands for patient is a not current smoker (past or non-smoker).
- max_na
Input integer 0 to 5 to indicate the maximum number of missing risk factors to tolerate before outputting an
NA
. Default: 0
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_confirm_2015_num_of_rf(
have_typical_chest_pain = "yes",
have_diabetes = "yes",
have_hypertension = "yes",
have_family_history = "yes",
is_current_smoker = "no"
)
#> [1] 4
calculate_confirm_2015_num_of_rf(
have_typical_chest_pain = "no",
have_diabetes = "no",
have_hypertension = "no",
have_family_history = NA,
is_current_smoker = "no",
max_na = 0
)
#> [1] NA
calculate_confirm_2015_num_of_rf(
have_typical_chest_pain = "no",
have_diabetes = "no",
have_hypertension = "no",
have_family_history = NA,
is_current_smoker = "no",
max_na = 1
)
#> [1] 0