Package 'WHORiskCalculator'

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

Help Index


Calculate WHO 10-Year CVD Risk (Laboratory-Based Model)

Description

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.

Usage

calculate_who_risk(
  age,
  sex,
  sbp,
  cholesterol,
  smoking,
  diabetes,
  region = NULL,
  country = NULL
)

Arguments

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 get_regions for valid values). If NULL and country is provided, region will be determined automatically.

country

Character vector. ISO 3166-1 alpha-3 country code (e.g., "USA", "GBR", "IND"). Used to determine region if region is NULL. See get_country_codes for valid values.

Details

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:

PCVD=1(1PMI)×(1Pstroke)P_{CVD} = 1 - (1 - P_{MI}) \times (1 - P_{stroke})

The model is recalibrated to region-specific incidence rates and mean risk factor levels from the Global Burden of Disease study.

Value

Numeric vector of 10-year CVD risk as a proportion (0-1). Multiply by 100 to get percentage.

Centering Values

Variables are centered at:

  • Age: 60 years

  • Systolic blood pressure: 120 mmHg

  • Total cholesterol: 6 mmol/L

See Also

calculate_who_risk_nonlab for the non-laboratory-based model, get_regions for available regions, get_country_codes for country code lookup.

Examples

# 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")
)

Calculate WHO 10-Year CVD Risk (Non-Laboratory-Based Model)

Description

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.

Usage

calculate_who_risk_nonlab(
  age,
  sex,
  sbp,
  bmi,
  smoking,
  region = NULL,
  country = NULL
)

Arguments

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 get_regions for valid values). If NULL and country is provided, region will be determined automatically.

country

Character vector. ISO 3166-1 alpha-3 country code.

Details

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.

Value

Numeric vector of 10-year CVD risk as a proportion (0-1).

Centering Values

Variables are centered at:

  • Age: 60 years

  • Systolic blood pressure: 120 mmHg

  • BMI: 25 kg/m²

See Also

calculate_who_risk for the laboratory-based model.

Examples

# 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"
)

Map Country Code to Region

Description

Utility function to map ISO 3166-1 alpha-3 country codes to WHO/GBD regions.

Usage

country_to_region(country)

Arguments

country

Character vector of ISO 3166-1 alpha-3 country codes.

Value

Character vector of region names.

Examples

country_to_region(c("USA", "DEU", "JPN"))

Get Country Code to Region Mapping

Description

Returns a named vector mapping ISO 3166-1 alpha-3 country codes to their corresponding WHO/GBD regions.

Usage

get_country_codes(country = NULL)

Arguments

country

Optional character vector of country codes to look up. If NULL (default), returns the complete mapping.

Value

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).

Examples

# Get all mappings
head(get_country_codes())

# Look up specific countries
get_country_codes(c("USA", "GBR", "IND"))

Get Available Region Names

Description

Returns a character vector of valid WHO/GBD region names that can be used with the risk calculation functions.

Usage

get_regions()

Value

Character vector of 21 GBD region names.

Examples

get_regions()