Causal Inference: The Free eBook

Here's another free eBook for those looking to up their skills. If you are seeking a resource that exhaustively treats the topic of causal inference, this book has you covered.

Knowing the difference between causation and correlation is clearly an important skill, generally speaking. Correlation does not imply causation! Being able to distinguish between these concepts in practice is sometimes easier said than done, while generalizing based on these observations is fraught with even greater potential peril. To that end, building yourself a conceptual toolkit to understand and navigate the concepts of causal inference is a worthwhile pursuit. If only there was a book devoted to the topic which we could freely access.

Causal Inference


Enter Causal Inference: What If, written by Miguel Hernán and Jamie Robins, a book committed solely to this broad topic.

Jamie Robins and I have written a book that provides a cohesive presentation of concepts of, and methods for, causal inference. Much of this material is currently scattered across journals in several disciplines or confined to technical articles. We expect that the book will be of interest to anyone interested in causal inference, e.g., epidemiologists, statisticians, psychologists, economists, sociologists, political scientists, computer scientists… The book is divided in 3 parts of increasing difficulty: causal inference without models, causal inference with models, and causal inference from complex longitudinal data.

The book describes itself as being about both the framing of the causal question, as well as the analysis of the underlying data, going on to state the following in its introduction:

In this book, we stress the need to take the causal question seriously enough to articulate it, and to delineate the separate roles of data and assumptions for causal inference. Once these foundations are in place, causal inferences become necessarily less casual, which helps prevent confusion. The book describes various data analysis approaches to estimate the causal effect of interest under a particular set of assumptions when data are collected on each individual in a population. A key message of the book is that causal inference cannot be reduced to a collection of recipes for data analysis.

In order to meet these goals, the book is divided into 3 sections, with the table of contents as follows:

I Causal inference without models

  1. A definition of causal effect
  2. Randomized experiments
  3. Observational studies
  4. Effect modification
  5. Interaction
  6. Graphical representation of causal effects
  7. Confounding
  8. Selection bias
  9. Measurement bias
  10. Random variability

II Causal inference with models

  1. Why model?
  2. IP weighting and marginal structural models
  3. Standardization and the parametric g-formula
  4. G-estimation of structural nested models
  5. Outcome regression and propensity scores
  6. Instrumental variable estimation
  7. Causal survival analysis
  8. Variable selection for causal inference

III Causal inference from complex longitudinal data 233

  1. Time-varying treatments
  2. Treatment-confounder feedback
  3. G-methods for time-varying treatments
  4. Target trial emulation

The book focuses on providing the tools that scientist need to make informed decisions which may involve causal inference. What is this book not?

This is not a philosophy book. We remain agnostic about metaphysical concepts like causality and cause. Instead, we focus on the identification and estimation of causal effects in populations, that is, numerical quantities that measure changes in the distribution of an outcome under different interventions.

Above links point to the book's website. From there, you can access a PDF of the most recent version of the book, as it is continuously being updated (the latest version is dated July 31, 2020). Links to repositories of accompanying code for book exercises can be found for SAS, Stata, R, and Python.

Causal inference is a complex, encompassing topic, but the authors of this book have done their best to condense what they see as the most important fundamental aspects into ~300 pages of text. With few accessible books dedicated to the subject, this one may be your go-to choice if you are interested in building your own conceptual foundation.