Welcome

This site hosts the HTML version of our book—the pre-copyedited authors’ manuscript—which may differ from the final published edition. It is written for economists, health, and social scientists who want a practical path—from basic concepts and core causal ideas to state-of-the-art ML methods—with reproducible code and applied examples.

Welcome! We wrote this book to fill a real gap: a single, coherent guide that connects econometrics, causal methods grounded in the counterfactual framework, and modern machine learning in the settings you work in. Many resources are either too technical or assume a background that beginners don’t yet have. We take a rigorous but approachable path: early chapters slow down for the essentials—estimation vs. prediction, the bias–variance trade-off, overfitting, tuning, and validation—then build toward the most up-to-date prediction and causal estimation methods you’ll use in practice.

What sets this book apart is its clear guidance on when and how to use predictive and causal tools for real-world policy and business questions—along with unusually plain-language explanations at every step, from concepts and methods to code, so you can build toward state-of-the-art methods with confidence. Each chapter takes you from raw data to estimation with transparent R code, shows what the software is doing under the hood, and uses simulations to reveal how methods behave. You’ll see where the gains come from, what can go wrong, and how to choose methods that fit your question and data.

We cover penalized regression, ensembles and boosting; treatment-effect estimation and heterogeneity; and strategies for selection on observables and unobservables (matching, doubly robust estimation, instrumental variables, difference-in-differences, synthetic control, double machine learning, causal forests, meta-learners), plus machine learning for time series, neural networks and deep learning, matrix decomposition methods, and core optimization algorithms.

By the end, you won’t just know how to use these tools—you’ll understand them. Our aim is a friendly, rigorous companion you can use for learning, research, and teaching, with enough depth to trust the results you present. The Preface outlines the roadmap and how to get the most from the book.