Runs bp_expected, bp_relative and bp_category
in one call. Inputs are validated once and the expected BP is computed once, so messages
are printed once and the results are consistent with each other.
Usage
bp_assess(bp_value, bp_limit = c(-Inf, Inf), ..., .quiet = FALSE)Arguments
- bp_value
Numeric vector of observed BP values (mmHg).
- bp_limit
Length-2 numeric vector
c(min, max)giving acceptable range used for categorisation. Seebp_category.- ...
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 messages (default
FALSE).
Value
A tibble with one row per input and columns expected (\(\mu\), mmHg),
zscore, percentile (0-100) and category. Values that cannot be
computed are NA; for ref = "NICE/BHF" only category is defined.
See also
Other BP functions:
.bp_message(),
.bp_resolve_limit(),
.bp_validate_demo_input(),
bp_category(),
bp_expected(),
bp_family,
bp_relative()
Examples
# One-stop interface:
bp_assess(
bp_value = c(115, 142),
bp_type = "systolic",
sex = c("M","F"), male_code = "M", female_code = "F",
height_z = c(0, 0.2),
age_years = c(13, 16),
ref = "Fourth Report"
)
#> NHBPEP Fourth Report categorise 'Normotension' to 'Stage 2 hypertension'; Special rules for newborns (<1), children (0-12), adolescents (12-17).
#> BP outside National Paediatric Diabetes Audit (NPDA) limit removed unless acceptable range is explicitly specified by 'bp_limit'.
#> # A tibble: 2 × 4
#> expected zscore percentile category
#> <dbl> <dbl> <dbl> <chr>
#> 1 109. 0.581 71.9 Normotension
#> 2 112. 2.88 99.8 Stage 2 hypertension