Skip to content

ATbounds/ATbounds-replication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replication: Lee and Weidner (forthcoming, Journal of Econometrics)

Replication files for all numerical results in:

Sokbae Lee and Martin Weidner, "Bounding Treatment Effects by Pooling Limited Information across Observations," forthcoming at the Journal of Econometrics and available at arXiv:2111.05243.

Installation

Before running the replication code, install the released version of ATbounds from CRAN:

install.packages("ATbounds")

Alternatively, install the development version of ATbounds from the companion package repository:

# install.packages("devtools") if devtools is not installed
devtools::install_github("https://github.com/ATbounds/ATbounds-r")

The remaining required R packages can be installed with:

install.packages(c("FNN", "xtable", "ggplot2", "sandwich", "lmtest"))

You can check the local R setup from an R session with:

source("check_dependencies.R")

Replication Code

The generated outputs used for the manuscript are included in the corresponding Results/ directories.

With the working directory set to the repository root, run:

source("MC/Table1_MonteCarlo.R")
source("Examples/Table2_RHC.R")
source("Examples/Table3_NSW.R")
source("MC/AppendixTable_MonteCarloInference.R")
source("Examples/NSW_main_text.R")

Specifically:

  • MC/Table1_MonteCarlo.R replicates the main-text Monte Carlo table and writes MC/Results/Table1_MonteCarlo.tex.
  • Examples/Table2_RHC.R replicates the right heart catheterization application table and writes Examples/Results/Table2_RHC.tex and Examples/Results/RHC_ATT_summary.txt.
  • Examples/Table3_NSW.R replicates the Dehejia-Wahba and NSW-treated/PSID2-control application table and writes Examples/Results/Table3_NSW.tex.
  • MC/AppendixTable_MonteCarloInference.R replicates the appendix Monte Carlo inference table and writes MC/Results/AppendixTable_MonteCarloInference.tex.
  • Examples/NSW_main_text.R replicates the NSW main-text mean-difference regressions and writes Examples/Results/NSW_results_in_main_text.txt.

Equivalently, from a command line:

Rscript MC/Table1_MonteCarlo.R
Rscript Examples/Table2_RHC.R
Rscript Examples/Table3_NSW.R
Rscript MC/AppendixTable_MonteCarloInference.R
Rscript Examples/NSW_main_text.R

The Monte Carlo scripts use n = 1000, n_sim = 1000, and seed 234235. They can take substantially longer than the empirical scripts.

For shorter trial runs, the Monte Carlo scripts also accept optional environment variables:

  • N_SIM: overrides the number of Monte Carlo replications.
  • MC_RESULTS_DIR: writes Monte Carlo outputs to an alternative directory.

For example, from a command line:

N_SIM=5 MC_RESULTS_DIR=/tmp/atbounds-mc-test Rscript MC/Table1_MonteCarlo.R

Repository Contents

  • MC/: Monte Carlo scripts and generated LaTeX tables.
  • Examples/: Empirical application scripts and generated LaTeX/text outputs.
  • check_dependencies.R: Checks whether the required R packages are installed.

Data Sources

The Monte Carlo scripts generate simulated data internally.

The RHC application uses the RHC dataset distributed with the ATbounds R package.

The NSW scripts download public data files from Rajeev Dehejia's NBER-hosted data page at runtime. We gratefully acknowledge Rajeev Dehejia and NBER for making these data available. The files are used for the NSW experimental sample, the Dehejia-Wahba NSWRE subsample, and the PSID2 comparison sample:

  • http://users.nber.org/~rdehejia/data/nsw_treated.txt
  • http://users.nber.org/~rdehejia/data/nsw_control.txt
  • http://users.nber.org/~rdehejia/data/nswre74_treated.txt
  • http://users.nber.org/~rdehejia/data/nswre74_control.txt
  • http://users.nber.org/~rdehejia/data/psid2_controls.txt

These data files are not redistributed in this repository. An internet connection is therefore required to rerun the NSW scripts.

Reference

Lee, S. and Weidner, M. (forthcoming). "Bounding Treatment Effects by Pooling Limited Information across Observations." Journal of Econometrics. arXiv:2111.05243.

License

This repository is licensed under the GNU General Public License, version 3.

Releases

No releases published

Packages

 
 
 

Contributors