Type: Package
Title: Child Anthropometry z-Score Calculator
Version: 0.3.1
Description: A tool for calculating z-scores and centiles for weight-for-age, length/height-for-age, weight-for-length/height, BMI-for-age, head circumference-for-age, age circumference-for-age, subscapular skinfold-for-age, triceps skinfold-for-age based on the WHO Child Growth Standards.
Depends: R (≥ 2.10)
Imports: shiny
Suggests: testthat, knitr, rmarkdown, shinythemes, covr
License: AGPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.1
URL: https://github.com/nutriverse/zscorer
BugReports: https://github.com/nutriverse/zscorer/issues
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2019-10-19 06:01:43 UTC; ernest
Author: Mark Myatt ORCID iD [aut, cph], Ernest Guevarra ORCID iD [aut, cre]
Maintainer: Ernest Guevarra <ernestgmd@gmail.com>
Repository: CRAN
Date/Publication: 2019-10-19 06:20:02 UTC

Tool for calculating z-scores for weight-for-age, height-for-age, weight-for-height, BMI-for-age, head circumference-for-age, arm circumference-for-age, subscapular skinfold-for-age and triceps skinfold-for-age z-score using the WHO Growth Reference (2006)

Description

A tool for calculating z-scores and centiles for weight-for-age, length/height-for-age, weight-for-length/height, BMI-for-age, head circumference-for-age, age circumference-for-age, subscapular skinfold-for-age, triceps skinfold-for-age based on the WHO Child Growth Standards.

Author(s)

Maintainer: Ernest Guevarra ernestgmd@gmail.com (0000-0002-4887-4415)

Authors:

References

World Health Organization. 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. 1st ed. World Health Organization; 2006. ISBN ISBN 92 4 154693 X

See Also

Useful links:


Add the WHO Growth Reference z-scores to a data frame of anthropometric data for weight, height or length, MUAC, head circumference, sub-scapular skinfold and triceps skinfold.

Description

Add the WHO Growth Reference z-scores to a data frame of anthropometric data for weight, height or length, MUAC, head circumference, sub-scapular skinfold and triceps skinfold.

Usage

addWGSR(data, sex, firstPart, secondPart, thirdPart = NA, index = NA,
  standing = NULL, output = paste(index, "z", sep = ""), digits = 2)

Arguments

data

A survey dataset as a data.frame object

sex

Name of variable specifying the sex of the subject. This must be coded as 1 = male and 2 = female. Give a quoted variable name as in (e.g.) "sex".

firstPart

Name of variable specifying:

  • Weight (kg) for BMI/A, W/A, W/H, or W/L

  • Head circumference (cm) for HC/A

  • Height (cm) for BMI/A for H/A

  • Length (cm) for L/A

  • MUAC (cm) for MUAC/A

  • Sub-scapular skinfold (mm) for SSF/A

  • Triceps skinfold (mm) for TSF/A

Give a quoted variable name as in (e.g.) "weight". Be careful with units (weight in kg; height, length, head circumference, and MUAC in cm, skinfolds in mm).

secondPart

Name of variable specifying:

  • Age (days) for H/A, HC/A, L/A, MUAC/A, SSF/A, or TSF/A

  • Height (cm) BMI/A or W/H

  • Length (cm) for W/L

Give a quoted variable name as in (e.g.) "age". Be careful with units (age in days; height and length in cm).

thirdPart

Name of variable specifying age (in days) for BMI/A. Give a quoted variable name as in (e.g.) "age". Be careful with units (age in days).

index

The index to be calculated and added to data. One of:

bfa

BMI for age

hca

Head circumference for age

hfa

Height for age

lfa

Length for age

mfa

MUAC for age

ssa

Sub-scapular skinfold for age

tsa

Triceps skinfold for age

wfa

Weight for age

wfh

Weight for height

wfl

Weight for length

Give a quoted index name as in (e.g.) "wfh".

standing

Variable specifying how stature was measured. If NULL then age (for "hfa" or "lfa") or height rules (for "wfh" or "wfl") will be applied. This must be coded as 1 = Standing; 2 = Supine; 3 = Unknown. All other values will be recoded to 3 = Unknown. Give a quoted variable name as in (e.g.) "measured" or a single value (e.g."measured = 1"). If no value (or NULL) is specified then height and age rules will be applied.

output

The name of the column containing the specified index to be added to the dataset. This is an optional parameter. If you do not specify a value for output then the added column will take the name of the specified index with a "z" appended.

digits

The number of decimal places for output. Defaults to 2 d.p.

Value

A data.frame of the survey dataset with the calculated z-scores added.

Examples

