/causalinferencebook_stata

Stata code for part 2 of the book Causal Inference, by Miguel Hernán and James Robins

Primary LanguageStata

Causal Inference Stata Code

This repo contains Stata code for the book Causal Inference: What If, by Miguel Hernán and James Robins book site.

The code here corresponds to the SAS programs found at the book site.

Data

The data can be obtained from the book site. The do files all assume that the Stata version of the data (.dta) has been saved in the same directory as the do files. To automatically set the working directory, open Stata by directly double-clicking on the do files.

If you open the do files from within Stata you will need to set the working directory manually: before running the command: use "nhefs.dta" add your path (eg. use "C:\Users\Downloads\nhefs.dta")

Author

Ellie Murray