Skip to content

Commit 0efc564

Browse files
authored
Merge pull request #5 from DevInnovationLab/r&r
R&R
2 parents 11da5f8 + 8052819 commit 0efc564

File tree

229 files changed

+187558
-120937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+187558
-120937
lines changed

LICENSE.md

Lines changed: 174 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,17 @@ The code in this replication package recreates the main data set and results in
88

99
The raw data used in the paper can be found in `data/raw`. The two main raw datasets are `mda.dta`, containing data from MDA trials and created by script 01, and `tt.dta`, contaning data from test-and-treat trials and created by script 02. The data from the Campbell Systematic Reviews was provided by the authors of that study.
1010

11-
[![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)
11+
[![License: Unlicense](https://img.shields.io/badge/License-Unlicense-blue.svg)](http://unlicense.org/)
1212

13-
The data is licensed under a Creative Commons Attribution 4.0 license. See [LICENSE.txt](LICENSE.txt) for details.
13+
The data is licensed under an Unlicense license. See [LICENSE.txt](LICENSE.txt) for details.
1414

1515
## Computational requirements
1616

1717
The code was last run on a **10-core Intel-based laptop with Windows 10 and 16GB RAM**. The entire code ran in less than 20 minutes.
1818

1919
### Software Requirements
2020

21-
- **Stata** code was last run with version 17. The following community-contributed packages are installed in lines (21-35 of `main.do`):
22-
- `estout` (version 3.31 26apr2022)
23-
- `ietoolkit` (version 7.2 04APR2023)
24-
- `metan` (version 4.06 12oct2022)
25-
- `metareg` (v2.6.1 4Nov2008)
26-
- `rsource` (Date: 27 February 2014)
21+
- **Stata** code was last run with version 18. The exact versions of all community-contributed packages last used are included in `code/ado`.
2722
- **R** code was last run with version 4.2.3. The exact versions of all packages last used are listed in `renv.lock`. To install these versions, launch the R project `deworming.RProj` and run `renv::restore()`.
2823

2924
### Controlled Randomness
@@ -32,11 +27,11 @@ Script `07_bayesian hierarchical models.R` runs simulations and a random seed is
3227

3328
## Description of programs/code
3429

35-
All scripts used for data creation and analysis are included in `code`. Scripts 01-03 create or import the raw data in `data/raw`. Scripts 04 and 05 reformat the raw data for use with different functions. Scripts 06-11 analyze the data. See `main.do` for a detailed description of inputs and outputs of each script.
30+
All scripts used for data creation and analysis are included in `code`. Scripts 01-03 create or import the raw data in `data/raw`. Scripts 04 and 05 reformat the raw data for use with different functions. Scripts 06-13 analyze the data. See `main.do` for a detailed description of inputs and outputs of each script.
3631

37-
[![License: Unlicense](https://img.shields.io/badge/License-Unlicense-blue.svg)](http://unlicense.org/)
32+
[![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)
3833

39-
The code is licensed under an Unlicense license. See [LICENSE.txt](LICENSE.txt) for details.
34+
The code is licensed under a Creative Commons Attribution 4.0 license. See [LICENSE.txt](LICENSE.txt) for details.
4035

4136
## Instructions to Replicators
4237

@@ -53,7 +48,7 @@ The provided code reproduces all tables and figures in the paper, except for the
5348
|-------------------|--------------------------------|-------------|----------------------------------|---------------------------------|
5449
| Table 1 | `code/10_metan.do` | 2 | output/tables/table1.csv ||
5550
| Table 2 | `code/10_metan.do` | 47 | output/tables/table2.csv ||
56-
| Table 3 | `code/10_metan.do` | 125 | output/tables/table3.csv | Columns 7-12? |
51+
| Table 3 | `code/10_metan.do` | 125 | output/tables/table3.csv | Columns 7-12 use estimates from GiveWell (2017), Kristjansson et al. (2007), Kristjansson et al. (2015a), Kristjansson et al. (2016), and Neumann (2003). |
5752
| Figure 1 | `code/06_forest_plots.R` | | output/figures/figure1.png ||
5853
| Figure 2 | `code/06_forest_plots.R` | | output/figures/figure2.png ||
5954
| Figure 3 | `code/06_forest_plots.R` | | output/figures/figure3.png ||
@@ -64,8 +59,11 @@ The provided code reproduces all tables and figures in the paper, except for the
6459
| Table S4 | `code/10_metan.do` | 320 | output/tables/tableS4.csv ||
6560
| Table S5 | `code/10_metan.do` | 365 | output/tables/tableS5.csv ||
6661
| Table S6 | `code/10_metan.do` | 400 | output/tables/tableS6.csv ||
67-
| Table S7 | | | | This table is created in Excel using values from tables 2 and 3 doing additional calculations. |
62+
| Table S7 | | | | This table is created in Excel using values from tables 2 and 3 |
6863
| Table S8 | `code/08_clean_stan_output.do` | | output/tables/tableS8.csv ||
69-
| Table F1 | `code/09_publication_bias.R` | 75 | output/tables/tableF1.png | Panels B and C were created by inputing the data in `data/pub_bias` into [this app](https://maxkasy.github.io/home/metastudy/) |
70-
| Table F2 | `code/09_publication_bias.R` | 75 | output/tables/tableF1.png | Panels B and C were created by inputing the data in `data/pub_bias` into [this app](https://maxkasy.github.io/home/metastudy/) |
64+
| Figure S1 | `code/13_compare_to_TMSDG.R` | | output/figures/figureS1.png ||
65+
| Table F | `code/12_tableF.do` | | output/tables/tableF.csv ||
66+
| Table F1 | `code/09_publication_bias.R` | 162 | output/tables/andrews-kasy-bias-1.csv ||
67+
| Table F2 | `code/09_publication_bias.R` | 252 | output/tables/andrews-kasy-bias-2.csv ||
68+
| Figure F1 | `code/09_publication_bias.R` | 48 | output/figures/figureF1.png ||
7169
| Figure F1 | `code/09_publication_bias.R` | 48 | output/figures/figureF1.png ||

code/01_mda_data_entry.do

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ replace flag_sd=0 in 25
14971497
**## Willett 1979 ==============================================================
14981498
replace trial="Willett 1979" in 26 /*Individual RCT*/
14991499
replace name="Willett, Kilama adn Kihamia (1979)" in 26
1500-
replace N="individualss" in 26
1500+
replace N="individuals" in 26
15011501
replace country="Tanzania" in 26
15021502
replace doses=4 in 26
15031503
replace drug="Levamisole 2.5mg/kg" in 26
@@ -1645,7 +1645,7 @@ replace flag_sd=0 in 30
16451645

16461646

16471647
**## Le Houng 2007b ============================================================
1648-
replace trial="Le Huong 2007b" in 31 /*Individual RCT: MEB vs placebo*/
1648+
replace trial="Le Huong 2007b" in 31 /*Individual RCT: Fe + MEB vs Fe*/
16491649
replace name="Le Huong et al. (2007)" in 31
16501650
replace N="individuals" in 31
16511651
replace country="Vietnam" in 31
@@ -2010,7 +2010,6 @@ label var nmuacc2 "Final number of observations control group for MUAC analysis"
20102010
gen TMSDGsamplehem = inlist(trial, "Dossa 2001a", ///
20112011
"Dossa 2001b", ///
20122012
"Le Huong 2007a", ///
2013-
"Le Huong 2007b", ///
20142013
"Kruger 1996a", ///
20152014
"Awasthi 2000", ///
20162015
"Goto 2009", ///
@@ -2023,9 +2022,11 @@ lab var TMSDGsamplehem "TMSDG's hemoglobin sample"
20232022

20242023
gen morehem = inlist(trial, "Kruger 1996b", ///
20252024
"Liu 2017", ///
2025+
"Le Huong 2007b", ///
20262026
"Ostwald 1984", ///
20272027
"Carmona-Fonseca 2015a", ///
20282028
"Carmona-Fonseca 2015b")
2029+
20292030
lab var morehem "Additional estimates on hemoglobin"
20302031

20312032
foreach var in pehemob sehemob nhemobc nhemobt {

code/06_forest_plots.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ estimates <-
2525
yi = data$mean_diff,
2626
sei = data$se_mean_diff,
2727
method = "DL",
28-
slab = data$study)
28+
slab = data$study
29+
)
2930
}
3031

3132
pval <-

code/08_clean_stan_output.do

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,6 @@ gsort -parameter model_desc stat
137137
drop parameter stat
138138

139139
export delimited using "${output_tables}/tableS8.csv", replace
140+
export excel using "${output}/Formatted tables.xlsx", sheet("ts8_raw") sheetreplace
140141

141142
********************************************************************************

0 commit comments

Comments
 (0)