Skip to content
Replication code for "Estimating population average treatment effects from experiments with noncompliance"
R Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


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:

       author = {{Ottoboni}, Kellie and {Poulos}, Jason},
        title = "{Estimating population average treatment effects from experiments with noncompliance}",
      journal = {arXiv e-prints},
     keywords = {Statistics - Methodology, Economics - Econometrics, Statistics - Applications},
         year = "2019",
        month = "Jan",
          eid = {arXiv:1901.02991},
        pages = {arXiv:1901.02991},
archivePrefix = {arXiv},
       eprint = {1901.02991},
 primaryClass = {stat.ME},
       adsurl = {},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}

Description of scripts in code/

  • package-list.R install required packages
  • main.R main run list
    • shell script for main.R
  • simulation.R runs simulations and produces results/simulation_res.Rdata
  • simulation-plots.R loads results/simulation_res.Rdata and saves to plots/
  • prepare-ohie.R merges OHIE data and saves to data/prepare-ohie.Rdata prepare-NHIS.R merges NHIS data and saves to data/prepare-NHIS.Rdata
  • prepare-analysis.R imports NHIS and OHIE datasets and creates outcome vectors and common covariates for the analysis; saves to data/prepare-analysis.Rdata
  • analysis.R produces empirical estimates; change run.model to TRUE to train complier and response models; saves to data/analysis.Rdata
    • SuperLearner.R Super learner helper functions
    • complier-mod.R Fit complier model if run.model is TRUE
    • complier-mod-cv.R Cross-validate accuracy of complier model if run.model is TRUE
    • response-mod.R Fit response models if run.model is TRUE
    • wtc.R function for weighted t-test with cluster-bootstrapped SEs
  • rct-nrt-compare.R produce estimates for Tables A1 and A2
  • estimator-compare-plots.R saves heterogeneous treatment effect estimates to plots/
  • placebo-test.R produce estimates for Table A3


  • Clone a copy of the repository to your working directory with the command
$ git clone
  • 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.Rare installed in your R library
  • Open main.R in a script editor
    • Change the file path specified by to your working directory
    • Change patient.simulation to TRUE to run simulation
    • Save your changes to main.R
  • Make shell file executable from the Linux/Unix command line:
$ chmod +x
  • Execute the file:
$ ./ > main.txt
You can’t perform that action at this time.