Package {cdcanthro}


Title: Standardized Metrics Based on the CDC and WHO Growth Charts
Version: 0.6.0
Date: 2026-11-15
Description: Calculation of sex- and age-standardized growth metrics using the LMS method (lambda-mu-sigma). The package includes functions for the CDC Growth Charts, cdc_z(), and the WHO Child Growth Standards, who_z(). Because CDC recommends using the WHO Standards for children under 24 months and the CDC Charts among older children, there can be large differences at age 2.0 years. For example, a girl weighing 9.9 kg would be at the WHO 10th percentile on the day before her second birthday, but at the CDC 2nd percentile the following day. The gradual_z() function reduces the differences among 2- to 5-year-olds by taking a weighted average of the CDC and WHO z-scores, as described in Daymont et al. (2025) <doi:10.1542/peds.2025-070697>.
License: GPL-3
URL: https://github.com/CDC-DNPAO/cdcanthro
BugReports: https://github.com/CDC-DNPAO/cdcanthro/issues
Language: en-US
Encoding: UTF-8
LazyData: true
ByteCompile: true
NeedsCompilation: no
Depends: R (≥ 3.5.0)
Imports: data.table (≥ 1.15.0), stats, utils
Suggests: tibble, callr, testthat (≥ 3.1.5)
Config/testthat/edition: 3
Packaged: 2026-11-15 23:23:52 UTC; davidfreedman
Author: David Freedman ORCID iD [aut, cre], Carrie Daymont [ctb]
Maintainer: David Freedman <DavidSFreedman@gmail.com>
Repository: CRAN
Date/Publication: 2026-11-16 08:50:37 UTC

cdcanthro: Sex- and Age-Standardized Metrics from the CDC and WHO Growth Charts

Description

Calculation of sex- and age-standardized growth metrics using the LMS method (lambda-mu-sigma). The function cdc_z(), previously named cdcanthro(), uses the 2000 CDC growth charts for children and adolescents with ages of >= 24.0 to < 240 months, to generate sex- and age-standardized z-scores and percentiles for weight, height, and body mass index (BMI). The output includes extended BMI z-scores for values above the 95th percentile to more accurately characterize children with very high BMIs.

Because CDC recommends the WHO Growth Standards for children under 2 years of age, there is also a function, who_z(), which computes sex- and age- (or length-) standardized metrics for children under five years of age.

There is also a function, gradual_z(), which smooths the discontinuities at age 2.0 resulting, in large part, from the use of different reference data. For example, a girl weighing 9.9 kg would be at the WHO 10th percentile the day before her second birthday and at the CDC 2nd percentile the following day.

Author(s)

David S Freedman

Maintainer: David S Freedman <DavidSFreedman@gmail.com>

Other contributors:


Sample Anthropometric Data from NHANES

Description

Body measurements of 7493 children and adolescents (ages 0 to 239 months) examined in the 2015–2016 and 2017–2018 cycles of the National Health and Nutrition Examination Survey (NHANES). Used in the examples for cdc_z and who_z.

Usage

data(NHanes)

Format

A data.table with 7493 rows and 9 variables:

seqn

NHANES respondent sequence number.

sex

1 = boys, 2 = girls.

agemos

Age in completed months (an integer), as released by NHANES; 36 represents the interval [36, 37) months.

wt

Weight (kg).

length

Recumbent length (cm); measured in children under about 4 years of age.

ht

Standing height (cm); measured from 2 years of age.

bmi

Body mass index (kg/m^2), from standing height.

headc

Head circumference (cm); measured only in infants (here, through 258 days of age).

agedays

Age in days (used by who_z).

Source

National Center for Health Statistics, NHANES Body Measures (BMX) and Demographics (DEMO) files. https://wwwn.cdc.gov/nchs/nhanes/


CDC Growth Chart Reference Data (2000)

Description

LMS parameters (L, M, S) for age- and sex-standardized growth metrics.

Usage

data(cdc_ref_data)

Format

A data.table with columns for sex, age, and LMS values. Parameter names represent the first letter of weight, height, or BMI; this is followed by 'l', 'm', or 's' for the LMS parameters. 'mref' and 'sref' are the M and S parameters for BMI at 240 months of age. For sexn, '1' = boys and '2' = girls.

Source

https://www.cdc.gov/growthcharts/percentile_data_files.htm https://www.cdc.gov/growthcharts/extended-bmi-data-files.htm