# Calculate weight-for-height (wfh) for the anthro3 dataset
addWGSR(data = anthro3,
        sex = "sex",
        firstPart = "weight",
        secondPart = "height",
        index = "wfh")

# Calculate weight-for-age (wfa) for the anthro3 dataset
addWGSR(data = anthro3,
        sex = "sex",
        firstPart = "weight",
        secondPart = "age",
        index = "wfa")

# Calculate height-for-age (hfa) for the anthro3 dataset
addWGSR(data = anthro3,
        sex = "sex",
        firstPart = "height",
        secondPart = "age",
        index = "hfa")

# Calculate MUAC-for-age (mfa) for the anthro4 dataset

## Convert age in anthro4 from months to days
testData <- anthro4
testData$age <- testData$agemons * (365.25 / 12)

addWGSR(data = testData,
        sex = "sex",
        firstPart = "muac",
        secondPart = "age",
        index = "mfa")


Anthropometric data from a SMART survey in Kabul, Afghanistan.

Description

Anthropometric data from a SMART survey in Kabul, Afghanistan.

Usage

anthro1

Format

A data frame with 873 observations and 11 variables

psu

Primary sampling unit

age

Age of child (months)

sex

Gender of child

weight

Weight of child (kgs)

height

Height of child (cm)

muac

Mid-upper arm circumference (mm)

oedema

Presence or absence of oedema

haz

Height-for-age z-score

waz

Weight-for-age z-score

whz

Weight-for-height z-score

flag

Data quality flag


Anthropometric data from a single state from a Demographic and Health Survey (DHS) of a West African country.

Description

Anthropometric data from a single state from a Demographic and Health Survey (DHS) of a West African country.

Usage

anthro2

Format

A data frame with 796 observations and 6 variables

psu

Primary sampling unit

age

Age (months)

sex

Gender

wt

Weight (kg)

ht

height (cm)

oedema

Presence or absence of oedema


Anthropometric data from a Rapid Assessment Method (RAM) survey from Burundi.

Description

Anthropometric data from a Rapid Assessment Method (RAM) survey from Burundi.

Usage

anthro3

Format

A data frame with 221 observations and 7 variables

psu

Primary sampling unit

age

Age (months)

sex

Gender

weight

Weight (kg)

height

Height (cm)

muac

Mid-upper arm circumference (cm)

oedema

Presence or absence of oedema


A subset of mid-upper arm circumference data from study conducted to create MUAC-for-age z-scores

Description

A subset of mid-upper arm circumference data from study conducted to create MUAC-for-age z-scores

Usage

anthro4

Format

A data.frame with 257 observations and 4 variables

pk_serial

Unique identifier

muac

Mid-upper arm circumference in centimetres

agemons

Age in months

sex

Sex; 1 = Male; 2 = Female

Source

Mramba Lazarus, Ngari Moses, Mwangome Martha, Muchai Lilian, Bauni Evasius, Walker A Sarah et al. A growth reference for mid upper arm circumference for age among school age children and adolescents, and validation for mortality: growth curve construction and longitudinal cohort study BMJ 2017; 358 :j3423 https://doi.org/10.1136/bmj.j3423


Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth Reference (2006) for a single child data.

Description

Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth Reference (2006) for a single child data.

Usage

getAllWGS(data = NULL, sex, weight, height, age, index)

Arguments

data

Data frame containing corresponding data on sex, weight, height, and age of children. Default is NULL. If specified, parameters for sex, weight, height and age should be provided as character values of the names of variables in data corresponding to the parameters required.

sex

Either numeric values (1 = male; 2 = female) indicating sex of child (default) or character value (if data is specified) indicating variable name in data containing information on sex of child/children (1 = male; 2 = female).

weight

Either numeric values for weight in kg with at least 1 decimal place (default) or character value (if data is specified) indicating variable name in data containing information on weight of child/children.

height

Either numeric values for height in cm with at least 1 decimal place (default) or character value (if data is specified) indicating variable name in data containing information on height of child/children.

age

Either numeric values for age in whole months (default) or character value (if data is specified) indicating variable name in data containing information on age of child/children.

index

One of "wfh", "hfa", "wfa" (specifies the required index) or "all" to calculate all three indices

Value

Either a single numeric value for z-score of the anthropometric index selected if data is for single child or a data frame of numeric values for z-scores of each anthropometric index if data is for multiple children and more than one anthropometric index selected.

The function fails messily when secondPart is outside of the range given in the WGS reference (i.e. 45 to 120 cm for height and 0 to 60 months for age). It is up to you to check the ranges of your data.

The reference data for W/H assumes supine length is used for children with a standing height below 85cm

Heights should be specified in cm to the nearest mm (i.e. to 1 d.p.)

Ages should be specified in whole months

