-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
161 lines (117 loc) · 5.88 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# anthrocheckr: An Implementation of Anthropometric Measurement Standardisation Tests <img src="man/figures/logo.png" width="200" align="right" />
<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![R-CMD-check](https://github.com/nutriverse/anthrocheckr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/nutriverse/anthrocheckr/actions/workflows/R-CMD-check.yaml)
[![R build status](https://github.com/nutriverse/anthrocheckr/workflows/test-coverage/badge.svg)](https://github.com/nutriverse/anthrocheckr/actions)
[![Codecov test coverage](https://codecov.io/gh/nutriverse/anthrocheckr/branch/main/graph/badge.svg)](https://app.codecov.io/gh/nutriverse/anthrocheckr?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/nutriverse/anthrocheckr/badge)](https://www.codefactor.io/repository/github/nutriverse/anthrocheckr)
[![DOI](https://zenodo.org/badge/162917178.svg)](https://zenodo.org/badge/latestdoi/162917178)
<!-- badges: end -->
Ensuring the precision and accuracy of measurements is critical when collecting anthropometric data. Anthropometrists are usually tested for precision and accuracy of measurement through standardisation tests performed prior to anthropometric data collection. This package provides functions to calculate inter- and intra-observer technical error of measurement (TEM) to assess precision of measurements.
## What does the package do?
`{anthrocheckr}` provides functions for:
1. Calculating standard summaries for intra-observer or inter-observer measurements;
2. Calculating intra-observer or inter-observer technical error of measurement (TEM) for multiple subjects and for multiple measurers/observers;
3. Calculating multiple measurers/observers relative technical error of measurement (relative TEM);
4. Calculating intra-observer total technical error of measurement (total TEM);
5. Calculating coefficient of reliability; and,
6. Calculating bias in measurements/observation against a gold standard.
## Installation
`{anthrocheckr}` is not yet on [CRAN](https://cran.r-project.org) but can be installed from the [nutriverse R Universe](https://nutriverse.r-universe.dev) as follows:
```{r install-r-universe, eval = FALSE}
install.packages(
"anthrocheckr",
repos = c('https://nutriverse.r-universe.dev', 'https://cloud.r-project.org')
)
```
## Usage
### Calculate intra-observer and/or inter-observer summaries
The *mean*, *standard deviation*, and *maximum difference in measurements* are the requisite summary measures for various anthropometric measurement standardisations tests. These can be calculated as follows:
```{r mean-summary}
## Intra-observer mean for weight ----
weight_df <- subset(smartStdLong, subset = measure_type == "weight")
calculate_mean(weight_df$measure_value, index = weight_df$observer)
```
```{r sd-summary}
## Intra-observer sd for weight ----
calculate_sd(weight_df$measure_value, index = weight_df$observer)
```
```{r max-diff-summary}
## Intra-observer max difference for weight ----
weight_df_wide <- tidyr::pivot_wider(
weight_df,
names_from = c(measure_type, measure_round),
values_from = measure_value, names_sep = "_"
)
calculate_max(
abs(weight_df_wide$weight_1 - weight_df_wide$weight_2),
index = weight_df_wide$observer
)
```
### Calculate intra-observer and inter-observer technical error of measurement (TEM)
```{r calculate-inter-tem, eval = FALSE}
## Inter-observer max difference for weight ----
weight_df_wide <- tidyr::pivot_wider(
weight_df,
names_from = c(measure_type, measure_round),
values_from = measure_value, names_sep = "_"
)
inter_tem <- calculate_tem(
abs(weight_df_wide$weight_1 - weight_df_wide$weight_2),
n = nrow(weight_df_wide)
)
```
which gives
```{r calculate-inter-tem-show, echo = FALSE}
calculate_tem(
abs(weight_df_wide$weight_1 - weight_df_wide$weight_2),
n = nrow(weight_df_wide)
)
```
```{r calculate-intra-tem, eval = FALSE}
## Intra-observer max difference for weight ----
weight_df_wide <- tidyr::pivot_wider(
weight_df,
names_from = c(measure_type, measure_round),
values_from = measure_value, names_sep = "_"
)
intra_tem <- calculate_tem_cohort(
df = weight_df_wide, m1 = "weight_1", m2 = "weight_2",
index = "observer", n = nrow(weight_df_wide)
)
```
which gives
```{r calculate-intra-tem-show, echo = FALSE}
calculate_tem_cohort(
df = weight_df_wide, m1 = "weight_1", m2 = "weight_2",
index = "observer", n = nrow(weight_df_wide)
)
```
### Calculating relative technical error of measurement
```{r calculate-relative-tem}
mean_weight <- calculate_mean(
weight_df$measure_value, index = weight_df$observer
)
calculate_relative_tem(intra_tem$tem, mean_weight$mean)
```
## Citation
If you use the `{anthrocheckr}` package in your work, please cite using the suggested citation provided by a call to the `citation()` function as follows:
```{r citation}
citation("anthrocheckr")
```
## Community guidelines
Feedback, bug reports and feature requests are welcome; file issues or seek support [here](https://github.com/nutriverse/anthrocheckr/issues). If you would like to contribute to the package, please see our [contributing guidelines](https://nutriverse.io/anthrocheckr/CONTRIBUTING.html).
Please note that the `{anthrocheckr}` project is released with a [Contributor Code of Conduct](https://nutriverse.io/anthrocheckr/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.