Generate Sex- and Age-Standardized Weight, Height, and BMI Metrics From the CDC Growth Charts

Description

Generate z-scores, percentiles, and other sex- and age-standardized metrics for weight, height, and BMI based on the 2000 CDC growth charts. For children with obesity, the extended BMI z-scores and percentiles are calculated. The calculations are restricted to children with ages from 24.0 (inclusive) to < 240 months; for younger children, use who_z. cdc_z is the preferred name; the previous name, cdcanthro, still works but is deprecated.

The BMI metrics include z-scores and percentiles, along with newer metrics such as the extended BMIz and BMI expressed as a percentage of the 50th and 95th percentiles. The extended BMI metrics are used for BMIs at or above the 95th percentile.

Usage

cdc_z(data, age = agemos, wt = wt, ht = ht, bmi = bmi, 
            sex_code = 1:2, all_vars = FALSE)
cdcanthro(data, age = agemos, wt = wt, ht = ht, bmi = bmi, 
            sex_code = 1:2, all_vars = FALSE)

Arguments

data

a data.frame, data.table, or tibble (tbl_df) containing the input data. The class of the returned object matches the class of data.

age

Age in months, specified as accurately as possible. Required. Rows with ages < 24 or >= 240 months are kept, with NA for every metric.

wt

Weight in kg. Optional. If omitted, the weight metrics (waz, wap, mod_waz) are not included in the output.

ht

Height in cm. Optional. If omitted, the height metrics (haz, hap, mod_haz) are not included in the output.

bmi

BMI in kg/m^2. Optional. If omitted but both wt and ht are supplied, BMI is computed as wt / (ht / 100)^2. If all three of wt, ht, and bmi are omitted, the function stops with an error.

sex_code

Numeric vector of length 2, c(male_code, female_code), giving the codes used for sex if other than 1 for boys and 2 for girls. Optional.

all_vars

logical. If TRUE, also returns the L, M, and S values for BMI, sigma, and the distance-from-median metrics of Freedman et al.; see Value. Default is FALSE.

Details

Column names can be given unquoted (age = agemos), quoted (age = 'agemos'), or by position; cdc_z(data, age, wt, ht, bmi) and cdc_z(data, 'age', 'wt', 'ht', 'bmi') give the same result. Naming the arguments is recommended, since a positional value can silently land in the wrong slot.

The function expects the child's sex to be named sex; either upper- or lower-case is fine. You cannot have both SEX and sex in your data. Values can be coded as 1/2, boy(s)/girl(s), b/g, male(s)/female(s), or m/f, in upper- or lower-case.

If sex is numeric and not coded as 1/2, specify this in the optional sex_code argument; the code for boys is the first number. For example, 0/1 coding would be specified as sex_code = 0:1 or sex_code = c(0,1).

Weight is in kg, height is in cm, and BMI is in kg/m^2. Zero and negative measurements are treated as missing.

At least one of wt, ht, or bmi must be present. Metrics that cannot be calculated from the supplied variables are silently omitted from the output. If a supplied column name doesn't exist in data (a likely typo), a warning is issued. If data already has a column with the name of an output variable (for example bmiz), that column is renamed with a 0 suffix (bmiz0) and a warning is issued.

Age in months should be given as accurately as possible: the reference values are tabulated at half-month ages (23.5, 24.5, ..., 239.5, 240), and the L, M, and S values are linearly interpolated to each child's age. If ages are given as the completed number of months (as in NHANES), add 0.5, because a value such as 36 represents the interval [36, 37) months. If every age is a whole number, the function adds 0.5 itself during the calculations and warns that it has done so; the input ages are not changed.

If age is in days, divide by 30.4375 so that a child who is 3672 days old would have an age in months of 120.641. For additional information on age, see the ‘See Also’ section below.

If all_vars = TRUE, all variables in the Freedman et al. paper will be output, along with the L, M, and S values for each child and the value of sigma for the half-normal distribution.

Weight, height, and (for children without obesity) BMI z-scores are calculated as

Z = ((X / M)^L - 1) / (L \times S)

where X is the child's measurement, L is the Box-Cox power for normality for the child's sex and age, M is the median, and S is the coefficient of variation. When |L| < 0.01 the log form Z = \log(X / M) / S is used, as in the CDC SAS program. Reference data are the merged LMS files from the CDC (see ‘See Also’).

