Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 15

Causal and Bayesian Reasoning in Decision-Making: A Case Study

Recommended resources

Welcome to our final lesson.

Over the past two weeks, we have journeyed from the foundational question of "What is probability?" to the heights of causal reasoning. We've explored the philosophical commitments of different probability interpretations, the logic of Bayesian belief revision, the structure of causal models, and how to update our beliefs about those very structures.

Today, we will synthesize all of these ideas. Our goal is to fulfill the final learning outcome of the course: Analyze a case study to demonstrate how causal and Bayesian reasoning combine to guide decision-making. We will use Simpson's Paradox, a classic statistical puzzle, as our laboratory. You'll see how the apparent paradox dissolves when we apply a causal lens, and how Bayesian methods provide the engine for robust inference and decision-making under uncertainty. This lesson will unite the philosophical "why" with the practical "how."

1. The Decision Dilemma: Simpson's Paradox

Simpson's Paradox occurs when a statistical association observed in an entire population is reversed within all of its subgroups. This is not just a mathematical curiosity; it presents a genuine dilemma for decision-making. Should we trust the aggregate data or the partitioned data when deciding on a course of action?

Let's begin by examining a clear, modern illustration of the paradox.

1.2 - Motivating Example: Simpson’s Paradox

The following video from Brady Neal's Causal Inference course presents a hypothetical medical scenario involving a new disease, COVID-27, and two treatments. This will set up the core problem we will analyze throughout this lesson.

Please watch from the beginning to 05:28. The first part (to 03:17) introduces the paradox: Treatment A looks better overall, but Treatment B looks better for both mild and severe cases. The second part (03:17-05:28) explains the mathematical reason for the reversal, which, given your background in statistics, will be straightforward. Focus on the core conflict: which treatment should a policymaker choose?

The data presents a clear conflict:

  • Aggregated Data: 16% mortality for Treatment A vs. 19% for Treatment B. Suggests choosing A.
  • Partitioned Data:
    • Mild Condition: 15% (A) vs. 10% (B). Suggests choosing B.
    • Severe Condition: 30% (A) vs. 20% (B). Suggests choosing B.

If you had to advise a national health authority, what would you recommend? The numbers alone are insufficient. The correct choice depends entirely on the causal story that generated these numbers.


2. The Causal Resolution: Confounders vs. Mediators

As the video goes on to explain, the right decision hinges on the causal relationship between the treatment (T), the patient's condition (C), and the outcome (Y). Let's watch the two scenarios presented.

1.2 - Motivating Example: Simpson’s Paradox

This next segment presents two different causal graphs that could explain the data and lead to opposite conclusions.

Watch from 05:39 to 10:55. Pay close attention to the two causal graphs presented and the real-world stories that justify them. Scenario 1 (05:39-07:58): The graph is C -> T -> Y with C -> Y. 'Condition' is a common cause of 'Treatment' and 'Outcome'. This is a classic confounding structure. Scenario 2 (07:58-10:55): The graph is T -> C -> Y with T -> Y. 'Condition' is on the causal pathway from 'Treatment' to 'Outcome'. This is a mediation structure.

This distinction is the key to resolving the paradox from a causal perspective:

  • If 'Condition' is a Confounder: Doctors assign the scarce Treatment B to more severe cases. The reason Treatment B looks worse in the aggregate data is not because it's ineffective, but because it's being given to sicker patients who are more likely to die anyway. To find the true effect of the treatment, we must block this confounding path. We do this by conditioning on (i.e., looking within the subgroups of) 'Condition'. The partitioned data is the correct guide. Decision: Choose Treatment B.

  • If 'Condition' is a Mediator: Treatment B is scarce, causing a waiting time that worsens a patient's condition. The treatment itself has a causal effect on the condition. To assess the total effect of choosing Treatment B (including any negative effects from waiting), we must not condition on the mediator 'Condition', as that would block part of the very causal effect we want to measure. The aggregated data is the correct guide. Decision: Choose Treatment A.

This brings us to the formal heart of causal inference. Deciding whether to partition the data is not a statistical choice; it's a causal one. Judea Pearl's framework provides the formal tools for this.

Simpson's Paradox

Let's turn to the Stanford Encyclopedia of Philosophy entry on Simpson's Paradox to formalize this reasoning.

Please read section 3.4, 'Confounding and Pearl’s Analysis of the Paradox'. This section is critical. It introduces the back-door criterion, which gives us a formal rule for when we can condition on a variable (like 'Condition') to identify a causal effect. Focus on how the causal graph dictates the statistical procedure. Equation (5) in this section is the famous 'back-door adjustment formula,' which tells us how to calculate the interventional probability P(Y|do(X)) from observational data, provided our causal assumptions are correct.

