
This function allows you to calculate 10-year individual CVD risk using QRISK3-2017.
QRISK3_2017(
data,
patid,
gender,
age,
atrial_fibrillation,
atypical_antipsy,
regular_steroid_tablets,
erectile_disfunction,
migraine,
rheumatoid_arthritis,
chronic_kidney_disease,
severe_mental_illness,
systemic_lupus_erythematosis,
blood_pressure_treatment,
diabetes1,
diabetes2,
weight,
height,
ethiniciy,
heart_attack_relative,
cholesterol_HDL_ratio,
systolic_blood_pressure,
std_systolic_blood_pressure,
smoke,
townsend
)
Return a dataset with three columns: patient identifier, caculated QRISK3 score, caculated QRISK3 score with only 1 digit
Specifiy your data.
Specifiy the patient identifier.
1: women 0: men.
Specify the age of the patient in year (e.g. 64 years-old)
Atrial fibrillation? (0: No, 1:Yes)
On atypical antipsychotic medication? (0: No, 1:Yes)
On regular steroid tablets? (0: No, 1:Yes)
A diagnosis of or treatment for erectile disfunction? (0: No, 1:Yes)
Do patients have migraines? (0: No, 1:Yes)
Rheumatoid arthritis? (0: No, 1:Yes)
Chronic kidney disease (stage 3, 4 or 5)? (0: No, 1:Yes)
Severe mental illness? (0: No, 1:Yes)
Systemic lupus erythematosis (SLE)? (0: No, 1:Yes)
On blood pressure treatment? (0: No, 1:Yes)
Diabetes status: type 1? (0: No, 1:Yes)
Diabetes status: type 2? (0: No, 1:Yes)
Weight of patients (kg)
Height of patients (cm)
Ethic group must be coded as the same as QRISK3
1 White or not stated
2 Indian
3 Pakistani
4 Bangladeshi
5 Other Asian
6 Black Caribbean
7 Black African
8 Chinese
9 Other ethnic group
Angina or heart attack in a 1st degree relative < 60? (0: No, 1:Yes)
Cholesterol/HDL ratio? (range from 1 to 11, e.g. 4)
Systolic blood pressure (mmHg, e.g. 180 mmHg)
Standard deviation of at least two most recent systolic blood pressure readings (mmHg)
Smoke status must be coded as the same as QRISK3
1 non-smoker
2 ex-smoker
3 light smoker (less than 10)
4 moderate smoker (10 to 19)
5 heavy smoker (20 or over)
Townsend deprivation scores
data(QRISK3_2019_test)
test_all <- QRISK3_2019_test
test_all_rst <- QRISK3_2017(data=test_all, patid="ID", gender="gender", age="age",
atrial_fibrillation="b_AF", atypical_antipsy="b_atypicalantipsy",
regular_steroid_tablets="b_corticosteroids", erectile_disfunction="b_impotence2",
migraine="b_migraine", rheumatoid_arthritis="b_ra",
chronic_kidney_disease="b_renal", severe_mental_illness="b_semi",
systemic_lupus_erythematosis="b_sle",
blood_pressure_treatment="b_treatedhyp", diabetes1="b_type1",
diabetes2="b_type2", weight="weight", height="height",
ethiniciy="ethrisk", heart_attack_relative="fh_cvd",
cholesterol_HDL_ratio="rati", systolic_blood_pressure="sbp",
std_systolic_blood_pressure="sbps5", smoke="smoke_cat", townsend="town")
test_all_rst$"QRISK_C_algorithm_score" <- test_all$"QRISK_C_algorithm_score"
test_all_rst$"diff" <- test_all_rst$"QRISK3_2017_1digit" - test_all_rst$"QRISK_C_algorithm_score"
print(test_all_rst$"diff")
print(identical(test_all_rst$"QRISK3_2017_1digit", test_all_rst$"QRISK_C_algorithm_score"))
Run the code above in your browser using DataLab