For children with obesity (BMI at or above the 95th percentile), BMI percentiles are calculated as

90 + 10 \times \Phi((\mathrm{BMI} - \mathrm{p95}) / \sigma)

where p95 is the sex- and age-specific 95th percentile, \Phi is the CDF of a N(0, 1) distribution (pnorm()), and sigma is the scale parameter of a half-normal distribution, given by the sex-specific formulas in Wei et al. and Hales et al. The extended z-score is the normal quantile of this percentile, capped at 8.21.

The modified z-scores (mod_waz, mod_haz, mod_bmiz) express the distance of a measurement from the median in units of half the distance between the median and the +2 SD value (for measurements above the median) or the -2 SD value (below the median). They are used in the CDC SAS program to flag biologically implausible values.

The class of the returned object matches the class of the input data: a data.frame input returns a data.frame, a data.table returns a data.table, and a tibble (tbl_df) returns a tibble (provided the tibble package is installed; otherwise a data.frame is returned with a warning).

Value

A data.table, data.frame, or tibble containing the original data and various weight, height, and BMI metrics.

If your dataset has ages that are < 24 or >= 240 months, these rows will be present in the output dataset. All calculated metrics will be NA. If this is not what you want, delete these rows before running cdc_z().

Variables in output (only those computable from the supplied measurements are present):

bmi

Added only when BMI was computed from wt and ht.

waz, haz, bmiz

Sex- and age-standardized z-scores for weight, height, and BMI. bmiz is the LMS z-score for children without obesity and the extended BMIz for children with obesity.

wap, hap, bmip

Sex- and age-standardized percentiles for weight, height, and BMI. bmip is the extended BMI percentile for children with obesity.

mod_waz, mod_haz, mod_bmiz

Modified z-scores used to flag biologically implausible values; see Details and the CDC SAS program.

orig_bmip, orig_bmiz

BMI percentiles and z-scores based solely on the LMS method. orig_bmiz and bmiz are identical for BMIs below the 95th percentile.

p95

The 95th percentile of BMI in the reference data for the child's sex and age.

bmip95

BMI expressed as a percentage of the 95th percentile; 120 percent is the lower threshold for severe obesity.

perc_median

Percent difference between the child's BMI and the median (50th percentile) BMI for the child's sex and age.

If all_vars = TRUE, the following are also returned:

bmi_l, bmi_m, bmi_s

The L, M, and S values for BMI at the child's sex and age.

sigma

The scale parameter of the half-normal distribution used for the extended BMI metrics.

dist_median

BMI minus the median BMI (kg/m^2).

adj_dist_median

dist_median adjusted for the age-related change in the spread of BMI, by scaling to the BMI distribution at 240 months (20 years).

adj_perc_median

perc_median adjusted in the same way.

log_perc_median, adj_log_perc_median

Percent distance from the median on the log scale, unadjusted and adjusted.

These metrics are described in Freedman et al. To convert a percent distance from the median to percent of the median, add 100.

Author(s)

David Freedman DavidSFreedman@gmail.com

References

Kuczmarski RJ, Ogden CL, Guo SS, Grummer-Strawn LM, Flegal KM, Mei Z, et al. 2000 CDC Growth Charts for the United States: methods and development. Vital and Health Statistics Series 11, Data from the National Health Survey 2002;11(246):1–190.

Wei R, Ogden CL, Parsons VL, Freedman DS, Hales CM. A method for calculating BMI z-scores and percentiles above the 95th percentile of the CDC growth charts. Annals of Human Biology 2020;47(6):514–521. doi:10.1080/03014460.2020.1808065

Hales CM, Freedman DS, Akinbami L, Wei R, Ogden CL. Evaluation of alternative body mass index (BMI) metrics to monitor weight status in children and adolescents with extremely high BMI using CDC BMI-for-age growth charts. Vital and Health Statistics Series 2 2022;(197):1–42. doi:10.15620/cdc:121711 https://stacks.cdc.gov/view/cdc/121711

Freedman DS, Woo JG, Ogden CL, Xu JH, Cole TJ. Distance and Percent Distance from Median BMI as Alternatives to BMI z-score. British Journal of Nutrition 2020;124(5):493–500. doi:10.1017/S0007114519002046

See Also

who_z for standardized values for children under 5 years based on the WHO standards, and gradual_z for a weighted average of the WHO and CDC z-scores between 2 and 5 years. NHanes for the example data.

