How to use this book

Published

December 27, 2025

Modified

December 28, 2025

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 the new chapters straight to your inbox. Leave your address here.
Found an error or have a suggestion? Submit feedback here.
Follow the book’s page for new content and corrections, or 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’?”. And you may have 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 in 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 dive into 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), explore mechanisms, and translate statistical effects into business metrics.

And rest assured: You don’t need any advanced background to master the ideas here. Every concept is broken down step-by-step, with relatable examples. My main goal is for you to feel supported. Stay patient with yourself, let the examples sink in, and trust me. By the end, you’ll surprise yourself with how much you understand and enjoy the journey into causal thinking.

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 it there or load it directly by passing the 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.