This repository provides data and code for reproducing "Estimating population average treatment effects from experiments with noncompliance".
Please cite the paper if you use this code for academic research:
@article{ottoboni2020estimating,
title={Estimating population average treatment effects from experiments with noncompliance},
author={Ottoboni, Kellie N and Poulos, Jason V},
journal={Journal of Causal Inference},
volume={8},
number={1},
pages={108--130},
year={2020},
publisher={De Gruyter}
}
package-list.Rinstall required packagesmain.Rmain run listmain.shshell script for main.R
simulation.Rruns simulations and producesresults/simulation_res.Rdatasimulation-plots.Rloadsresults/simulation_res.Rdataand saves toplots/prepare-ohie.Rmerges OHIE data and saves todata/prepare-ohie.Rdataprepare-NHIS.Rmerges NHIS data and saves todata/prepare-NHIS.Rdataprepare-analysis.Rimports NHIS and OHIE datasets and creates outcome vectors and common covariates for the analysis; saves todata/prepare-analysis.Rdataanalysis.Rproduces empirical estimates; changerun.modelto TRUE to train complier and response models; saves todata/analysis.RdataSuperLearner.RSuper learner helper functionscomplier-mod.RFit complier model ifrun.modelis TRUEcomplier-mod-cv.RCross-validate accuracy of complier model ifrun.modelis TRUEresponse-mod.RFit response models ifrun.modelis TRUEwtc.Rfunction for weighted t-test with cluster-bootstrapped SEs
rct-nrt-compare.Rproduce estimates for Tables A1 and A2estimator-compare-plots.Rsaves heterogeneous treatment effect estimates toplots/placebo-test.Rproduce estimates for Table A3
- Clone a copy of the repository to your working directory with the command
$ git clone https://github.com/jvpoulos/patt-c
- The code uses R version 3.5.2 (2018-12-20). To install this R version on Ubuntu, use the command
$ sudo apt-get install r-base-core=3.5.2-1xenial
- Download and extract pretrained response models to
results/directory: - Open
package-list.Rin a script editor- Verify that all required packages in
package-list.Rare installed in your R library
- Verify that all required packages in
- Open
main.Rin a script editor- Change the file path specified by
repo.directoryto your working directory - Change
patient.simulationto TRUE to run simulation - Save your changes to
main.R
- Change the file path specified by
- Make shell file
main.shexecutable from the Linux/Unix command line:
$ chmod +x main.sh
- Execute the file:
$ ./main.sh > main.txt