-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
100 lines (76 loc) · 2.59 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
97
98
99
100
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# anthroplus
<!-- badges: start -->
[![R-CMD-check](https://github.com/WorldHealthOrganization/anthroplus/workflows/R-CMD-check/badge.svg)](https://github.com/WorldHealthOrganization/anthroplus/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/anthroplus)](https://CRAN.R-project.org/package=anthroplus)
<!-- badges: end -->
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](https://www.who.int/tools/growth-reference-data-for-5to19-years/application-tools).
## Installation
You can install the released version of anthroplus from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("anthroplus")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# 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.
```{r example}
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`
``` r
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.
```{r example2}
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.