GithubHelp home page GithubHelp logo

jvpoulos / patt-c Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 563.05 MB

Replication code for "Estimating population average treatment effects from experiments with noncompliance"

Home Page: https://arxiv.org/abs/1901.02991

License: MIT License

R 97.74% Shell 2.26%
causal-inference randomized-controlled-trials noncompliance patt complier-model simulation

patt-c's Introduction

patt-c

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}
}

Description of scripts in code/

  • package-list.R install required packages
  • main.R main run list
    • main.sh 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

Instructions

  • 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.Rare installed in your R library
  • 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
  • Make shell file main.sh executable from the Linux/Unix command line:
$ chmod +x main.sh
  • Execute the file:
$ ./main.sh > main.txt

patt-c's People

Contributors

jvpoulos avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.