Skip to content

jrfiedler/causal_inference_julia_code

Repository files navigation

Julia Code for Causal Inference: What If

This repo contains Julia 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.

These notebooks were translated from the Python version here, and the code also roughly corresponds to the Stata, R, or SAS programs found at the book site.

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

Dependencies

Required Julia packages:

  • IJulia.jl
  • CSV.jl
  • DataFrames.jl
  • CategoricalArrays.jl
  • CairoMakie.jl
  • StatsBase.jl
  • GLM.jl
  • Distributions.jl
  • Roots.jl
  • Econometrics.jl
  • PyCall.jl

PyCall.jl allows you to call Python code from within Julia. See PyCall's GitHub page for more information, in particular about the Python installation used. Within that Python installation, you'll also need Statsmodels package. You might want to use the Conda.jl package to install Statsmodels. If you're familiar with Python and know which Python installation is being used, you can install Statsmodels in one of the usual ways.

Data

The data can be obtained from the book site.

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

Author

James Fiedler

About

Julia code for part 2 of the book Causal Inference: What If, by Miguel Hernán and James Robins

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published