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.R
install required packagesmain.R
main run listmain.sh
shell script for main.R
simulation.R
runs simulations and producesresults/simulation_res.Rdata
simulation-plots.R
loadsresults/simulation_res.Rdata
and saves toplots/
prepare-ohie.R
merges OHIE data and saves todata/prepare-ohie.Rdata
prepare-NHIS.R
merges NHIS data and saves todata/prepare-NHIS.Rdata
prepare-analysis.R
imports NHIS and OHIE datasets and creates outcome vectors and common covariates for the analysis; saves todata/prepare-analysis.Rdata
analysis.R
produces empirical estimates; changerun.model
to TRUE to train complier and response models; saves todata/analysis.Rdata
SuperLearner.R
Super learner helper functionscomplier-mod.R
Fit complier model ifrun.model
is TRUEcomplier-mod-cv.R
Cross-validate accuracy of complier model ifrun.model
is TRUEresponse-mod.R
Fit response models ifrun.model
is TRUEwtc.R
function for weighted t-test with cluster-bootstrapped SEs
rct-nrt-compare.R
produce estimates for Tables A1 and A2estimator-compare-plots.R
saves heterogeneous treatment effect estimates toplots/
placebo-test.R
produce 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.R
in a script editor- Verify that all required packages in
package-list.R
are installed in your R library
- Verify that all required packages in
- Open
main.R
in a script editor- Change the file path specified by
repo.directory
to your working directory - Change
patient.simulation
to TRUE to run simulation - Save your changes to
main.R
- Change the file path specified by
- Make shell file
main.sh
executable from the Linux/Unix command line:
$ chmod +x main.sh
- Execute the file:
$ ./main.sh > main.txt