Replication in R
R code that regenerates the numbers this paper reports, starting from the dataset published on this site. It reproduces 40 of 42. The 2 that do not match are listed below.
Run it
Rscript run.R
run.R is the whole package. Save it and run it: it reads the dataset from
this site if the CSV is not sitting beside it, and loads the shared conventions file the same way,
so it works on its own in an empty directory. It needs R with fixest, and depending on
the paper lme4, metafor, plm, BMS or
LowRankQP. It writes results.json, one value per number, each named for
where it appears in the paper.
How it compares with Stata
Most of these papers were estimated in Stata, and the two programs differ in places that change
printed digits. Those conventions are stated once, in
stata_compat.R, and shared by every replication on this site:
ivreg2's large-sample variance, SSC winsor's order statistics,
xtreg's treatment of singleton groups, and the restricted-ML default of
xtmixed, which is not the default of the mixed command that replaced it.
Numbers that do not match the printed paper
Cells are named as they are in results.json. The reason for each difference follows the table.
| cell | paper | this code |
|---|---|---|
| T6 long-run FMA mean | -0.07 | -0.069406 |
| T6 female BMA CI low | -0.12 | -0.120548 |
The paper prints -0.070; this code gives -0.069406. The interval printed for the same row, (-0.089, -0.050), is reproduced exactly, and it is symmetric about -0.0694 rather than -0.070, so the printed mean and the printed interval do not come from one number.
The paper prints -0.120; this code gives -0.120548, which rounds to -0.121. The paper's own mean for that row (-0.017) and upper bound (0.087) imply a lower bound of -0.121.
Files
- run.R, the replication
- stata_compat.R, the Stata conventions
- targets.json, the numbers as printed in the paper, taken from the paper rather than from the code
- results.json, the numbers this code produced
- REPLICATION_STATUS.md, the full comparison, generated from this package's own output