How to use this book

Published

December 27, 2025

Modified

November 2, 2026

Keywords

A/B Testing, Causal Inference, Causal Time Series Analysis, Data Science, Difference-in-Differences, Directed Acyclic Graphs, Econometrics, Impact Evaluation, Instrumental Variables, Heterogeneous Treatment Effects, Potential Outcomes, Power Analysis, Sample Size Calculation, Python and R Programming, Randomized Experiments, Regression Discontinuity, Treatment Effects

Get news about the book. Leave your email here.
Found an error or have a suggestion? Submit feedback here.
Follow the book’s page for new content and follow the author.

The scope and structure of this book

Wherever you work, you’ve probably faced questions like “does doing ‘this’ really cause more of ‘that’?” You may have also realized that most learning resources on causal inference are either too academic or hard to access. That’s why I designed this book to be an approachable introduction to the topic. Here you will find the essential concepts you need to start applying causal thinking in your everyday work. The book is divided into three parts:

  • Part I: Foundations. We’ll explore why data alone isn’t enough for causal questions, introducing some of the core concepts needed to reason about cause and effect. You’ll learn to spot biases and practice applying foundational ideas.
  • Part II: Estimating impacts. We’ll study methods like randomized experiments, regression, instrumental variables, RDD, and DiD. You’ll see how to design studies, calculate power, and measure effects in different settings.
  • Part III: Useful, credible estimates, and next steps. We’ll focus on ensuring your findings are actionable. You’ll learn to stress-test results (falsification), translate statistical effects into business metrics, and know which approaches to reach for when this book’s toolkit runs out. <!– In Part IV, we will discuss how to judge causal evidence
    This section helps you critically evaluate causal claims—spotting false conclusions, understanding the limits of different methods, and getting familiar with alternative frameworks and philosophies in causal inference.

In Part V, we build additional step-by-step examples in Python and R
Finally, you’ll put everything into practice with step-by-step examples in Python and R, covering all the major methods introduced in the book. All code and data are provided so you can follow along and build your own analyses. –>

And rest assured: You don’t need an advanced background to follow the ideas here. I explain each concept step by step, with relatable examples to help you practice causal thinking. Take your time with the examples and be patient with yourself as you learn.

Data and code examples in Python and R

To keep things practical, this book uses the data structure you see every day: tabular data (think of it as a spreadsheet).

  • Rows represent individuals (customers, users, products).
  • Columns hold variables (age, purchase amount, group assignment).
  • Data is synthetic, ensuring you can replicate every example yourself.

All data we’ll use are available in the repository. You can download the files there or load an individual file directly by passing its raw URL to read.csv() in R or pd.read_csv() in Python.

You can read this book without running the code, but following along with the exercises is a great way to practice. If you do, you’ll need R or Python installed. If you need a setup guide, see the “Intro” chapter of R for Data Science for R or “Preliminaries” in Python for Data Analysis for Python.