Replication in R

R code that regenerates the numbers this paper reports, starting from the dataset published on this site. It reproduces 85 of 95. The 10 it does not produce 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 this code does not produce

cellpaperthis code
T2_PanelB_Top10_kappa_PAPER_VALUE_NOT_REPRODUCED0.31not computed
T2_PanelB_WAAP_kappa_PAPER_VALUE_NOT_REPRODUCED0.325not computed
T2_PanelB_Stem_kappa_PAPER_VALUE_NOT_REPRODUCED0.355not computed
T2_PanelB_Kinked_kappa_PAPER_VALUE_NOT_REPRODUCED0.32not computed
T2_PanelB_Selection_kappa_PAPER_VALUE_NOT_REPRODUCED0.274not computed
T2_PanelB_puniform_kappa_PAPER_VALUE_NOT_REPRODUCED0.386not computed
T2_all12_min0.274not computed
T2_all12_max0.386not computed
T2_all12_mean0.335not computed
T2_all12_median0.338not computed

Files