Weights should be specified in kg to available precision

The function requires reference data wgsData included in this package

Examples

  # apply \code{getAllWGS()} to a make believe 52 month old male child with weight of
  # 14.6 kg and height of 98.0 cm
  waz <- getAllWGS(sex = 1,          # 1 = Male / 2 = Female
                   weight = 14.6,    # Weight in kilograms
                   height = 98,      # Height in centimetres
                   age = 52,         # Age in whole months
                   index = "wfa")    # Anthropometric index (weight-for-age)
  waz

  haz <- getAllWGS(sex = 1,
                   weight = 14.6,
                   height = 98,      # Height in centimetres
                   age = 52,
                   index = "hfa")    # Anthropometric index (height-for-age)
  haz

  whz <- getAllWGS(sex = 1,
                   weight = 14.6,
                   height = 98,
                   age = 52,
                   index = "wfh")    # Anthropometric index (weight-for-height)
  whz

  # apply \code{getAllWGS()} to \code{anthro1} dataset
  waz <- getAllWGS(data = anthro1,
                   sex = "sex",
                   weight = "weight",
                   height = "height",
                   age = "age",
                   index = "wfa")
  waz

  haz <- getAllWGS(sex = anthro1$sex,
                   weight = anthro1$weight,
                   height = anthro1$height,
                   age = anthro1$age,
                   index = "hfa")
  haz

  all <- getAllWGS(data = anthro1,
                   sex = "sex",
                   weight = "weight",
                   height = "height",
                   age = "age",
                   index = "all")
  all


Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth Reference (2006) for a cohort or sample of children.

Description

Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth Reference (2006) for a cohort or sample of children.

Usage

getCohortWGS(data, FUN = getWGS, sexObserved, firstPart, secondPart,
  index)

Arguments

data

Data frame containing the variables needed for calculation

FUN

Function to apply; default to getWGS()

sexObserved

Sex of child (1 = Male; 2 = Female)

firstPart

Weight (kg; for WHZ and WAZ) or height (cm; for HAZ)

secondPart

Age (months; for HAZ and WAZ) or height (cm; for WHZ)

index

One of "wfh", "hfa", "wfa" (specifies the required index)

Value

Numeric vector of z-scores of the anthropometric index selected

The function fails messily when secondPart is outside of the range given in the WGS reference (i.e. 45 to 120 cm for height and 0 to 60 months for age). It is up to you to check the ranges of your data.

The reference data for W/H assumes supine length is used for children with a standing height below 85cm

Heights should be specified in cm to the nearest mm (i.e. to 1 d.p.)

Ages should be specified in whole months

Weights should be specified in kg to available precision

The function requires reference data wgsData included in this package

Examples

  # apply getWGS to first child in sample data anthro1
  wazAll <- getCohortWGS(data = anthro1,
                         sexObserved = "sex",
                         firstPart = "weight",
                         secondPart = "age",
                         index = "wfa")
  wazAll

  hazAll <- getCohortWGS(data = anthro1,
                         sexObserved = "sex",
                         firstPart = "height",
                         secondPart = "age",
                         index = "hfa")
  hazAll

  whzAll <- getCohortWGS(data = anthro1,
                         sexObserved = "sex",
                         firstPart = "weight",
                         secondPart = "height",
                         index = "wfh")
  whzAll

Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth Reference (2006) for a single child data.

Description

Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth Reference (2006) for a single child data.

Usage

getWGS(sexObserved, firstPart, secondPart, index)

Arguments

sexObserved

Sex of child (1 = Male; 2 = Female)

firstPart

Weight (in kg for WHZ and WAZ) or height (in cm for HAZ)

secondPart

Age (in months for HAZ and WAZ) or height (in cm for WHZ)

index

One of "wfh", "hfa", "wfa" (specifies the required index)

Value

z-score of the anthropometric index selected

Warning

The function fails messily when secondPart is outside of the range given in the WGS reference (i.e. 45 to 120 cm for height and 0 to 60 months for age). It is up to you to check the ranges of your data.

Reminders

The reference data for W/H assumes supine length is used for children with a standing height below 85cm

Heights should be specified in cm to the nearest mm (i.e. to 1 d.p.)

Ages should be specified in whole months

Weights should be specified in kg to available precision

The function requires reference data wgsData included in this package

Note

This is a legacy function from the first CRAN release of zscorer which focused mainly on the calculation of z-scores for weight-for-age, weight-for-height and height-for-age. This function has been kept in the package to ensure that existing analysis workflows implemented using the function continue to work.

