cdc: Calculate CDC Growth Reference z-score for given...

Description Usage Arguments Details Value Examples

Description

The first function, getCDC(), is usually called by the addCDC() function but could be used as a stand-alone calculator for getting z-score for a given anthropometric measurement.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
getCDC(sex, firstPart, secondPart, thirdPart = NA, index = NA, standing = NA)

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

Arguments

sex

A vector specifying the sex of the subject or a character value for the name of the variable in data 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

A vector or a character value for the name of the variable in data 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

If name of variable in data, give a quoted variable name as in (e.g.) "weight". Be careful with units (weight in kg; height, length, head circumference in cm).

secondPart

A vector or a character value for the name of variable in data specifying:

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

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

  • Length (cm) for W/L

If name of variable in data, give a quoted variable name as in (e.g.) "age". Be careful with units (age in months; height and length in cm).

thirdPart

A vector or a character value for the name of variable in data specifying age (in months) for BMI/A. If name of variable in data, give a quoted variable name as in (e.g.) "age". Be careful with units (age in months).

index

The index to be calculated. One of:

Index Definition
bfa BMI for age
hca Head circumference for age
hfa Height for age
lfa Length 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

A vector or a character value for name of variable in data 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. If name of variable in data, 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 age rules will be applied.

data

A survey dataset as a data.frame object

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.

Details

addCDC() adds the CDC Growth Reference z-scores to a data frame of anthropometric data for weight, height or length, head circumference, and body mass index (BMI)

Value

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

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
# 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
getCDC(sex = 1,
       firstPart = 5.7,
       secondPart = 64.2,
       index = "wfh",
       standing = 3)

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

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

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

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

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

nutriverse/zscorer documentation built on Dec. 28, 2020, 10:32 p.m.