| Title: | WHO Cardiovascular Disease Risk Calculator |
|---|---|
| Description: | Implements the 2019 World Health Organization (WHO) cardiovascular disease (CVD) risk prediction models, as described in Kaptoge et al. (2019) <doi:10.1016/S2214-109X(19)30318-3>. Provides two validated models for estimating 10-year risk of fatal and non-fatal cardiovascular events (myocardial infarction and stroke): a laboratory-based model using age, sex, systolic blood pressure, total cholesterol, smoking status, and diabetes history; and a non-laboratory-based model substituting body mass index (BMI) for cholesterol and diabetes, suitable for resource-limited settings. Risk estimates are recalibrated to 21 Global Burden of Disease regions using region-specific incidence rates and risk factor distributions derived from the Emerging Risk Factors Collaboration. Functions are fully vectorized for efficient batch calculations and support automatic country-to-region mapping via ISO 3166-1 alpha-3 country codes. |
| Authors: | WHO CVD Risk Chart Working Group [aut], Andrea Pedot [cre, ctb] |
| Maintainer: | Andrea Pedot <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-07 09:24:13 UTC |
| Source: | https://github.com/cran/WHORiskCalculator |
Calculates the 10-year risk of cardiovascular disease (fatal and non-fatal myocardial infarction and stroke) using the WHO laboratory-based model. This model requires total cholesterol measurement.
calculate_who_risk( age, sex, sbp, cholesterol, smoking, diabetes, region = NULL, country = NULL )calculate_who_risk( age, sex, sbp, cholesterol, smoking, diabetes, region = NULL, country = NULL )
age |
Numeric vector. Age in years (valid range: 40-80). |
sex |
Character vector. Sex: "male" or "female". |
sbp |
Numeric vector. Systolic blood pressure in mmHg. |
cholesterol |
Numeric vector. Total cholesterol in mmol/L. To convert from mg/dL to mmol/L, divide by 38.67. |
smoking |
Logical vector. Current smoking status (TRUE = current smoker). |
diabetes |
Logical vector. History of diabetes (TRUE = diabetic). |
region |
Character vector. WHO/GBD region name. One of the 21 global
regions (see |
country |
Character vector. ISO 3166-1 alpha-3 country code (e.g., "USA",
"GBR", "IND"). Used to determine region if |
The model uses Cox proportional hazards regression with the following predictors:
Age (with interactions for all other predictors)
Total cholesterol
Systolic blood pressure
Diabetes status
Current smoking status
Risk is calculated separately for myocardial infarction/CHD death and stroke, then combined assuming independence of the two outcomes:
The model is recalibrated to region-specific incidence rates and mean risk factor levels from the Global Burden of Disease study.
Numeric vector of 10-year CVD risk as a proportion (0-1). Multiply by 100 to get percentage.
Variables are centered at:
Age: 60 years
Systolic blood pressure: 120 mmHg
Total cholesterol: 6 mmol/L
calculate_who_risk_nonlab for the non-laboratory-based model,
get_regions for available regions,
get_country_codes for country code lookup.
# Single calculation calculate_who_risk( age = 55, sex = "male", sbp = 140, cholesterol = 5.5, smoking = TRUE, diabetes = FALSE, region = "western_europe" ) # Using country code instead of region calculate_who_risk( age = 60, sex = "female", sbp = 130, cholesterol = 6.0, smoking = FALSE, diabetes = TRUE, country = "ITA" ) # Vectorized calculation calculate_who_risk( age = c(45, 55, 65), sex = c("male", "female", "male"), sbp = c(120, 140, 160), cholesterol = c(5.0, 6.0, 7.0), smoking = c(FALSE, TRUE, FALSE), diabetes = c(FALSE, FALSE, TRUE), country = c("USA", "GBR", "IND") )# Single calculation calculate_who_risk( age = 55, sex = "male", sbp = 140, cholesterol = 5.5, smoking = TRUE, diabetes = FALSE, region = "western_europe" ) # Using country code instead of region calculate_who_risk( age = 60, sex = "female", sbp = 130, cholesterol = 6.0, smoking = FALSE, diabetes = TRUE, country = "ITA" ) # Vectorized calculation calculate_who_risk( age = c(45, 55, 65), sex = c("male", "female", "male"), sbp = c(120, 140, 160), cholesterol = c(5.0, 6.0, 7.0), smoking = c(FALSE, TRUE, FALSE), diabetes = c(FALSE, FALSE, TRUE), country = c("USA", "GBR", "IND") )
Calculates the 10-year risk of cardiovascular disease using the WHO non-laboratory-based model. This model uses BMI instead of cholesterol and does not require diabetes status, making it suitable for resource-limited settings where laboratory testing may not be available.
calculate_who_risk_nonlab( age, sex, sbp, bmi, smoking, region = NULL, country = NULL )calculate_who_risk_nonlab( age, sex, sbp, bmi, smoking, region = NULL, country = NULL )
age |
Numeric vector. Age in years (valid range: 40-80). |
sex |
Character vector. Sex: "male" or "female". |
sbp |
Numeric vector. Systolic blood pressure in mmHg. |
bmi |
Numeric vector. Body mass index in kg/m². |
smoking |
Logical vector. Current smoking status (TRUE = current smoker). |
region |
Character vector. WHO/GBD region name. One of the 21 global
regions (see |
country |
Character vector. ISO 3166-1 alpha-3 country code. |
This model is designed for use in resource-limited settings where laboratory measurements (cholesterol, glucose) may not be readily available. It uses BMI as a proxy for metabolic risk.
Important limitations:
The non-laboratory model tends to underestimate risk in people with diabetes because diabetes is a strong predictor not included in this model.
For individuals identified as high risk (>10%) by this model, laboratory-based assessment is recommended.
Numeric vector of 10-year CVD risk as a proportion (0-1).
Variables are centered at:
Age: 60 years
Systolic blood pressure: 120 mmHg
BMI: 25 kg/m²
calculate_who_risk for the laboratory-based model.
# Single calculation calculate_who_risk_nonlab( age = 55, sex = "male", sbp = 140, bmi = 28, smoking = TRUE, region = "south_asia" ) # Using country code calculate_who_risk_nonlab( age = 60, sex = "female", sbp = 135, bmi = 26, smoking = FALSE, country = "KEN" )# Single calculation calculate_who_risk_nonlab( age = 55, sex = "male", sbp = 140, bmi = 28, smoking = TRUE, region = "south_asia" ) # Using country code calculate_who_risk_nonlab( age = 60, sex = "female", sbp = 135, bmi = 26, smoking = FALSE, country = "KEN" )
Utility function to map ISO 3166-1 alpha-3 country codes to WHO/GBD regions.
country_to_region(country)country_to_region(country)
country |
Character vector of ISO 3166-1 alpha-3 country codes. |
Character vector of region names.
country_to_region(c("USA", "DEU", "JPN"))country_to_region(c("USA", "DEU", "JPN"))
Returns a named vector mapping ISO 3166-1 alpha-3 country codes to their corresponding WHO/GBD regions.
get_country_codes(country = NULL)get_country_codes(country = NULL)
country |
Optional character vector of country codes to look up. If NULL (default), returns the complete mapping. |
If country is NULL, returns a named character vector where
names are country codes and values are region names. If country
is provided, returns the corresponding region(s).
# Get all mappings head(get_country_codes()) # Look up specific countries get_country_codes(c("USA", "GBR", "IND"))# Get all mappings head(get_country_codes()) # Look up specific countries get_country_codes(c("USA", "GBR", "IND"))
Returns a character vector of valid WHO/GBD region names that can be used with the risk calculation functions.
get_regions()get_regions()
Character vector of 21 GBD region names.
get_regions()get_regions()