CDC LMS percentile data files: https://www.cdc.gov/growthcharts/percentile_data_files.htm

CDC extended BMI data files: https://www.cdc.gov/growthcharts/extended-bmi-data-files.htm

CDC SAS programs and more information on agemos in Table 1 of https://www.cdc.gov/growth-chart-training/hcp/computer-programs/sas.html

Examples

# Two boys and two girls, all 10 years old (120.5 months). bmi is
# computed from wt and ht because it is not supplied.
d <- data.frame(sex = c(1, 1, 2, 2), agemos = 120.5,
                wt = c(30, 65, 30, 65), ht = c(135, 144, 135, 144))
out <- cdc_z(d, age = agemos, wt = wt, ht = ht)
round(out, 2)

# The heavier child of each sex has a BMI above the 95th percentile, so
# bmiz and bmip are the extended values. orig_bmiz and orig_bmip are the
# LMS values, which compress very high BMIs into a narrow range.
out[, c("sex", "bmi", "bmip95", "orig_bmiz", "bmiz", "orig_bmip", "bmip")]

# all_vars = TRUE adds L, M, S, sigma and the distance-from-median metrics
names(cdc_z(d, age = agemos, wt = wt, ht = ht, all_vars = TRUE))

# Column names can also be quoted or given by position. Whole-number ages
# are completed months, so 0.5 is added (with a warning). A missing
# measurement gives NA for that child's metrics, and an age outside 24 to
# < 240 months (here, 20) gives NA for all metrics, but the row is kept.
d <- data.frame(sex = c(1, 2, 1, 2, 2),
                age = c(141, 54, 217, 155, 20),
                wt  = c(57, 25, 72, NA, 11),
                ht  = c(143, 102, 166, 169, 85))
round(cdc_z(d, "age", "wt", "ht"), 2)

# Sex coded 0/1 (boys = 0) needs sex_code; text codes are recognized directly
d <- data.frame(sex = c(0, 1, 0), age = c(120.5, 60.5, 180.5), wt = c(40, 25, 65))
cdc_z(d, age, wt, sex_code = 0:1)
d$sex <- c("M", "F", "boy")
cdc_z(d, age, wt)

# tibble input returns a tibble (requires the tibble package)
if (requireNamespace("tibble", quietly = TRUE)) {
  cdc_z(tibble::as_tibble(d), age, wt)
}

# NHanes (a data.table): ages are completed months, so cdc_z() adds 0.5
# and warns. Adding 0.5 yourself gives the same result without the warning.
library(data.table)
head(NHanes)
out1 <- cdc_z(NHanes, agemos, wt, ht, bmi)
d <- copy(NHanes)[, agemos := agemos + 0.5]
out2 <- cdc_z(d, agemos, wt, ht, bmi)
all.equal(out1$bmiz, out2$bmiz)
head(out2[, .(seqn, sex, agemos, waz, haz, bmiz, bmip)])

Gradual WHO-to-CDC Transition Z-Scores

Description

Computes a smooth, gradually transitioning z-score for weight, height/length, and body mass index (BMI) that blends World Health Organization (WHO) and Centers for Disease Control and Prevention (CDC) growth reference z-scores across early childhood. The gradual z-score is the WHO z-score through 730 days (2.0 y) of age, the CDC z-score from 1826 days (5.0 y) onward, and a weighted average of the two in between.

Gradual z-scores avoid the abrupt jump produced by switching directly from WHO to CDC references at age 2 years as recommended by CDC. For example, under an abrupt switch, a girl weighing 9.9 kg would be at the 10th percentile (WHO) the day before her second birthday and at the 2nd percentile (CDC) the following day; gradual_z avoids this discontinuity.

Usage

gradual_z(data,
         agedays = agedays,
         whowtz  = who_waz,
         cdcwtz  = waz,
         whohtz  = who_lhaz,
         cdchtz  = haz,
         whobmiz = who_bmiz,
         cdcbmiz = bmiz)

Arguments

data

A data.frame, data.table, or tibble containing, at minimum, the age column and at least one complete WHO/CDC z-score column pair. The same class is returned. Not every z-score pair is required – see Value.

agedays

Column with age in days. Required. Column names can be given unquoted or quoted.

whowtz

Column with the WHO weight-for-age z-score (default: who_waz, as returned by who_z).

cdcwtz

Column with the CDC weight-for-age z-score (default: waz, as returned by cdc_z).

