Categorizes individuals based on their Body Mass Index (BMI) according to standard WHO obesity classification criteria. Validates age to ensure appropriate application of adult BMI categories.
Value
Integer vector of obesity categories (1-6). Returns the value of
getOption("scicalc.missing_value") (default -999) for
missing BMI values.
Details
BMI Categories:
1: Underweight: BMI < 18.5 kg/m²
2: Normal weight: BMI 18.5 to < 25 kg/m²
3: Overweight: BMI 25 to < 30 kg/m²
4: Obese class 1: BMI 30 to < 35 kg/m²
5: Obese class 2: BMI 35 to < 40 kg/m²
6: Obese class 3: BMI >= 40 kg/m²
Age Considerations: The function will warn if any individuals are under 18 years old, as standard adult BMI categories may not be appropriate for children and adolescents.
Custom bands
Set options(scicalc.bmic_config = ) to a data frame of custom bands
with columns label, min (lower bound), and code to
replace the WHO bands entirely. Bands are half-open [min, next min)
with the top band open-ended; BMI values below the lowest min return
the missing value. The category_standard attribute is then "custom".
References
World Health Organization. https://www.who.int/news-room/fact-sheets/detail/obesity-and-overweight
Examples
patients <- data.frame(
ID = 1:6,
AGE = c(25, 45, 17, 55, 30, 65),
WEIGHT = c(60, 80, 70, 90, 75, 85),
HEIGHT = c(165, 175, 170, 180, 160, 175)
)
dplyr::mutate(
patients,
BMI = bmi(WEIGHT, HEIGHT),
BMIC = bmic(BMI, AGE)
)
#> Warning: There was 1 warning in `dplyr::mutate()`.
#> ℹ In argument: `BMIC = bmic(BMI, AGE)`.
#> Caused by warning:
#> ! Age contains values less than 18 years. Adult BMI categories may not be appropriate for pediatric populations.
#> ID AGE WEIGHT HEIGHT BMI BMIC
#> 1 1 25 60 165 22.03857 2
#> 2 2 45 80 175 26.12245 3
#> 3 3 17 70 170 24.22145 2
#> 4 4 55 90 180 27.77778 3
#> 5 5 30 75 160 29.29687 3
#> 6 6 65 85 175 27.75510 3
