getAllWGS: Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth...

Description Usage Arguments Value Examples

View source: R/getAllWGS.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  # 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

zscorer documentation built on Oct. 30, 2019, 9:43 a.m.