Welcome back. In our last lesson, we saw Simpson's paradox in action, where a Lace Bralette appeared superior to a Push-Up Bra in the aggregate data, but this trend completely reversed once we stratified by Model Body Type. This illustrated a critical point: a hidden variable, which we called a confounder, can seriously distort our conclusions. We learned to resolve the paradox numerically by adjusting for the confounder.
While that was a powerful demonstration, relying on intuition to spot confounders in complex scenarios is risky. Today, we will learn a formal and visual language for mapping out the causal relationships we believe exist in our data. This tool is the Directed Acyclic Graph (DAG). By the end of this lesson, you will be able to draw a causal DAG for a lingerie photoshoot scenario, clearly identifying the fundamental structures of confounding and another potential source of bias known as a collider. This will set the stage for rigorously identifying the true drivers of style success.
The Grammar of Causality: Directed Acyclic Graphs
A Directed Acyclic Graph is essentially a "causal map." It's a picture that represents your expert assumptions about how the world works for your specific problem. Since you have a strong background in research methodology and causal analysis, you'll recognize this as a way to make your theoretical model explicit before you even touch the data.
A DAG is composed of two simple elements:
- Nodes: These are the variables in your analysis (e.g.,
Lingerie Style,Photoshoot Rating). - Arcs (or Arrows): These represent a direct causal effect from one variable to another.
The "Directed" part means the arrows have a direction, representing the flow of causality. The "Acyclic" part means there are no loops; a variable cannot cause itself, directly or indirectly. This reflects the fundamental rule that causes must precede their effects in time.
To begin, the following video provides a concise introduction to the philosophy of DAGs and their basic components.
Introduction to Causal Inference and Directed Acyclic Graphs
This video from The Ohio State University Libraries distinguishes causal inference from other data science tasks and then introduces the fundamental components of DAGs.
First, watch the segment that defines causal inference from the beginning. This frames why we need tools like DAGs. Then, watch the introduction to the components of a DAG from the next section.
The most important rules to remember are:
- An arrow from
AtoBmeans you assumeAcan cause a change inB. - The absence of an arrow from
AtoBis a very strong assumption: you are stating thatAhas no direct causal effect onB.
The Three Building Blocks of Causal Paths
Amazingly, any complex causal story can be broken down into combinations of just three elementary structures. These are the "atomic units" of your causal map.
Let's explore each one.
1. The Fork (Confounding)
A "fork" structure looks like A ← C → B. Here, C is a common cause of both A and B. This is the classic confounder structure.
This should look familiar! In our previous lesson, the structure was Lingerie Style ← Model Body Type → Photoshoot Rating. Model Body Type was the confounder that created a spurious association between the style and the rating. This kind of path is often called a "backdoor path" because it creates a non-causal connection between the two variables of interest.
The following segment of the video provides an excellent explanation of confounding paths using the classic example of ice cream sales and shark attacks.
Introduction to Causal Inference and Directed Acyclic Graphs
This video segment explains how confounding paths transmit spurious associations and how conditioning on the confounder closes the path.
Please watch the explanation of confounding from this section.
2. The Chain (Mediation)
A "chain" structure is A → M → B. Here, the causal effect of A on B is transmitted through an intermediate variable, M, which is called a mediator.
In our lingerie context, a great example would be:Lingerie Style → Model's Confidence → Photoshoot Rating
Here, the style might improve the rating not just because of its visual appeal, but because it makes the model feel more confident, leading to a better performance and thus a higher rating. Model's Confidence mediates the effect of the style.
3. The Collider
A "collider" is the opposite of a fork: A → C ← B. In this structure, two variables, A and B, are independent causes of a third variable, C. The arrows "collide" at C.
This structure is less intuitive but incredibly important. By default, a collider blocks any association between A and B. They are independent. However, a strange thing happens if we condition on the collider C (for example, by only including a specific value of C in our analysis). Doing so opens a path and creates a spurious, non-causal association between A and B. This leads to a form of bias often called "collider bias" or "selection bias."
The next segment of the video explains this with a brilliant and memorable example involving career success, privilege, and talent.
Introduction to Causal Inference and Directed Acyclic Graphs
This segment explains the counter-intuitive nature of collider paths and how conditioning on them induces bias.
Watch the explanation of colliders from this section.
To solidify your understanding of these three structures, the following reading provides a fantastic summary with helpful scatterplots that visualize how conditioning on each type of variable affects the relationship between X and Y.
4 Expressing causal questions as DAGs - Causal Inference in R
This chapter from Causal Inference in R details the three fundamental path types and their implications for statistical association.
Please read the section starting from the description of forks, chains, and colliders. Pay close attention to the scatterplot figures (Figure 4.4, 4.5, and 4.6) which show the statistical effect of adjusting for a confounder (unbiased), a mediator (direct effect), and a collider (biased).
Drawing Your First Lingerie DAG
Now, let's put this theory into practice. Our goal is to draw a DAG to map the causal factors influencing a lingerie photoshoot's success. We will follow a systematic process, drawing on practical recommendations from experts.
First, watch this final video segment, which outlines a clear, step-by-step process for building a robust DAG.
Introduction to Causal Inference and Directed Acyclic Graphs
This segment provides ten practical recommendations for drawing a good DAG, which we will apply directly to our lingerie design problem.
Watch the section outlining the first six steps for drawing a DAG. Focus on the core ideas of defining the question, considering context, listing variables, and drawing in temporal order.
Let's follow those steps for our photoshoot scenario.
1. Define the Research Question: What is the total causal effect of Lingerie Style on Photoshoot Rating?
2. Define the Context: A single model preparing for a glamour lingerie photoshoot.
3. List Potential Variables:
- Treatment:
Lingerie Style(e.g., Balconette, Plunge, Bralette) - Outcome:
Photoshoot Rating(an appeal score from 1-10) - Model Attributes:
Model Body Type,Model Confidence - Garment Attributes:
Fabric Quality,Garment Comfort - Team Attributes:
Photographer Skill,Stylist's Expertise - Selection Variable:
Selected for Final Edit(a yes/no decision made after the shoot)
4. Order Nodes by Time: This is the most critical step for getting the structure right.
- Time 1 (Pre-existing attributes):
Model Body Type,Photographer Skill,Stylist's Expertise. - Time 2 (Pre-treatment choices):
Fabric Quality(part of the design process before style selection). - Time 3 (Treatment):
Lingerie Styleis chosen for the model. - Time 4 (During the shoot):
Garment Comfort,Model Confidence. These happen after the style is chosen but before the final rating. - Time 5 (Outcome):
Photoshoot Ratingis given. - Time 6 (Post-outcome selection):
Selected for Final Edit.
5. Draw the Arrows (Saturate and Prune): Now, we connect the nodes with arrows representing plausible causal effects.
Let's build the graph step-by-step:
- The main causal path of interest is
Lingerie Style→Photoshoot Rating. - Confounders (Forks): What causes both the style choice and the final rating?
Model Body Type→Lingerie Style(A stylist chooses styles suited for the model).Model Body Type→Photoshoot Rating(Certain body types might be perceived as more appealing for this specific genre of photoshoot, regardless of style).- This creates the confounding path:
Lingerie Style←Model Body Type→Photoshoot Rating.
- Mediators (Chains): How does the style exert its effect?
Lingerie Style→Garment Comfort(Some styles are inherently more comfortable).Garment Comfort→Model Confidence(A comfortable model is a confident model).Model Confidence→Photoshoot Rating(Confidence shows in the final photos).- This creates the mediation path:
Lingerie Style→Garment Comfort→Model Confidence→Photoshoot Rating.
- Colliders: Let's consider the
Selected for Final Editvariable. This decision is likely based on at least two factors: the rawPhotoshoot Ratingand, perhaps, theStylist's Expertise(a top stylist might get their choices included even if the rating isn't perfect).Photoshoot Rating→Selected for Final EditStylist's Expertise→Selected for Final Edit- This creates the collider structure:
Photoshoot Rating→Selected for Final Edit←Stylist's Expertise. If we were to analyze only the photos that made the final edit, we would be conditioning on a collider, creating a spurious relationship between the photo's rating and the stylist's expertise.
Here is a possible DAG representing our causal story:
A Directed Acyclic Graph for a lingerie photoshoot. It identifies Model Body Type as a confounder, Model Confidence as a mediator, and Selected for Final Edit as a collider.
In this DAG, we have successfully identified:
- A confounder (
Model Body Type) that creates a "backdoor path" of non-causal association. - A mediator (
Model Confidence) that lies on the causal pathway from style to rating. - A collider (
Selected for Final Edit) that would induce selection bias if we conditioned on it.
Your Turn: Drawing a DAG
Now it's your turn to apply this process. Imagine you are analyzing data from Instagram to understand what drives engagement.
Scenario:
You want to determine the causal effect of a lingerie set's Primary Color (e.g., Red vs. Black) on the number of Likes a post receives. You believe the Model's Hair Color (e.g., Blonde vs. Brunette) might influence which lingerie color is chosen, and also independently affect the Likes. Furthermore, the Primary Color of the set influences the Photoshoot's Vibe (e.g., "Romantic" for red, "Edgy" for black), which in turn affects Likes. Finally, posts are only published if they pass a Quality Check. This check is influenced by both the Photographer's Skill and the Model's Posing Ability.
Your Task:
- List all the variables mentioned in the scenario.
- Arrange them in a plausible temporal order (what comes first, second, etc.).
- Draw a DAG connecting the variables with causal arrows based on the story.
- From your DAG, identify and label:
- One confounder.
- One mediator.
- One collider.
Click for a possible solution and DAG.
1. Variables:Model's Hair Color, Photographer's Skill, Model's Posing Ability, Primary Color, Photoshoot's Vibe, Quality Check, Likes.
2. Temporal Order:
- Time 1:
Model's Hair Color,Photographer's Skill,Model's Posing Ability(pre-existing attributes). - Time 2:
Primary Color(treatment is chosen). - Time 3:
Photoshoot's Vibe(a result of the color choice). - Time 4:
Quality Check(happens before posting). - Time 5:
Likes(outcome, happens after posting).
3. DAG:
A possible DAG for the Instagram Likes scenario.
4. Identification:
- Confounder:
Model's Hair Color. It's a common cause of the treatment (Primary Color) and the outcome (Likes), creating a backdoor path:Primary Color←Model's Hair Color→Likes. - Mediator:
Photoshoot's Vibe. It lies on the causal path from the treatment to the outcome:Primary Color→Photoshoot's Vibe→Likes. - Collider:
Quality Check. It is a common effect ofPhotographer's SkillandModel's Posing Ability. If you only analyzed posts that passed theQuality Check, you would be conditioning on this collider and would create a spurious association between photographer skill and model posing ability.
Conclusion
In this lesson, you've learned to translate complex causal stories into the clear, unambiguous language of Directed Acyclic Graphs. This powerful skill moves us beyond simply observing correlations and toward a structured way of thinking about causation.
Key Takeaways:
- DAGs are Causal Maps: They make your assumptions about the data-generating process explicit.
- Three Core Structures: All DAGs are built from chains (mediation), forks (confounding), and colliders.
- Confounders Open Backdoor Paths: A common cause of treatment and outcome creates a spurious association that must be blocked.
- Colliders Create Selection Bias: Conditioning on a common effect of two variables creates a spurious association where none existed.
- Time is Key: Arranging your variables chronologically is the most important step in building a correct DAG.
We have now learned how to draw a DAG and identify problematic paths. In our next lesson, we will formalize this knowledge by learning the back-door criterion, a precise rule that uses the DAG to tell us exactly which set of variables we need to control for to isolate the true causal effect of our lingerie style on photoshoot ratings.