Replication in R
R code that regenerates the numbers this paper reports, starting from the dataset published on this site. It reproduces 75 of 88. The 13 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
| cell | paper | this code |
|---|---|---|
| HL_stockpartic_10pp_effect_ols | 0.24 | not computed |
| HL_assetholders_core_ols | 0.21 | not computed |
| HL_assetholders_all_ols | 0.35 | not computed |
| HL_econsig_max_stockpartic_ols | 0.931 | not computed |
| HL_econsig_sd_stockpartic_ols | 0.141 | not computed |
| HL_econsig_max_gdppc_ols | 0.683 | not computed |
| HL_econsig_sd_gdppc_ols | 0.088 | not computed |
| HL_econsig_max_eascredit_ols | -0.119 | not computed |
| HL_econsig_sd_eascredit_ols | -0.02 | not computed |
| HL_econsig_max_realrate_ols | -0.265 | not computed |
| HL_econsig_sd_realrate_ols | -0.019 | not computed |
| HL_econsig_max_ruleoflaw_ols | -0.087 | not computed |
| HL_econsig_sd_ruleoflaw_ols | -0.012 | not computed |
This number is not produced here. The paper's figure is a Bayesian model averaging posterior mean, and no wrapper in stata_compat.R fits BMA, so it is quoted rather than computed. The number shown beside it is the OLS/frequentist-check coefficient on the same variable in the same table, a different estimator, reported for orientation only. Scoring it against the BMA figure would record a failure of the code where the truth is that the quantity was never computed. paper value is a BMA posterior mean (2.4) x 0.10; produced value is the OLS/frequentist-check counterpart (Table 2 marketpartic coef x 0.10), not the same estimator, see REPLICATION_STATUS.md
This number is not produced here. The paper's figure is a Bayesian model averaging posterior mean, and no wrapper in stata_compat.R fits BMA, so it is quoted rather than computed. The number shown beside it is the OLS/frequentist-check coefficient on the same variable in the same table, a different estimator, reported for orientation only. Scoring it against the BMA figure would record a failure of the code where the truth is that the quantity was never computed. paper value is the BMA posterior mean for Asset holders, core-countries specification (Table 2); produced value is the OLS/frequentist-check coefficient on the same variable in the same table
This number is not produced here. The paper's figure is a Bayesian model averaging posterior mean, and no wrapper in stata_compat.R fits BMA, so it is quoted rather than computed. The number shown beside it is the OLS/frequentist-check coefficient on the same variable in the same table, a different estimator, reported for orientation only. Scoring it against the BMA figure would record a failure of the code where the truth is that the quantity was never computed. paper value is the BMA posterior mean for Asset holders, all-countries specification (Table 1); produced value is the OLS/frequentist-check coefficient on the same variable in the same table
This number is not produced here. The paper's figure is a Bayesian model averaging posterior mean, and no wrapper in stata_compat.R fits BMA, so it is quoted rather than computed. The number shown beside it is the OLS/frequentist-check coefficient on the same variable in the same table, a different estimator, reported for orientation only. Scoring it against the BMA figure would record a failure of the code where the truth is that the quantity was never computed. Table 3 economic-significance figure, BMA-based; produced value uses the OLS coefficient in place of the BMA posterior mean, same sample
This number is not produced here. The paper's figure is a Bayesian model averaging posterior mean, and no wrapper in stata_compat.R fits BMA, so it is quoted rather than computed. The number shown beside it is the OLS/frequentist-check coefficient on the same variable in the same table, a different estimator, reported for orientation only. Scoring it against the BMA figure would record a failure of the code where the truth is that the quantity was never computed.
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