whohtz

Column with the WHO length/height-for-age z-score (default: who_lhaz).

cdchtz

Column with the CDC height-for-age z-score (default: haz).

whobmiz

Column with the WHO BMI-for-age z-score (default: who_bmiz).

cdcbmiz

Column with the CDC BMI-for-age z-score (default: bmiz).

Details

Naming the arguments rather than relying on position is recommended. However, if data is the output of who_z and cdc_z run on the same rows, the default column names match and the function can be called as gradual_z(data).

For each row, age in days determines which of three regions applies:

This produces a transition that is continuous at both boundaries, avoiding the discontinuity that would result from switching abruptly from WHO to CDC references at a single cutoff age. Note that if data already contains grad_waz, grad_haz, or grad_bmiz, the column is overwritten and a warning() is issued.

For ages between 2 and 5 years, the gradual z-score is a weighted average of the WHO and CDC z-scores:

Z_{gradual} = \frac{Z_{WHO} \times (5 - \mathrm{ageyears}) + Z_{CDC} \times (\mathrm{ageyears} - 2)}{3}

where ageyears = agedays / 365.25. In this window a missing WHO or CDC z-score gives a missing gradual z-score; outside it only the z-score in use is needed.

Gradual z-scores from 2 through 5 years of age are not directly comparable to those based on either reference alone, and researchers may need sensitivity analyses to facilitate comparison with other studies.

Because the WHO reference changes from recumbent length to standing height at 730/731 days, and the gradual z-score equals the WHO z-score through 730 days, grad_haz and grad_bmiz keep the small discontinuity at that age that is present in who_lhaz and who_bmiz.

The default cdcbmiz = bmiz uses the BMI z-score returned by cdc_z, which is the extended BMI z-score above the 95th percentile. To blend the LMS-only CDC value instead, use cdcbmiz = orig_bmiz. Likewise, who_bmiz from who_z uses the WHO adjustment for values beyond 3 SD.

Value

An object of the same class as data (data.frame, data.table, or tibble), containing all columns of data, plus:

grad_waz

Gradual (blended) weight-for-age z-score. Added only if both whowtz and cdcwtz are found in data.

grad_haz

Gradual (blended) height/length-for-age z-score. Added only if both whohtz and cdchtz are found in data.

grad_bmiz

Gradual (blended) BMI-for-age z-score. Added only if both whobmiz and cdcbmiz are found in data.

Each of the three gradual measures is checked independently. If neither column of a pair is found, that measure is skipped with an informational message(). If only one column of a pair is found, that measure is skipped with a warning() instead. If no complete pair is found, a warning() is issued.

In the output, each measure's columns are grouped together in the order WHO, CDC, and gradual (e.g. who_waz, waz, grad_waz), for weight, then height, then BMI; any other input columns (including agedays) come first.

Author(s)

David Freedman DavidSFreedman@gmail.com

References

Daymont C, Hwang W, Paul IM, Shur N, Freedman DS (2025). "Creation and Evaluation of New Growth Charts With a Gradual Transition From WHO to CDC Values." Pediatrics, 156(3), e2025070697. doi:10.1542/peds.2025-070697

See Also

The original growth charts, tables, and R/Stata code are available at https://github.com/carriedaymont/gradual-who-cdc.

Examples

# Four children at 2, 3, 4 and 5 years with WHO and CDC z-scores already
# computed. At 730 days the gradual z-score is the WHO value, at 1826 days
# the CDC value, and in between a weighted average of the two.
d <- data.frame(
  agedays  = c(730, 1096, 1461, 1826),
  who_waz  = c(0.9, 0.7, 0.6, 0.4),
  waz      = c(0.7, 0.5, 0.3, 0.3),
  who_lhaz = c(-0.2, 0.1, 0.2, 0.1),
  haz      = c(-0.3, 0.0, 0.1, 0.2),
  who_bmiz = c(1.0, 0.9, 0.8, 0.7),
  bmiz     = c(0.1, 0.5, 0.2, 0.2))
gradual_z(d, agedays, who_waz, waz, who_lhaz, haz, who_bmiz, bmiz)

# The column names match the defaults, so this is the same call
gradual_z(d)

