Title: | Child Anthropometry z-Score Calculator |
---|---|
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. |
Authors: | Mark Myatt [aut, cph] , Ernest Guevarra [aut, cre] |
Maintainer: | Ernest Guevarra <[email protected]> |
License: | AGPL-3 |
Version: | 0.3.1.9000 |
Built: | 2024-11-02 03:12:29 UTC |
Source: | https://github.com/nutriverse/zscorer |
Anthropometric data from a SMART survey in Kabul, Afghanistan.
anthro1
anthro1
A data frame with 873 observations and 11 variables
Variable | Description |
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 |
head(anthro1)
head(anthro1)
Anthropometric data from a single state from a Demographic and Health Survey (DHS) of a West African country.
anthro2
anthro2
A data frame with 796 observations and 6 variables
Variable | Definition |
psu | Primary sampling unit |
age | Age (months) |
sex | Gender |
wt | Weight (kg) |
ht | Height (cm) |
oedema | Presence or absence of oedema |
head(anthro2)
head(anthro2)
Anthropometric data from a Rapid Assessment Method (RAM) survey from Burundi.
anthro3
anthro3
A data frame with 221 observations and 7 variables
Variable | Definition |
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 |
head(anthro3)
head(anthro3)
A subset of mid-upper arm circumference data from study conducted to create MUAC-for-age z-scores
anthro4
anthro4
A data.frame with 257 observations and 4 variables
Variable | Definition |
pk_serial | Unique identifier |
muac | Mid-upper arm circumference in centimetres |
agemons | Age in months |
sex | Sex; 1 = Male; 2 = Female |
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
head(anthro4)
head(anthro4)
Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth Reference (2006) for a single child data.
getAllWGS(data = NULL, sex, weight, height, age, index)
getAllWGS(data = NULL, sex, weight, height, age, index)
data |
Data frame containing corresponding data on |
sex |
Either numeric values (1 = male; 2 = female) indicating sex of
child (default) or character value (if |
weight |
Either numeric values for weight in kg with at least 1 decimal
place (default) or character value (if |
height |
Either numeric values for height in cm with at least 1 decimal
place (default) or character value (if |
age |
Either numeric values for age in whole months (default) or
character value (if |
index |
One of "wfh", "hfa", "wfa" (specifies the required index) or "all" to calculate all three indices |
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
# apply 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 getAllWGS to 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
# apply 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 getAllWGS to 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
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.
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 )
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 )
sex |
A vector specifying the sex of the subject or a character value
for the name of the variable in |
|||||||||||||||||
firstPart |
A vector or a character value for the name of the variable
in
If name of variable in |
|||||||||||||||||
secondPart |
A vector or a character value for the name of variable
in
If name of variable in |
|||||||||||||||||
thirdPart |
A vector or a character value for the name of variable
in |
|||||||||||||||||
index |
The index to be calculated. One of:
Give a quoted index name as in (e.g.) |
|||||||||||||||||
standing |
A vector or a character value for name of variable in |
|||||||||||||||||
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 |
|||||||||||||||||
digits |
The number of decimal places for |
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)
A data.frame of the survey dataset with the calculated z-scores added.
# 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")
# 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")
Calculate z-scores for WHZ, HAZ, WAZ using the WHO Growth Reference (2006) for a cohort or sample of children.
getCohortWGS(data, sexObserved, firstPart, secondPart, index)
getCohortWGS(data, sexObserved, firstPart, secondPart, index)
data |
Data frame containing the variables needed for calculation |
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) |
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
# 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
# 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.
getWGS(sexObserved, firstPart, secondPart, index)
getWGS(sexObserved, firstPart, secondPart, index)
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) |
z-score 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
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.
# 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
# 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
The first function, getWGSR()
, 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.
getWGSR(sex, firstPart, secondPart, thirdPart = NA, index = NA, standing = NA) addWGSR( data, sex, firstPart, secondPart, thirdPart = NA, index = NA, standing = NULL, output = paste(index, "z", sep = ""), digits = 2 )
getWGSR(sex, firstPart, secondPart, thirdPart = NA, index = NA, standing = NA) addWGSR( data, sex, firstPart, secondPart, thirdPart = NA, index = NA, standing = NULL, output = paste(index, "z", sep = ""), digits = 2 )
sex |
Name of variable specifying the sex of the subject. This must be
coded as |
|||||||||||||||||||||||
firstPart |
Name of variable specifying:
Give a quoted variable name as in (e.g.) |
|||||||||||||||||||||||
secondPart |
Name of variable specifying:
Give a quoted variable name as in (e.g.) |
|||||||||||||||||||||||
thirdPart |
Name of variable specifying age (in days) for BMI/A. Give a
quoted variable name as in (e.g.) |
|||||||||||||||||||||||
index |
The index to be calculated and added to
Give a quoted index name as in (e.g.) |
|||||||||||||||||||||||
standing |
Variable specifying how stature was measured. If NULL then
age (for |
|||||||||||||||||||||||
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 |
|||||||||||||||||||||||
digits |
The number of decimal places for |
addWGSR()
adds the WHO Growth Reference z-scores to a data frame of
anthropometric data for weight, height or length, MUAC, head circumference,
sub-scapular skinfold, triceps skinfold, and body mass index (BMI).
A data.frame of the survey dataset with the calculated z-scores added.
# 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") # 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")
# 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") # 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")
A subset of data from the National Health and Nutrition Examination Survey
nhanes
nhanes
A data.frame with 339 observations and 10 variables
Variable | Definition |
cid | Unique child identifier |
sex | Sex of child. 1 = male; 2 = female |
agemos | Age in months |
weight | Weight in kilograms |
height | Height in centimetres |
headcir | Head circumference in centimetres |
waz | Weight-for-age z-score |
bmiz | BMI-for-age z-score |
head(nhanes)
head(nhanes)
Initialise built-in Shiny application
run_zscorer()
run_zscorer()
if(interactive()) run_zscorer()
if(interactive()) run_zscorer()
World Health Organization (WHO) Growth Reference (2006) data
wgsData
wgsData
A data frame with 6 columns and 2338 rows.
Variable | Description |
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 |
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.
head(wgsData)
head(wgsData)
These functions still work but will be removed (defunct) in the next version.