who_value2zscore: Convert anthro measurements to WHO z-scores/centiles...

View source: R/standard_who.R

who_value2zscoreR Documentation

Convert anthro measurements to WHO z-scores/centiles (generic)

Description

Compute z-scores or centiles with respect to the WHO growth standard for given values of x vs. y (typically x is "agedays" and y is a measure like "htcm").

Usage

who_value2zscore(
  x,
  y,
  x_var = "agedays",
  y_var = "lenhtcm",
  sex = "Female",
  data = NULL
)

who_value2centile(
  x,
  y,
  x_var = "agedays",
  y_var = "lenhtcm",
  sex = "Female",
  data = NULL
)

Arguments

x

value or vector of values that correspond to a measure defined by x_var

y

value or vector of values that correspond to a measure defined by y_var

x_var

x variable name (typically "agedays") - see details

y_var

y variable name (typically "htcm", "lencm", or "wtkg") - see details

sex

"Male" or "Female"

data

optional data frame that supplies any of the other variables provided to the function

Details

for all supported pairings of y_var and x_var , type names(who_coefs)

See Also

who_centile2value, who_zscore2value

Examples

# z-scores
who_value2zscore(1670, in2cm(44))
who_value2zscore(1670, lb2kg(48), y_var = "wtkg")

who_value2centile(1670, in2cm(44))
who_value2centile(1670, lb2kg(48), y_var = "wtkg")

# add haz derived from WHO data and compare to that provided with data
cpp$haz <- who_value2zscore(x = agedays,  y = lencm, sex = sex, data = cpp)

# note that you can also do it this way
#' cpp$haz <- who_value2zscore(cpp$agedays, cpp$lencm, sex = cpp$sex)

HBGDki/growthstandards documentation built on Jan. 14, 2024, 4:03 a.m.