Skip to content
Proyek

jrfiedler/causal_inference_python_code

Lihat di GitHub

Tentang

Kode Python untuk bagian 2 buku Causal Inference: What If karya Miguel Hernán dan James Robins

Data dan analisis

Cara angka ini diukur

1,369 bintang413 Fork +1 dalam 24 jam

Pertumbuhan bintang terukur

dalam 24 jam
+1
dalam 7 hari
+3
dalam 15 hari
+4
dalam 1 bulan
+6

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

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.

This Python version roughly corresponds to the Stata, R, or SAS programs found at the book site, and was also translated into Julia, here.

The code in this repo has been checked against the 30 March 2021 version of the book.

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

Jelajahi proyek terkait

Memuat…