The causal analysis gives us a clear decision rule: draw the DAG based on your background knowledge, then use the rules of do-calculus (like the back-door criterion) to determine the right statistical analysis to estimate the causal effect.


3. The Bayesian Synthesis: Modeling Causal Assumptions

The causal analysis is powerful, but it leaves two crucial questions unanswered:

  1. How do we quantify the treatment's effect and our uncertainty about it?
  2. What if our causal graph is just a hypothesis? How do our conclusions hold up?

This is where Bayesian reasoning provides the engine for inference. We can build a statistical model that explicitly encodes our causal assumptions (the DAG) and then use Bayesian methods to estimate the parameters of interest. The posterior distributions of these parameters will represent our full state of knowledge and uncertainty.

Let's walk through a practical example using a Bayesian modeling framework.

Simpson's paradox — PyMC example gallery

The following PyMC example provides a hands-on demonstration of modeling a Simpson's Paradox scenario. It shows what happens when you use a model that ignores the causal structure versus one that correctly includes it.

Please read through the example from the start down to the end of 'Model 2'. Introduction & Data: Note how the simulated data is constructed to have a negative relationship within groups but a positive one overall. Model 1: Pooled Regression: This model is based on the incorrect causal DAG x -> y. It ignores the confounding 'group' variable. Look at the resulting posterior for the slope parameter—it's positive. This is the statistical trap. Model 2: Unpooled regression with confounder included: This model is based on the correct causal DAG where 'group' is a common cause of 'x' and 'y'. Notice how this model correctly estimates a negative slope within each group. This resolves the paradox.

This example beautifully synthesizes our course themes:

  • Causal Assumption: The choice between Model 1 and Model 2 is a choice between two different causal hypotheses. Model 2's structure, group -> x and group -> y, directly reflects the confounding scenario from the medical example (Condition -> Treatment and Condition -> Outcome).
  • Bayesian Inference: By fitting the model, we get a full posterior distribution for the slope (the treatment effect). This tells us not only the most likely effect size but also our uncertainty about it. A decision-maker can then ask questions like, "What is the probability that the effect of this treatment is greater than zero?"
  • Decision-Making: The Bayesian model, specified according to the correct causal structure, provides the posterior distribution for the parameter that answers our causal question. In the medical example with a confounding structure, we would build a model like Model 2. Our decision to use Treatment B would be based on the posterior distributions for its effect within the 'mild' and 'severe' subgroups. If the evidence credibly points to a benefit in both, the decision is clear.

The PyMC example uses conditioning on the group variable to arrive at the correct answer. In Pearl's language, this is equivalent to applying the back-door adjustment to estimate the interventional distribution . The Bayesian model gives us a posterior distribution over the parameters of this very distribution.

PyMCon Web Series - Bayesian Causal Modeling - Thomas Wiecki

To explicitly connect this Bayesian modeling with the do-operator, let's watch a final clip from Thomas Wiecki.

Watch from 21:08 to 26:44 and then from 29:10 to 32:57. The first segment introduces the 'do-operator' as a way to simulate interventions by structurally changing the model. The second segment shows how to use posterior predictive sampling to calculate the Average Treatment Effect (ATE) and, crucially, its full posterior distribution. This is the ultimate goal: a belief distribution over a causal quantity.


Conclusion: A Unified Framework for Rational Decision-Making

This case study has brought together the two pillars of our course. We have seen that to navigate a complex decision, we need both causal and Bayesian reasoning.

  • Causal reasoning provides the logical scaffolding. It uses directed acyclic graphs to represent our assumptions about the world, allowing us to distinguish correlation from causation and identify what quantity we need to estimate to make a good decision (e.g., ). It tells us what to ask.

  • Bayesian reasoning provides the inferential engine. It allows us to take our causal hypothesis, encode it in a probabilistic model, and learn from data. It provides not just a point estimate of the causal effect but a complete representation of our uncertainty, which is the necessary input for rational decision-making. It tells us how to answer.

The apparent paradox in the raw numbers was a symptom of ignoring causal structure. By first reasoning causally about the data-generating process and then using Bayesian methods to estimate the causally-identified effect, the paradox vanishes, and a clear path for decision-making emerges.

This synthesis is the core of modern causal data science and, more broadly, a powerful model for scientific reasoning itself. You began this course seeking the philosophical underpinnings connecting probability, belief, and causality. I hope this journey has provided that connection, showing how these ideas form a cohesive, powerful framework for thinking about the world and acting within it.

Thank you for your engagement and curiosity throughout this course.