# Typical use: who_z() and cdc_z() on the same data, then gradual_z().
# NHanes (a data.table) has age in completed months and in days; cdc_z()
# needs months, with 0.5 added. bmi is dropped so both functions compute
# it from wt and the length/height column.
library(data.table)
d <- NHanes[agedays <= 1826]       # a subset is already a copy
d[, bmi := NULL]
d[, let(lenhei = fifelse(agedays <= 730, length, ht),
        agemos = agemos + 0.5)]
d <- who_z(d, agedays = agedays, wt = wt, lenhei = lenhei)
d <- cdc_z(d, age = agemos, wt = wt, ht = ht)
out <- gradual_z(d)
# children in the transition window: WHO, CDC and gradual z-scores side by side
head(out[agedays > 730 & agedays < 1826,
         .(seqn, agedays, who_waz, waz, grad_waz, who_bmiz, bmiz, grad_bmiz)])

WHO Reference Data

Description

LMS parameters (L, M, S) in the WHO charts for age- and sex-standardized growth metrics.

Usage

data(who_ref_data)

Format

A data.table with 16716 rows: columns for sex (sexn, 1 = boys, 2 = girls), age in days (agedays, 0 to 1856), length (len, 45 to 110 cm), and LMS values. Variable names represent weight (wei), length or height (len), BMI (bmi), weight-for-length (wfl), head circumference (headc), arm circumference (armc), triceps skinfold (tsf), or subscapular skinfold (ssf). This prefix is followed by '_' and then by 'l', 'm', or 's' representing the LMS parameters. The arm circumference and skinfold parameters (available from 91 days of age) are not currently used by who_z.

In contrast to the sex- and age-standardized metrics, weight-for-length is weight standardized for sex and length; it represents the distribution of weights for a specific length. Note that the length/height reference values are given in 0.01 cm increments.

The denom variable is "forage" for rows indexed by age (agedays) and "forlen" for weight-for-length rows (indexed by len).

Source

https://www.who.int/toolkits/child-growth-standards/standards


Sex- and Age- (or Length-) Standardized Weight, Length/Height, BMI, and Head Circumference Metrics from the WHO Child Growth Standards

Description

Calculates z-scores and biologically-implausible-value (BIV) flags for weight-for-age, length/height-for-age, BMI-for-age, head-circumference-for-age, and weight-for-length, based on the WHO Child Growth Standards. The original data are returned together with the calculated metrics.

This function is included in the cdcanthro package because CDC recommends using the WHO Standards for children under 24 months of age and the CDC Growth Charts (cdc_z) from 24 to < 240 months. The use of different references, along with the change from recumbent length to standing height at age 2.0 years, creates discontinuities at age 2.0 years (730 days); gradual_z smooths them. https://www.cdc.gov/growth-chart-training/hcp/overview/recommended.html

Usage

who_z(data,
          agedays = agedays,
          wt = wt,
          lenhei = lenhei,
          bmi = bmi,
          headc = headc,
          sex_code = 1:2)

Arguments

data

a data.frame, data.table, or tibble (tbl_df) containing the input data. The class of the returned object matches the class of data. Must contain a variable named sex or SEX (but not both).

agedays

Age in completed days. Required. Non-integer values are rounded to the nearest day, with a warning. If age is given as the completed number of months (as in NHANES), add 0.5 months, multiply by 30.4375 to convert to days, and round. Rows with ages over 1826 days (or negative) are kept, with NA for every metric.

wt

Weight in kg. Optional.

lenhei

Recumbent length (ages <= 730 days) or standing height (ages > 730 days), in cm. Optional. There is a difference of about 0.7 cm in the median between 730 and 731 days in the reference data, where the measurement changes from recumbent length to standing height; the same lenhei value therefore gives different z-scores on the two days. For weight-for-length, the reference data are tabulated in 0.01 cm increments and other lengths are linearly interpolated.

bmi

Body mass index, kg/m^2. Optional. If not supplied but both wt and lenhei are, BMI is calculated as wt / (lenhei/100)^2 and returned.

headc

Head circumference in cm. Optional.

sex_code

Numeric vector of length 2, c(male_code, female_code), giving the codes used for sex if other than 1 for boys and 2 for girls. Optional.

Details

Column names can be given with or without quotation marks. Naming the arguments rather than relying on position is recommended, e.g. who_z(d, agedays = age, wt = weight); otherwise a value can silently land in the wrong slot. Any absent measurement is skipped, and its z-score is not returned.

The function expects the child's sex to be named sex; either upper- or lower-case is fine. You cannot have both SEX and sex in your data. Values can be coded as 1/2, boy(s)/girl(s), b/g, male(s)/female(s), or m/f, in upper- or lower-case.

