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

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

who_value2centile(x, y, x_var = "agedays", y_var = "htcm",
  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" 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

Examples

# z-scores who_value2zscore(1670, in2cm(44))
#> [1] 1.117365
who_value2zscore(1670, lb2kg(48), y_var = "wtkg")
#> [1] 1.527048
who_value2centile(1670, in2cm(44))
#> [1] 86.80809
who_value2centile(1670, lb2kg(48), y_var = "wtkg")
#> [1] 93.66255
# 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)