knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

anthroplus

R-CMD-check CRAN status

The goal of anthroplus is to provide R functions for the application of the WHO Reference 2007 for 5-19 years to monitor the growth of school-age children and adolescents.

It is modeled after the R Macros of the WHO Reference 2007.

Installation

You can install the released version of anthroplus from CRAN with:

install.packages("anthroplus")

And the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("worldhealthorganization/anthroplus")

Example

Z-scores

This function calculates z-scores for the three anthropometric indicators, weight-for-age, height-for-age and body mass index (BMI)-for-age.

library(anthroplus)
anthroplus_zscores(
  sex = c("1", "f"),
  age_in_months = c(100, 110),
  height_in_cm = c(100, 90),
  weight_in_kg = c(30, 40)
)

The returned value is a data.frame that can further be processed or saved as a .csv file.

You can also use the function with a given dataset with with

your_data_set <- read.csv("my_survey.csv")
with(
  your_data_set,
  anthroplus_zscores(
    sex = sex_column, age_in_months = age_column,
    weight_in_kg = weight_column, height_in_cm = height_column,
    oedema = oedema_column
  )
)

Prevalence estimates

The function to compute the prevalence estimates is similar to anthroplus_zscores in terms of the parameters.

set.seed(1)
anthroplus_prevalence(
  sex = c(1, 2),
  age_in_months = rpois(100, 100),
  height_in_cm = rnorm(100, 100, 10),
  weight_in_kg = rnorm(100, 40, 10)
)[, c(1, 4, 5, 6)]

Using the function with it is easy to apply anthroplus_prevalence to a full dataset.

To look at all parameters, type ?anthroplus_prevalence.

Contributions

Contributions in the form of issues are very welcome. In particular if you find any bugs or cannot reproduce results obtained with other implementations.



WorldHealthOrganization/anthroplus documentation built on Nov. 14, 2024, 8:37 p.m.