February 22, 2020

177 words 1 min read

jrfiedler/causal_inference_python_code

jrfiedler/causal_inference_python_code

Python code for part 2 of the book Causal Inference: What If, by Miguel Hernn and James Robins

repo name jrfiedler/causal_inference_python_code
repo link https://github.com/jrfiedler/causal_inference_python_code
homepage
language Jupyter Notebook
size (curr.) 1130 kB
stars (curr.) 476
created 2018-02-04
license

Python Code for Causal Inference: What If

This repo contains Python code for Part II of the book Causal Inference: What If, by Miguel Hernán and James Robins (book site):

Hernán MA, Robins JM (2020). Causal Inference: What If. Boca Raton: Chapman & Hall/CRC.

The code here roughly corresponds to the Stata, R, or SAS programs found at the book site.

Python dependencies

Required Python packages:

  • numpy
  • pandas
  • statsmodels
  • scipy
  • matplotlib
  • linearmodels
  • tqdm

If you use the Anaconda distribution of Python, you’ll have most of those packages already, and you’ll only need to install

  • linearmodels
  • tqdm

Data

The data can be obtained from the book site.

The notebooks all assume that the Excel version of the data has been saved in the same directory as the notebooks.

Author

James Fiedler, with contributions from Petty PY Chen and Piyush Madan

comments powered by Disqus