arXiv ScienceSearch

arXiv · 2606.20078

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. Under the assumptions of causal consistency, positivity, and conditional exchangeability, the law of iterated expectation can be rewritten as 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.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Ashley I. Naimi, Razieh Nabi, Lindsay J. Collin, Paul N. Zivich, Stephen R. Cole. 2026-06-18. A Law of Iterated Expectation Primer for Causal Inference. https://arxiv.org/abs/2606.20078

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Statistical Compatibility, Refutational Information, and Acceptability

This paper develops an interpretive framework for divergence P-values and S-values within a descriptive frequentist perspective. Statistical analysis is framed as operating within idealized worlds defined by a set of assumptions and a target hypothesis, where probabilities describe the behavior of data under the model but do not assign truth values to hypotheses. Within this view, P-values are interpreted as graded indices of compatibility between the observed result and the predictions generated by the assumed model; accordingly, small P-values should not be read as indicating logical impossibility or strict inconsistency of the model itself. Building on this distinction, the paper argues that practical inference requires moving beyond the internal logic of the model toward judgments of overall acceptability, which depend not only on data-model compatibility but also on multiple contextual considerations such as subject-matter knowledge, plausibility of assumptions, data quality, usefulness, and loss - all interpreted through the competence, intentions, perceptions, and moral values of the specific analyst. S-values are therefore interpreted not as evidence against the epistemic status of the model, but as a specific form of refutational information that contributes to the broader body of information used by the analyst to judge whether a model remains acceptable for an intended practical purpose. The paper also examines the linguistic and conceptual risks associated with the language of incompatibility, distinguishes probability from rarity, and clarifies different notions of surprise - including a possible definition of Shannon-type surprise, to be distinguished from Bayesian belief revision. Overall, the article proposes a more cautious and explicit interpretation of frequentist measures, centered on model-based description, analyst responsibility, and decision acceptability.

stat.OT

The Design and Implementation of a Virtual Statistical Computing Lab to Teach R Coding to Introductory Statistics Students

Motivated by national calls for computationally enriched, data-centric instruction across the statistics curriculum, this study investigates the design, implementation, and impact of a Virtual Statistical Computing Lab (VSCL) integrated into an introductory statistics course at a medium-sized minority-serving university in the USA. The redesigned course embedded R-based coding through two virtual lab formats: Design I (a static Posit Cloud environment) and Design II (an interactive learnr-based interface). Using a quasi-experimental design across three instructional formats, traditional (no lab), Design I, and Design II, we evaluated students' conceptual learning gains, levels of data science (DS) readiness, and DS aspirations. The results indicated significant learning gains across all groups, with the highest gains observed in Design II. Students in both VSCL formats achieved greater gains in DS readiness than the traditional group, with Design II again yielding the largest gains across the demographic subgroups. Conversely, DS aspirations remained low or declined, suggesting a gap between skill acquisition and long-term interest. These findings highlight the value of structured, interactive computing environments in supporting statistical reasoning and building confidence in modern data tools. They also point to the need for intentional curricular bridges and career mentoring to help students translate early computing exposure into sustained academic and professional pathways in statistics and data science.

stat.OT

Statistical Theory in the Age of Machine-Assisted Mathematics: Rethinking How Theory Is Made and Taught

The computational revolution is advancing at an unprecedented pace. The combination of proof-assistant technologies and generative AI tools has recently enabled the solution of complex problems in pure mathematics at a scale that seemed unattainable only a few years ago. However, these technologies have not yet become standard tools in the development of statistical theory. In this paper, we do not present new theoretical results. Instead, we discuss five case studies involving classical problems in statistics and describe how they can be analyzed using a machine proof-checking. Our goal is not to propose a definitive workflow, but to stimulate reflection on how these technologies may transform theoretical research and advanced statistical education. We focus on two main aspects. First, statistical theory often compresses substantial mathematical content into expressions such as "under the usual regularity conditions". Formalization in a machine-verifiable language forces each assumption to be explicit, reveal hidden dependencies, and provide a deeper understanding of the formalized objects. Second, we argue that the statistical community could benefit from a collaborative effort to build repositories of formalized axioms, definitions, and theorems, supporting more precise and reliable theoretical developments. Finally, we discuss the role of these tools in graduate education. Just as high-level programming languages revolutionized empirical research by enabling rapid experimentation and prototyping, machine-assisted formalization may introduce a new paradigm for the development, verification, and communication of statistical theory.

stat.OT