knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The anthro
package allows you to perform comprehensive analysis of anthropometric survey data based on the method developed by the Department of Nutrition for Health and Development at the World Health Organization.
The package is modeled after the original R macros provided by WHO. In addition to z-scores, the package adds more accurate calculations of confidence intervals and standard errors around the prevalence estimates, taking into account complex sample designs, whenever is the case by using the survey package.
install.packages("anthro")
remotes::install_github("worldhealthorganization/anthro")
library(anthro)
This function calculates z-scores for the eight anthropometric indicators, weight-for- age, length/height-for-age, weight-for-length/height, body mass index (BMI)-for-age, head circumference-for-age, arm circumference-for-age, triceps skinfold-for-age and subscapular skinfold-for-age based on the WHO Child Growth Standards.
anthro_zscores( sex = c(1, 2, 1, 1), age = c(1001, 1000, 1010, 1000), weight = c(18, 15, 10, 15), lenhei = c(120, 80, 100, 100) )
The returned value is a data.frame
that can further be processed or saved as a .csv
file as in the original function.
You can also use the function with a given dataset with with
your_data_set <- read.csv("my_survey.csv") with( your_data_set, anthro_zscores( sex = sex, age = age_in_days, weight = weight, lenhei = lenhei ) )
To look at all parameters, type ?anthro_zscores
.
The prevalence estimates are similar to anthro_zscores
: again they take vectors instead of a data frame and column names for the aforementioned reasons.
anthro_prevalence( sex = c(1, 2, 2, 1), age = c(1001, 1000, 1010, 1000), weight = c(18, 15, 10, 15), lenhei = c(100, 80, 100, 100) )[, 1:5]
Using the function with
it is easy to apply anthro_prevalence
to a full dataset.
To look at all parameters, type ?anthro_prevalence
.
Contributions in the form of issues are very welcome. In particular if you find any bugs.
The package has been tested thoroughly, but we cannot guarantee that there aren't any bugs nor comes this with any warranty. If you find a bug or cannot reproduce results obtained with other implementations, please post an issue.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.