Computes z-scores and percentiles for observed BP values against expected values
(\(\mu, \sigma\)) from a specified reference (currently only NHBPEP Fourth Report is available). For ref = "NICE/BHF",
z-scores are not defined and NA is returned with a message.
Arguments
- bp_value
Numeric vector of observed BP values (mmHg).
- ...
Arguments passed on to
.bp_validate_demo_inputbp_typeCharacter;
"systolic"or"diastolic".sexVector of sex codes in your data. Will be mapped to
"male"or"female"usingmale_codeandfemale_code. Values not matching these codes becomeNA.male_code,female_codeScalar values that identify the male and female codes in
sex(e.g.,1and2, or"M"and"F").height_zNumeric vector of height z-scores. Must already be z-transformed (e.g., US CDC, UK-WHO).
height_limitPositive numeric; z-scores with
|z| > height_limitare treated as invalid and set toNA. Default5.age_yearsNumeric vector of ages in years.
refReference:
"Fourth Report"(children/adolescents, 0-17) or"NICE/BHF"(adults, >17).
- .quiet
Logical; suppress validation messages (default
FALSE).
Value
A tibble with two columns: zscore and percentile (0-100).
NA where expected BP could not be computed (e.g., invalid inputs or adult reference).
References
NHBPEP Fourth Report: Paediatric BP categories
NICE Guidelines: Adult BP categories
British Heart Foundation: Adult BP categories
NDA Methodology: Adult BP Range
NPDA Methodology: Paediatric BP Range
RCPCH Growth API: Python library for Paediatric SDS calculation
childsds package: R package for Paediatric SDS calculation
See also
Other BP functions:
.bp_message(),
.bp_resolve_limit(),
.bp_validate_demo_input(),
bp_assess(),
bp_category(),
bp_expected(),
bp_family
Examples
# Z-score and percentile for systolic BP in children using Fourth Report:
bp_relative(
bp_value = c(95, 110, 130),
bp_type = "systolic",
sex = c("M","F","M"),
male_code = "M", female_code = "F",
height_z = c(0, 0.5, -1),
age_years = c(8, 12, 16),
ref = "Fourth Report"
)
#> # A tibble: 3 × 2
#> zscore percentile
#> <dbl> <dbl>
#> 1 -0.375 35.4
#> 2 0.298 61.7
#> 3 1.53 93.6