If sex is numeric and not coded as 1/2, specify this in the optional sex_code argument; the code for boys is the first number. For example, 0/1 coding would be specified as sex_code = 0:1 or sex_code = c(0,1).

At least one of wt, lenhei, bmi or headc must be present. Metrics that cannot be calculated from the supplied variables are silently omitted from the output. If a supplied column name doesn't exist in data (a likely typo), a warning is issued. If data already has a column with the name of an output variable (for example fwaz), that column is renamed with a 0 suffix and a warning is issued. Zero and negative measurements are treated as missing.

Age in the WHO reference data goes from 0 to 1856 days (1856/365.25 = 5.08 y), but calculations in who_z go up to 1826 days (4.993 y). Weight-for-length Z is calculated only for children <= 730 days of age with a length between 45 and 110 cm.

z-scores are calculated with the LMS method, Z = ((X / M)^L - 1) / (L \times S). For the weight-based indicators (weight-for-age, weight-for-length, and BMI-for-age), WHO's restricted application of the method is used beyond \pm 3: the z-score is recomputed as 3 + (X - SD3)/(SD3 - SD2) above +3 and -3 - (X - SD3neg)/(SD3neg - SD2neg) below -3, where SD2 and SD3 are the measurements at 2 and 3 standard deviations. This makes extreme z-scores a linear function of the measurement rather than the result of extrapolating the Box-Cox transformation. Length/height-for-age and head-circumference-for-age are not adjusted (WHO 2006, chapter 7).

Value

A data.table, tibble, or data.frame containing the original data plus the calculated metrics.

WHO Z-scores:

bmi is also returned when it was computed from wt and lenhei.

BIV flags, following the anthro package. Each 'f' (flag) is 1 if the z-score is outside the WHO plausibility range, 0 if inside, and NA if the z-score is NA:

Note that there doesn't appear to be any publication that justifies these cutpoints. While values outside these ranges are outliers, the measurement may be correct.

Author(s)

David Freedman DavidSFreedman@gmail.com

References

World Health Organization, Department of Nutrition for Health and Development. WHO Child Growth Standards: Length/height-for-age, weight-for-age, weight-for-length, weight-for-height, and body mass index-for-age. Methods and Development. Geneva; 2006. https://www.who.int/publications/i/item/924154693X

The reference WHO LMS values for weight-for-age are in the 'Expanded Tables' files at https://www.who.int/tools/child-growth-standards/standards/weight-for-age. Reference values for the other measures are in the left column.

See Also

cdc_z for standardized values based on the CDC growth charts, gradual_z for a weighted average of the WHO and CDC z-scores between 2 and 5 years, and NHanes for the example data.

Examples

# Four children, with sex given as text. lenhei is recumbent length through
# 730 days and standing height after that. The last two children have the
# same weight and lenhei at 730 and 731 days: who_lhaz differs because the
# reference changes from length to height, and who_wflz is NA after 730 days.
d <- data.frame(sex = c("M", "F", "M", "M"),
                agedays = c(30, 365, 730, 731),
                wt = c(4.2, 9.0, 12.2, 12.2),
                lenhei = c(53.5, 73.0, 87.1, 87.1),
                headc = c(37.5, 45.5, NA, NA))
out <- who_z(d, agedays = agedays, wt = wt, lenhei = lenhei, headc = headc)
print(out, digits = 3)

# BIV flags: a z-score outside the WHO plausibility range is flagged with 1.
# A one-year-old boy weighing 25 kg has who_waz > 5, so fwaz = 1.
d <- data.frame(sex = 1, agedays = 365, wt = c(9.5, 25))
who_z(d, agedays = agedays, wt = wt)

# NHanes (a data.table): build lenhei from length (<= 730 days) and
# height, and keep the WHO age range. bmi is not passed, so it is computed
# from wt and lenhei (the NHanes bmi column uses standing height and is
# missing for infants).
library(data.table)
d <- NHanes[agedays <= 1826]       # a subset is already a copy
d[, lenhei := fifelse(agedays <= 730, length, ht)]
out <- who_z(d, agedays = agedays, wt = wt, lenhei = lenhei, headc = headc)
head(out[, .(seqn, sex, agedays, who_waz, who_lhaz, who_bmiz,
             who_wflz, who_headcz, fwaz)])