Examples

  # apply \code{getWGS()} to a make believe 52 month old male child with weight of
  # 14.6 kg and height of 98.0 cm
  waz <- getWGS(sexObserved = 1,     # 1 = Male / 2 = Female
                firstPart = 14.6,    # Weight in kilograms
                secondPart = 52,     # Age in whole months
                index = "wfa")       # Anthropometric index (weight-for-age)
  waz

  haz <- getWGS(sexObserved = 1,
                firstPart = 98,      # Height in centimetres
                secondPart = 52,
                index = "hfa")       # Anthropometric index (height-for-age)
  haz

  whz <- getWGS(sexObserved = 1,
                firstPart = 14.6,
                secondPart = 98,
                index = "wfh")       # Anthropometric index (weight-for-height)
  whz


Calculate WHO Growth Reference z-score for a given anthropometric measurement.

Description

This function is usually called by the addWGSR() function but could be used as a stand-alone calculator for getting z-score for a given anthropometric measurement.

Usage

getWGSR(sex, firstPart, secondPart, index = NA, standing = NA,
  thirdPart = NA)

Arguments

sex

Sex of the subject. This must be coded as 1 = male and 2 = female.

firstPart

Name of variable specifying:

  • Weight (kg) for BMI/A, W/A, W/H, or W/L

  • Head circumference (cm) for HC/A

  • Height (cm) for BMI/A for H/A

  • Length (cm) for L/A

  • MUAC (cm) for MUAC/A

  • Sub-scapular skinfold (mm) for SSF/A

  • Triceps skinfold (mm) for TSF/A

Give a quoted variable name as in (e.g.) "weight". Be careful with units (weight in kg; height, length, head circumference, and MUAC in cm, skinfolds in mm).

secondPart

Name of variable specifying:

  • Age (days) for H/A, HC/A, L/A, MUAC/A, SSF/A, or TSF/A

  • Height (cm) BMI/A or W/H

  • Length (cm) for W/L

Give a quoted variable name as in (e.g.) "age". Be careful with units (age in days; height and length in cm).

index

The index to be calculated and added to data. One of:

bfa

BMI for age

hca

Head circumference for age

hfa

Height for age

lfa

Length for age

mfa

MUAC for age

ssa

Sub-scapular skinfold for age

tsa

Triceps skinfold for age

wfa

Weight for age

wfh

Weight for height

wfl

Weight for length

Give a quoted index name as in (e.g.) "wfh".

standing

Variable specifying how stature was measured. If NULL then age (for "hfa" or "lfa") or height rules (for "wfh" or "wfl") will be applied. This must be coded as 1 = Standing; 2 = Supine; 3 = Unknown. All other values will be recoded to 3 = Unknown. Give a quoted variable name as in (e.g.) "measured" or a single value (e.g."measured = 1"). If no value (or NULL) is specified then height and age rules will be applied. zz

thirdPart

Name of variable specifying age (in days) for BMI/A. Give a quoted variable name as in (e.g.) "age". Be careful with units (age in days).

Value

A numeric value or vector of z-scores for the specified index.

Examples

# Given a male child 10 months old with a weight of 5.7 kgs, height of 64.2
# cms, and MUAC of 125 mm:
#
# Calculate weight-for-height
getWGSR(sex = 1,
        firstPart = 5.7,
        secondPart = 64.2,
        index = "wfh",
        standing = 3)

# calculate weight-for-age
getWGSR(sex = 1,
        firstPart = 5.7,
        secondPart = 10,
        index = "wfa",
        standing = 3)

# calculate height-for-age
getWGSR(sex = 1,
        firstPart = 64.2,
        secondPart = 10,
        index = "hfa",
        standing = 3)

# Calculate MUAC-for-age z-score for a girl
getWGSR(sex = 1,
        firstPart = 20,
        secondPart = 62 * (365.25 / 12),
        index = "mfa")


Initialise built-in Shiny application

Description

Initialise built-in Shiny application

Usage

run_zscorer()

Examples

if(interactive()) run_zscorer()


World Health Organization (WHO) Growth Reference (2006) data

Description

World Health Organization (WHO) Growth Reference (2006) data

Usage

wgsData

Format

A data frame with 6 columns and 2338 rows.

indicator

One of weight-for-age (waz), height-for-age (haz), or weight-for-height (whz) anthropometric indicators

sex

Sex of child (1 = Male; 2 = Female)

given

Variable to which standardisation is to be made. For waz and haz, given is age in months. For whz, given is height in cm

l

L component of the LMS method for normalising growth centile standards. L is the trend in the optimal power to obtain normality

m

M component of the LMS method for normalising growth centile standards. M is the trend in the mean

s

S component of the LMS method for normalising growth centile standards. S is the trend in the coefficient of variation

Source

World Health Organization. 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. 1st ed. World Health Organization; 2006.