Introduction
In our last lesson, we mastered the mechanics of computing counterfactuals for each member of the vee triad. You learned how to use factual observations to perform abduction on the system's latent variables and then predict how each individual would have fared under different, hypothetical circumstances. This gives us the "what if" outcomes, such as , , etc.
Now that we can compute these potential outcomes, we can use them for a more sophisticated purpose: dissecting causal pathways. A total effect, such as the overall impact of a living arrangement on a person's satisfaction, often combines multiple channels of influence. This lesson focuses on using the counterfactuals you now know how to compute to decompose a total effect into its constituent parts—specifically, the direct effect of the intervention on an individual and the indirect or spillover effect that operates through their partners. This decomposition is the key to understanding how and why an intervention succeeds or fails within an interconnected social system.
1. The Logic of Causal Effect Decomposition
The total effect (TE) of an intervention on an individual is the simplest causal quantity, defined as the difference in their expected outcome under treatment versus control. For a given individual i and a binary treatment t, this is:
However, this single number is a black box. In your triadic system, does a new living arrangement (t=1) improve Partner B's satisfaction because it directly suits their personality (a direct effect), or because it first improves Pivot A's mood, which then spills over to Partner B (an indirect effect)?
Mediation analysis, powered by counterfactuals, allows us to open this black box. The core idea is to decompose the total effect into a Natural Direct Effect (NDE) and a Natural Indirect Effect (NIE). The following video provides an excellent conceptual introduction to these quantities and shows how they provide an elegant, additive decomposition of the total effect.
14 - Counterfactuals and Mediation
This video from Brady Neal's "Causal Inference" course explains the fundamentals of mediation analysis using counterfactuals.
Please watch the following segments: First, the section on mediation analysis introduces the concepts. Pay close attention to the formal definitions of the Natural Direct Effect (NDE) and Natural Indirect Effect (NIE). Note how the NDE holds the mediator constant at its "natural" control value, while the NIE isolates the effect of the mediator changing. Next, watch the brief segment on the decomposition itself, which demonstrates algebraically how TE = NDE + NIE.
As the video explains, these effects are defined as follows:
- Natural Direct Effect (NDE): The effect of the treatment on the outcome if the mediator were held at the value it would have naturally taken under the control condition. It captures the influence that does not flow through the mediator.
- Natural Indirect Effect (NIE): The effect on the outcome of the mediator changing from its control value to its treatment value, while the treatment's direct influence is held constant at the treatment level. It captures the influence that does flow through the mediator.
The power of this formulation is that, by simple algebra, the Total Effect decomposes perfectly: TE = NDE + NIE.
2. Decomposing Effects for a Non-Pivot Partner
Let's apply this to your vee triad, which consists of Pivot A and Partners B and C. Consider the effects of the living arrangement (T) on Partner B's satisfaction (Y_B). A simple and plausible causal model is that T has a direct effect on Y_B, but it also affects Y_A (Pivot A's satisfaction), which in turn influences Y_B. In this view, Y_A is a mediator of the treatment effect on Y_B.
The causal graph for Partner B's satisfaction looks like this:

For Partner B, we can define the NDE and NIE as:
-
NDE on Partner B: This is the change in B's satisfaction from the living arrangement, if A's satisfaction were hypothetically frozen at the level it would have been if they were living separately (
T=0). -
NIE on Partner B: This is the change in B's satisfaction caused purely by the change in A's satisfaction (from its
T=0level to itsT=1level), while B is experiencing the direct effects of theT=1arrangement.
Here, the Natural Indirect Effect is precisely the spillover effect. It quantifies the portion of the total effect on B that is transmitted through A. By calculating these two quantities, you can answer a critical question: "Does the new living arrangement make B happier because he likes it (NDE), or because it makes A happier, and her happiness is contagious (NIE)?"
3. Decomposing Effects for the Pivot: A Multi-Mediator Problem
The situation for Pivot A is more complex and more interesting. Her satisfaction, Y_A, might be influenced by the living arrangement T directly, but also by the satisfaction levels of both of her partners, Y_B and Y_C.
This is no longer a simple single-mediator problem. It's a case of multiple, parallel mediators, where the effect of the treatment spills over through several other units simultaneously. This is precisely the scenario of "interference" that violates the classical Stable Unit Treatment Value Assumption (SUTVA).

To handle this, we can turn to a framework designed for such complex settings. The paper "Mediation and spillover effects in group-randomized trials" by VanderWeele and Hong provides the formal tools to decompose an effect in the presence of interference. Their context of a school-wide intervention (T) affecting a child's outcome (Y) both directly and through their own classroom (M_own) and other classrooms (M_spillover) is a perfect analogue for our triad.
Let's map their framework to Pivot A's satisfaction:
- Outcome
Y: Pivot A's satisfaction,Y_A. - Treatment
T: The triadic living arrangement. - "Own-classroom" Mediator
M: Partner B's satisfaction,Y_B. (The choice is arbitrary; it could be C). - "Spillover" Mediator
G: Partner C's satisfaction,Y_C.
With this mapping, we can decompose the total effect on Pivot A into three distinct components.
Mediation and spillover effects in group-randomized trials - PMC - NIH
This paper provides the counterfactual definitions needed to decompose a total effect into direct, within-group mediated, and spillover mediated components. It's a dense but rigorous foundation for your analysis.
Please read Section 2, "Notation, Definitions, and Framework". Focus specifically on subsections 2.4 and 2.5. Pay close attention to how the authors first define the standard Natural Direct and Indirect Effects, and then, in subsection 2.5, show how the Natural Indirect Effect can be further broken down into a "spillover mediated effect" and a "within-classroom mediated effect". This three-part decomposition is exactly what you need.
Applying the definitions from the paper to Pivot A, we get the following decomposition:
-
Natural Direct Effect on A (NDE_A): The effect of the living arrangement on A's satisfaction that is not mediated through changes in either partner's satisfaction. We hold both
Y_BandY_Cto the levels they would have naturally had under the control (T=0) arrangement. -
Indirect Effect via B (NIE_B→A): The effect on A's satisfaction that is mediated only through the change in B's satisfaction, while C's satisfaction is held at its control level. This isolates the
T → Y_B → Y_Apathway. -
Indirect Effect via C (NIE_C→A): The effect on A's satisfaction that is mediated through the change in C's satisfaction, in a world where B's satisfaction has also changed due to the treatment. This isolates the final piece of the puzzle, the
T → Y_C → Y_Apathway.
The total effect on A is the sum of these three components:
This decomposition allows for an exceptionally nuanced analysis. You can now quantify how much of the treatment's effect on the pivot is direct, how much is attributable to the spillover from Partner B, and how much is from the spillover from Partner C. Given your background in simulation, you can see how this works: you would compute these nested counterfactuals using the SCM and the abduction-action-prediction algorithm from our last lesson, and then calculate the differences in their expected values.
Conclusion
In this lesson, you've moved from simply computing counterfactuals to strategically using them to deconstruct causal effects. You now have a formal framework to partition the total effect of an intervention into its direct and indirect (spillover) components, even in a complex, interconnected system like your vee triad.
Key Takeaways:
- The total effect of an intervention can be additively decomposed into a Natural Direct Effect (NDE) and a Natural Indirect Effect (NIE).
- In systems with interference, the NIE represents the spillover effect—the portion of the effect on one individual that is mediated through another.
- For a non-pivot partner (like B), the decomposition is a straightforward NDE vs. NIE (spillover from the pivot).
- For the pivot (A), the effect can be decomposed into three parts: a direct effect, an indirect effect from Partner B, and an indirect effect from Partner C. This provides a detailed map of the causal pathways influencing the central person in the relationship.
In our next lesson, we will continue our exploration of counterfactuals by using them to answer questions about attribution. Specifically, you will learn how to apply counterfactual contrasts to determine how much of a specific satisfaction change can be attributed to a single mediating psychological mechanism, such as a feeling of autonomy or security.