A Law of Iterated Expectation Primer for Causal Inference
Abstract
The g-formula is a foundational tool for identifying causal effects in observational data. This tool is based on the law of iterated expectation, a key mathematical identity in statistics. However, the notation with which the law of iterated expectation and the g-formula is expressed can be opaque to those with little background in statistics. We provide a primer introducing the law of iterated expectation, the integration notation used to express it, and its role for causal effect identification via the g-formula. Combined with the assumptions of causal consistency, positivity, and conditional exchangeability, the law of iterated expectation yields a causal standardization formula (the g-formula) in two nonparametrically equivalent forms: a non-iterative conditional expectation (NICE) form involving a single weighted average of conditional outcome means, and an iterative conditional expectation (ICE) form involving nested expectations. We illustrate both forms using three progressively complex numerical examples: a time-fixed example with a single binary confounder, a time-fixed example with discrete and continuous confounders, and a time-varying example with two timepoints. We provide clarity on what the law of iterated expectation is, how it is related to the g-formula, and how to gain intuition of its mathematical formulations in actual data examples that can be generalized to a range of settings.
Related
- Iterated Lavrentiev regularization under random noise: variational source conditions and rates in expectation
- Anytime-Valid Inference in Linear Models with Applications to Regression-Adjusted Causal Inference
- Spatial causal inference in the presence of unmeasured confounding and interference
- Causal Inference with Generative Artificial Intelligence: Application to Texts as Treatments
- Debiasing and t -Tests for Synthetic Control Inference on Average Causal Effects
BibTeX
@misc{naimi2026iterated,
title = {{A Law of Iterated Expectation Primer for Causal Inference}},
author = {Ashley I. Naimi and Razieh Nabi and Lindsay J. Collin and Zhaohua Zeng and Paul N. Zivich and Stephen R. Cole},
howpublished = {arXiv},
year = {2026},
month = oct,
doi = {10.48550/arxiv.2606.20078},
eprint = {2606.20078},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2606.20078},
note = {CC BY 4.0},
}
RIS
TY - UNPB
TI - A Law of Iterated Expectation Primer for Causal Inference
AU - Ashley I. Naimi
AU - Razieh Nabi
AU - Lindsay J. Collin
AU - Zhaohua Zeng
AU - Paul N. Zivich
AU - Stephen R. Cole
PY - 2026
DA - 2026/10/01
PB - arXiv
DO - 10.48550/arxiv.2606.20078
UR - https://arxiv.org/abs/2606.20078
AB - The g-formula is a foundational tool for identifying causal effects in observational data. This tool is based on the law of iterated expectation, a key mathematical identity in statistics. However, the notation with which the law of iterated expectation and the g-formula is expressed can be opaque to those with little background in statistics. We provide a primer introducing the law of iterated expectation, the integration notation used to express it, and its role for causal effect identification via the g-formula. Combined with the assumptions of causal consistency, positivity, and conditional exchangeability, the law of iterated expectation yields a causal standardization formula (the g-formula) in two nonparametrically equivalent forms: a non-iterative conditional expectation (NICE) form involving a single weighted average of conditional outcome means, and an iterative conditional expectation (ICE) form involving nested expectations. We illustrate both forms using three progressively complex numerical examples: a time-fixed example with a single binary confounder, a time-fixed example with discrete and continuous confounders, and a time-varying example with two timepoints. We provide clarity on what the law of iterated expectation is, how it is related to the g-formula, and how to gain intuition of its mathematical formulations in actual data examples that can be generalized to a range of settings.
ER -