QRisk Simulation Model
Submodules
models.qrisk.qrisk module
Predicts the absolute risk of cardiovascular disease based on various health and lifestyle parameters.
- Args:
age (int): Age of the individual (between 20 and 100). sex (int): Gender of the individual. b_AF (bool): Atrial fibrillation status. b_atypicalantipsy (bool): On atypical antipsychotic medication status. b_corticosteroids (bool): Regular steroid tablets usage status. b_impotence2 (bool): Diagnosis or treatment for erectile dysfunction status. b_migraine (bool): Migraine status. b_ra (bool): Rheumatoid arthritis status. b_renal (bool): Chronic kidney disease (stage 3, 4 or 5) status. b_semi (bool): Severe mental illness status. b_sle (bool): Systemic lupus erythematosus (SLE) status. b_treatedhyp (bool): Blood pressure treatment status. diabetes_cat (int): Diabetes status category. bmi (float): Body Mass Index (kg/m^2) of the individual (between 15 and 50). ethrisk (int): Ethnicity risk category. fh_cvd (bool): Angina or heart attack in a 1st degree relative < 60 status. rati (float): Total cholesterol/HDL cholesterol ratio. sbp (float): Systolic BP (mmHg). sbps5 (float): SD of the last two systolic BP readings (mmHg). smoke_cat (int): Smoking status category.
- Returns:
float: Absolute risk of cardiovascular disease.
- class biomodel.models.qrisk.qrisk.QRisk
Bases:
CustomModel
Predicts the absolute risk of cardiovascular disease based on various health and lifestyle parameters.
- Args:
age (int): Age of the individual (between 20 and 100). sex (int): Gender of the individual. b_AF (bool): Atrial fibrillation status. b_atypicalantipsy (bool): On atypical antipsychotic medication status. b_corticosteroids (bool): Regular steroid tablets usage status. b_impotence2 (bool): Diagnosis or treatment for erectile dysfunction status. b_migraine (bool): Migraine status. b_ra (bool): Rheumatoid arthritis status. b_renal (bool): Chronic kidney disease (stage 3, 4 or 5) status. b_semi (bool): Severe mental illness status. b_sle (bool): Systemic lupus erythematosus (SLE) status. b_treatedhyp (bool): Blood pressure treatment status. diabetes_cat (int): Diabetes status category. bmi (float): Body Mass Index (kg/m^2) of the individual (between 15 and 50). ethrisk (int): Ethnicity risk category. fh_cvd (bool): Angina or heart attack in a 1st degree relative < 60 status. rati (float): Total cholesterol/HDL cholesterol ratio. sbp (float): Systolic BP (mmHg). sbps5 (float): SD of the last two systolic BP readings (mmHg). smoke_cat (int): Smoking status category.
- Returns:
float: Absolute risk of cardiovascular disease.
- interpretation = 'probability'
- intervals = [RiskInterval(value=0.0, name='Low risk'), RiskInterval(value=0.1, name='High risk')]
- name = 'QRISK'
- predict(age: AgeInt(id='age', minimum=20, maximum=100, name='Age'), sex: Enum(id='sex', values={1: 'Male', 2: 'Female'}, name='Sex'), b_AF: Bool(id=313217, name='Atrial fibrillation?'), b_atypicalantipsy: Bool(id='atypical-antipsychotic-medication', name='On atypical antipsychotic medication?'), b_corticosteroids: Bool(id='steroid-tablets', name='Are you on regular steroid tablets?'), b_impotence2: Bool(id=3655355, name='A diagnosis or treatment for erectile disfunction?'), b_migraine: Bool(id=318736, name='Do you have migraines?'), b_ra: Bool(id=80809, name='Rheumatoid arthritis?'), b_renal: Bool(id=46271022, name='Chronic kidney disease (stage 3, 4 or 5)?'), b_semi: Bool(id=4192296, name='Severe mental illness?'), b_sle: Bool(id=257628, name='Systemic lupus erythematosus (SLE)?'), b_treatedhyp: Bool(id=4063253, name='On BP treatment?'), diabetes_cat: Enum(id=4236883, values={0: 'none', 1: 'type 1', 2: 'type 2'}, name='Diabetes status'), bmi: Float(id=4245997, minimum=15, maximum=50, name='Body Mass Index (kg/m^2)'), ethrisk: Enum(id=44803968, values={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'}, name='Ethnicity'), fh_cvd: Bool(id='angina-ha-fdeg-rel-60', name='Angina or heart attack in a 1st degree relative < 60?'), rati: Float(id=4195214, minimum=1, maximum=10, name='Total cholesterol/HDL cholesterol ratio'), sbp: Float(id=4152194, minimum=80, maximum=250, name='Systolic BP (mmHg)'), sbps5: Float(id=4297217, minimum=0, maximum=40, name='SD of the last two systolic BP readings (mmHg)'), smoke_cat: Enum(id='smoke-cat', values={0: 'non-smoker', 1: 'ex-smoker', 2: 'light smoker (less than 10)', 3: 'moderate smoker (10 to 19)', 4: 'heavy smoker (20 or over)'}, name='Smoking status')) float
Predicts the absolute risk of cardiovascular disease based on various health and lifestyle parameters.
- Args:
age (int): Age of the individual (between 20 and 100). sex (int): Gender of the individual. b_AF (bool): Atrial fibrillation status. b_atypicalantipsy (bool): On atypical antipsychotic medication status. b_corticosteroids (bool): Regular steroid tablets usage status. b_impotence2 (bool): Diagnosis or treatment for erectile dysfunction status. b_migraine (bool): Migraine status. b_ra (bool): Rheumatoid arthritis status. b_renal (bool): Chronic kidney disease (stage 3, 4 or 5) status. b_semi (bool): Severe mental illness status. b_sle (bool): Systemic lupus erythematosus (SLE) status. b_treatedhyp (bool): Blood pressure treatment status. diabetes_cat (int): Diabetes status category. bmi (float): Body Mass Index (kg/m^2) of the individual (between 15 and 50). ethrisk (int): Ethnicity risk category. fh_cvd (bool): Angina or heart attack in a 1st degree relative < 60 status. rati (float): Total cholesterol/HDL cholesterol ratio. sbp (float): Systolic BP (mmHg). sbps5 (float): SD of the last two systolic BP readings (mmHg). smoke_cat (int): Smoking status category.
- Returns:
float: Absolute risk of cardiovascular disease.
- title = 'Probability of developing cardiovascular disease in the next 10 years'
models.qrisk.qrisk_model module
This file contains functions to calculate the risk score for cardiovascular disease based on various input parameters such as age, sex, medical history, BMI, smoking status, and others. It includes separate functions for calculating the risk score for cardiovascular disease in males and females, as well as a combined function for both sexes.
- biomodel.models.qrisk.qrisk_model.cvd_female_raw(age, b_AF, b_atypicalantipsy, b_corticosteroids, b_migraine, b_ra, b_renal, b_semi, b_sle, b_treatedhyp, b_type1, b_type2, bmi, ethrisk, fh_cvd, rati, sbp, sbps5, smoke_cat, surv, town)
Calculate the risk score for cardiovascular disease in females based on various input parameters such as age, medical history, BMI, smoking status, and others.
- Args:
age (int): Age of the individual. b_AF (int): Atrial fibrillation boolean indicator (0 or 1). b_atypicalantipsy (int): Atypical antipsychotic medication boolean indicator (0 or 1). b_corticosteroids (int): Corticosteroids medication boolean indicator (0 or 1). b_migraine (int): Migraine boolean indicator (0 or 1). b_ra (int): Rheumatoid arthritis boolean indicator (0 or 1). b_renal (int): Renal disease boolean indicator (0 or 1). b_semi (int): Socioeconomic status boolean indicator (0 or 1). b_sle (int): Systemic lupus erythematosus boolean indicator (0 or 1). b_treatedhyp (int): Treated hypertension boolean indicator (0 or 1). b_type1 (int): Type 1 diabetes boolean indicator (0 or 1). b_type2 (int): Type 2 diabetes boolean indicator (0 or 1). bmi (float): Body mass index (BMI) of the individual. ethrisk (int): Ethnicity risk category. fh_cvd (int): Family history of cardiovascular disease boolean indicator (0 or 1). rati (float): Cholesterol ratio. sbp (float): Systolic blood pressure. sbps5 (float): Systolic blood pressure treatment boolean indicator (0 or 1). smoke_cat (int): Smoking category. surv (int): Survival status. town (float): Townsend deprivation index.
- Returns:
float: The calculated risk score for cardiovascular disease in females.
- biomodel.models.qrisk.qrisk_model.cvd_male_raw(age, b_AF, b_atypicalantipsy, b_corticosteroids, b_impotence2, b_migraine, b_ra, b_renal, b_semi, b_sle, b_treatedhyp, b_type1, b_type2, bmi, ethrisk, fh_cvd, rati, sbp, sbps5, smoke_cat, surv, town)
Calculate the risk score for cardiovascular disease in males based on various input parameters such as age, medical history, BMI, smoking status, and others.
- Args:
age (int): Age of the individual. b_AF (int): Atrial fibrillation boolean indicator (0 or 1). b_atypicalantipsy (int): Atypical antipsychotic medication boolean indicator (0 or 1). b_corticosteroids (int): Corticosteroids medication boolean indicator (0 or 1). b_impotence2 (int): Impotence boolean indicator (0 or 1). b_migraine (int): Migraine boolean indicator (0 or 1). b_ra (int): Rheumatoid arthritis boolean indicator (0 or 1). b_renal (int): Renal disease boolean indicator (0 or 1). b_semi (int): Socioeconomic status boolean indicator (0 or 1). b_sle (int): Systemic lupus erythematosus boolean indicator (0 or 1). b_treatedhyp (int): Treated hypertension boolean indicator (0 or 1). b_type1 (int): Type 1 diabetes boolean indicator (0 or 1). b_type2 (int): Type 2 diabetes boolean indicator (0 or 1). bmi (float): Body mass index (BMI) of the individual. ethrisk (int): Ethnicity risk category. fh_cvd (int): Family history of cardiovascular disease boolean indicator (0 or 1). rati (float): Cholesterol ratio. sbp (float): Systolic blood pressure. sbps5 (float): Systolic blood pressure treatment boolean indicator (0 or 1). smoke_cat (int): Smoking category. surv (int): Survival status. town (float): Townsend deprivation index.
- Returns:
float: The calculated risk score for cardiovascular disease in males.
- biomodel.models.qrisk.qrisk_model.cvd_raw(sex, age, b_AF, b_atypicalantipsy, b_corticosteroids, b_impotence2, b_migraine, b_ra, b_renal, b_semi, b_sle, b_treatedhyp, b_type1, b_type2, bmi, ethrisk, fh_cvd, rati, sbp, sbps5, smoke_cat, surv, town)
Calculate the risk score for cardiovascular disease based on the individual’s sex, age, medical history, BMI, smoking status, and other relevant parameters.
- Args:
sex (int): Sex of the individual (1 for male, 0 for female). age (int): Age of the individual. b_AF (int): Atrial fibrillation boolean indicator (0 or 1). b_atypicalantipsy (int): Atypical antipsychotic medication boolean indicator (0 or 1). b_corticosteroids (int): Corticosteroids medication boolean indicator (0 or 1). b_impotence2 (int): Impotence boolean indicator (0 or 1) for males. b_migraine (int): Migraine boolean indicator (0 or 1). b_ra (int): Rheumatoid arthritis boolean indicator (0 or 1). b_renal (int): Renal disease boolean indicator (0 or 1). b_semi (int): Socioeconomic status boolean indicator (0 or 1). b_sle (int): Systemic lupus erythematosus boolean indicator (0 or 1). b_treatedhyp (int): Treated hypertension boolean indicator (0 or 1). b_type1 (int): Type 1 diabetes boolean indicator (0 or 1). b_type2 (int): Type 2 diabetes boolean indicator (0 or 1). bmi (float): Body mass index (BMI) of the individual. ethrisk (int): Ethnicity risk category. fh_cvd (int): Family history of cardiovascular disease boolean indicator (0 or 1). rati (float): Cholesterol ratio. sbp (float): Systolic blood pressure. sbps5 (float): Systolic blood pressure treatment boolean indicator (0 or 1). smoke_cat (int): Smoking category. surv (int): Survival status. town (float): Townsend deprivation index.
- Returns:
float: The calculated risk score for cardiovascular disease.