forked from WorldHealthOrganization/anthro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
96 lines (69 loc) · 3.45 KB
/
README.Rmd
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
output: github_document
---
[![Travis build status](https://travis-ci.org/dirkschumacher/anthro.svg?branch=master)](https://travis-ci.org/dirkschumacher/anthro)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/dirkschumacher/anthro?branch=master&svg=true)](https://ci.appveyor.com/project/dirkschumacher/anthro)
[![Coverage status](https://codecov.io/gh/dirkschumacher/anthro/branch/master/graph/badge.svg)](https://codecov.io/github/dirkschumacher/anthro?branch=master)
[![CRAN status](https://www.r-pkg.org/badges/version/anthro)](https://cran.r-project.org/package=anthro)
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# Anthro
The `anthro` package allows you to perform comprehensive analysis of anthropometric survey data based on the [method](https://www.who.int/childgrowth/standards/en/) developed by the Department of Nutrition for Health and Development at the World Health Organization.
The package is modelled after the [R macros](https://www.who.int/childgrowth/software/en/) provided by WHO. 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
## Installation
```{r, eval=FALSE}
install.packages("anthro")
```
```{r, eval=FALSE}
remotes::install_github("dirkschumacher/anthro")
```
## Examples
```{r, echo=TRUE}
library(anthro)
```
### Z-Score
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](https://www.who.int/childgrowth/standards/en/).
```{r}
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`
```{r, eval = FALSE}
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`.
### Prevalence estimates
The prevalence estimates are similiar to `anthro_zscores`: again they take vectors instead of a data frame and column names for the aforementioned reasons.
```{r}
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`.
### Contribution
Contributions are always very welcome. Please make sure to post an issue before sending a pull request.
### Using the package in your own analyses
The package has been tested thoroughly, but we cannot guarantee that there aren't any bugs nor comes this with any warranty (as with all open source software). If you find a bug or cannot reproduce results obtained with other implementations, please post an issue.