Skip to Content

Example: Augmented Simpson’s Paradox

Now that we have seen how to estimate the Average Causal Effect by manually interacting with BayesiaLab’s Monitors, with both Graph Surgery and Likelihood Matching, we will use BayesiaLab’s Direct and Total Effect functions to compute causal effects automatically for a set of variables. But first, we present a slightly more complex version of Simpson’s Paradox to illustrate these features (see Example: Simpson’s Paradox).

Augmented Simpson’s Paradox

Our updated story contains four additional dimensions:

  • Treatment Availability\mathit{Treatment\ Availability}: the treatment is not always available;
  • Side Effects\mathit{Side\ Effects}: the treatment may produce severe side effects;
  • Efficacy\mathit{Efficacy}: some patients do not respond to the drug;
  • Litigation\mathit{Litigation}: the families of patients who died may sue the pharmaceutical company that had provided the treatment.

The manually designed CDAG shown below describes this new domain qualitatively:

Loading SVG...
Augmented Simpson.xbl
XBL

Next, we describe the quantitative part of the domain. First, we state that Treatment Availability\mathit{Treatment\ Availability} is 75%. The model assigns equal prior probabilities to Male\mathrm{Male} and Female\mathrm{Female}. We also assume that the treatment may have Side Effects\mathit{Side\ Effects}, which are much more frequent for females. The following conditional probability table quantifies this direct causal dependency on Gender\mathit{Gender}:

Loading SVG...

Patients decide whether or not to take the treatment based on two criteria, Treatment Availability\mathit{Treatment\ Availability} and Side Effects\mathit{Side\ Effects}. The dependencies are described in the following table. It states that if the treatment is unavailable, patients cannot have the treatment, which is deterministic (and obvious). However, if the treatment is available, those patients who do not have any risk of experiencing side effects will always choose the treatment, while those at risk will be unlikely to submit to the treatment:

Loading SVG...

Furthermore, the Efficacy\mathit{Efficacy} of the treatment depends on Drug Administration\mathit{Drug\ Administration} plus some hidden factors that render the treatment ineffective in 20% of patients:

Loading SVG...

The Target Node, Outcome\mathit{Outcome}, is defined by Gender\mathit{Gender} and Efficacy\mathit{Efficacy}. In this context, Not Recovered\mathrm{Not\ Recovered} means that the patient died.

Loading SVG...

Finally, half of the families of those patients who took the treatment and died are pursuing litigation. More specifically, these families are suing the pharmaceutical company that provided the treatment.

Loading SVG...

Path Analysis

We now list the paths between each variable and the target variable Outcome\mathit{Outcome} by using Menus > Analysis > Visual > Graph > Influence Paths to Target. The Causal column marks the directed causal paths to Outcome\mathit{Outcome}. The six tabs show all 12 paths, grouped by their starting node.

To show one path on the graph, select its row, check Keep Arc Color and Thickness, and click OK. Before displaying the next path, choose Menus > Edit > Select Arcs > All, then right-click a selected arc and choose Properties > Edit All > Default.

Influence Paths between Gender and Outcome, with Path 1 selected and Keep Arc Color and Thickness checked. Gender → Outcome; Gender → Side Effects → Drug Administration → Efficacy → Outcome.
Loading SVG...
Path 1 · Causal. Gender → Outcome
Loading SVG...
Path 0 · Causal. Gender → Side Effects → Drug Administration → Efficacy → Outcome

Recall the Adjustment Criterion, which stipulates that we must keep all of a variable’s causal paths to the target variable open and simultaneously block all its non-causal paths for estimating its causal effect.

Graph Surgery

To illustrate BayesiaLab’s Total and Direct Effects functions with Graph Surgery, we set all nodes but Outcome\mathit{Outcome} to Intervention Mode.

Loading SVG...

Notice the arrow symbols (→) in the badges of the nodes that are set to Intervention Mode.

Average Causal Effect

Before using BayesiaLab’s automated tools for computing causal effects, we manually estimated the causal effect of our main variable of interest, Drug Administration\mathit{Drug\ Administration}, by using the Monitors.

Loading SVG...
Loading SVG...

Setting a piece of Evidence in Intervention Mode simulates an intervention on Drug Administration\mathit{Drug\ Administration} and mutilates the graph, as shown below, which meets the Adjustment Criterion by blocking the non-causal path (see Path Analysis).

Loading SVG...

The Average Causal Effect of Drug Administration\mathit{Drug\ Administration} on Outcome\mathit{Outcome}, mediated by Efficacy\mathit{Efficacy}, is −0.08-0.08.

Total Effects

We have seen in Chapter 8 that BayesiaLab estimates Total Effects as the derivatives of Total Effect Curves. These curves are based on the Posterior Mean Values of the Target Node given Mean Values from the interval of the variable under study. While the variables are in Intervention Mode, the Posterior Mean Values are computed based on the mutilated graph.

We can plot these curves with Menus > Analysis > Visual > Target > Target's Posterior > Curves > Total Effects.

Total Effect curves for changes in recovery probability under intervention on each predictor.

For generating this graph, we can set a number of options:

Target Mean Analysis settings with Delta Mean on both axes, Use Hard Evidence, and Order by Strength selected.

The x-axis, Variable Delta Means, represents the difference between the Mean Value generated for the analysis (here, Hard Evidence/Intervention on the states of the variable under study) and its Prior Mean Value. The y-axis represents the difference between the Posterior Mean Value of Outcome\mathit{Outcome} and its Prior Mean Value.

If we do not specifically associate numerical values with symbolic states, BayesiaLab uses the state index. In our example,

  • False\mathrm{False} is 0, and True\mathrm{True} is 1.
  • Male\mathrm{Male} is 0, and Female\mathrm{Female} is 1.
  • Not Recovered\mathrm{Not\ Recovered} is 0, and Recovered\mathrm{Recovered} is 1.

We see that Side Effects\mathit{Side\ Effects} is the only variable with a positive causal effect. We also notice that Litigation\mathit{Litigation} has no causal effect. Here the binary drivers and target are coded 0 and 1. With Use Hard Evidence selected, the two evaluations for each driver give its endpoint contrast. For this intervention with the remaining mechanisms fixed, the mean response to a mixture of the two driver states is linear in their mixing probability. Its slope therefore equals that contrast. Open Total Effects on Target from Menus > Analysis > Report > Target > Total Effects on Target.

Graph Surgery Total Effects on Outcome. Gender has an effect of −0.3715 and Drug Administration an effect of −0.0800.

The Total Effect is the derivative computed at (0,0)(0, 0) in the previous Target Mean Analysis graph, i.e., the slope of the curve. The Standardized Total Effect is the Total Effect times the ratio between the standard deviation of the variable and the standard deviation of the Target Node.

The arrow symbols (→) in the results table indicate that Intervention Mode was active on all nodes, triggering Graph Surgery upon each observation/intervention during the estimation of the effects.

Gender\mathit{Gender} is the variable with the strongest Total Effect. It is negative because of the index values of the states. The recovery rate for Female\mathrm{Female} (1) is lower than for Male\mathrm{Male} (0).

Loading SVG...

Note that there are two paths from Gender\mathit{Gender} to Outcome\mathit{Outcome} (see Path Analysis), and they are both causal. Gender\mathit{Gender} is indeed a root node, i.e., it has no parents, meaning the Adjustment Criterion is fulfilled by default.

The Total Effect measures the effects of these two causal paths: the direct path and the indirect path, represented by the blue arcs below.

Loading SVG...

Direct Effects

Now consider the effect that reaches Outcome\mathit{Outcome} without passing through a mediator. With every node in this causal network in Intervention Mode, the Direct Effects calculation automatically fixes the distributions of all Confounders in the analysis. In particular, it fixes Efficacy\mathit{Efficacy}. The Total Effects calculation above allowed that mediator to respond. To see the resulting Direct Effect Curves, choose Menus > Analysis > Visual > Target > Target's Posterior > Curves > Direct Effects with the same settings used for Total Effects.

Direct Effect curves. Only Gender and Efficacy have nonzero slopes.

Given that all nodes are in Intervention Mode, the only variables with Direct Effects are the Parents of Outcome\mathit{Outcome}. Indeed, intervening on all nodes to hold them constant triggers Graph Surgery and generates the mutilated graph below:

Loading SVG...

The Direct Effects on Target report summarizes these curves. Choose Menus > Analysis > Report > Target > Direct Effects on Target.

Graph Surgery Direct Effects on Outcome. Gender has an effect of −0.4000 and Efficacy an effect of −0.1000.
  • The Direct Effect gives the local slope in original units. In this binary intervention example, that slope also equals the difference between the two endpoint means.
  • The Standardized Direct Effect is the Direct Effect times the ratio between the standard deviation of the variables and the standard deviation of the Target Node.
  • The Elasticity is the Direct Effect times the ratio between the range of the variable and the range of the Target Node.
  • Contribution gives each selected driver’s share of the sum of the absolute Standardized Direct Effects. Both positive and negative slopes contribute to the total magnitude.
Non-Confounders

The predefined class Non_Confounder\mathrm{Non\_Confounder} lets us choose which nodes to exempt from the automatic fixing. The Direct Effect definition lists the class rules. The only directed path from Drug Administration\mathit{Drug\ Administration} to Outcome\mathit{Outcome} passes through Efficacy\mathit{Efficacy}. With the mediator fixed, the drug’s reported Direct Effect is zero. To let that path carry the drug’s effect, open the contextual menu for Efficacy\mathit{Efficacy}, choose Properties > Classes > Add Predefined Class, and select Non_Confounder\mathrm{Non\_Confounder}. The graph below shows which arcs are then available for estimating the effect.

Loading SVG...
With Efficacy in Non_Confounder, the Direct Effects report gives −0.0800 for Drug Administration.

The Direct Effects report now gives −0.0800 for Drug Administration\mathit{Drug\ Administration}. This equals the total causal effect obtained earlier by intervention. Recovery falls from 50% without treatment to 42% with treatment. Freeing the mediator restores those eight percentage points in the comparison. Efficacy\mathit{Efficacy} is no longer listed as a driver in this run.

Likelihood Matching

Now suppose we want to use Likelihood Matching instead of Graph Surgery. We first set back all nodes in Observation Mode via the monitors’ Contextual Menus.

Nodes of Interest: Treatments/Drivers

The nodes of interest are the nodes for which we want to estimate the causal effect on the Target Node. We call them Treatments or Drivers.

In the previous section, we assumed that all nodes were of interest and set them in Intervention Mode. With Likelihood Matching, the workflow is less straightforward. For each Driver, we need to analyze the paths to the Target (cf. Path Analysis) to define the set of nodes that need to be controlled for to block the non-causal paths and let the causal paths open. Note that these nodes’ sets may differ for each Driver, requiring us to perform multiple Total Effect analyses to avoid conflicting adjustments. The first step is then to define our nodes of interest. In the Augmented Simpson Paradox, the main variable of interest is obviously Drug Administration\mathit{Drug\ Administration}, but for illustrative purposes, let us consider Gender\mathit{Gender} as well.

Total Effects

We have seen in the Path Analysis section that there are two paths between Gender\mathit{Gender} and Outcome\mathit{Outcome}, both causal. Thus, there is no variable to adjust for to estimate the Total Effect.

The Path Analysis indicates that there are also two paths between Drug Administration\mathit{Drug\ Administration} and Outcome\mathit{Outcome}, one causal and one non-causal: Drug Administration\mathit{Drug\ Administration} ← Side Effects\mathit{Side\ Effects} ← Gender\mathit{Gender} → Outcome\mathit{Outcome}. So we need to adjust for Side Effects\mathit{Side\ Effects}, or for Gender\mathit{Gender}, to block this path. This is in contradiction to the analysis of Gender\mathit{Gender}‘s effect. We cannot estimate the Total Effects of Gender\mathit{Gender} and Drug Administration\mathit{Drug\ Administration} in the same analysis with Likelihood Matching!

So let us start with Gender\mathit{Gender}. We select the node, go to Menus > Analysis > Report > Target > Total Effects on Target, and confirm that we want to perform the analysis on the selected node only:

Likelihood Matching Total Effects on Outcome for Gender with no observations.

For Drug Administration\mathit{Drug\ Administration}, let us suppose we choose to adjust for Side Effects\mathit{Side\ Effects}. We right-click on its associated Monitor and select Fix Probabilities from its Contextual Menu.

Loading SVG...

Then, we select the node Drug Administration\mathit{Drug\ Administration}, go to Menus > Analysis > Report > Target > Total Effects on Target, and confirm that we want to perform the analysis on the selected node only:

Likelihood Matching Total Effects on Outcome for Drug Administration with Side Effects fixed at its prior distribution.

Direct Effects

In Observation Mode, the Direct Effects calculation automatically maintains the marginal distributions of all Confounders through Likelihood Matching. The causal interpretation depends on which variables we allow to respond. Graph Surgery cuts incoming arcs to an intervened node. Likelihood Matching instead sets evidence to maintain the chosen distribution. In this graph, Litigation\mathit{Litigation} is a descendant of Outcome\mathit{Outcome}. Fixing its distribution by evidence would distort the recovery contrast, so we also exempt it.

While we previously added Efficacy\mathit{Efficacy} to the Non_Confounder\mathrm{Non\_Confounder} class to let it mediate the effect of Drug Administration\mathit{Drug\ Administration}, we must also add Litigation\mathit{Litigation} to prevent its adjustment.

Notice that there is no conflict in this analysis:

  • Gender
    • Controlling for Side Effects\mathit{Side\ Effects}, Drug Administration\mathit{Drug\ Administration} allows to cut the indirect causal path;
    • Controlling for Treatment Availability\mathit{Treatment\ Availability} has no impact;
    • Not controlling for Efficacy\mathit{Efficacy} has no effect as the indirect path is already blocked;
    • Not controlling for Litigation\mathit{Litigation} prevents to bias the estimation of the effect;
  • Drug Administration
    • Controlling for Side Effects\mathit{Side\ Effects}, Gender\mathit{Gender} allows to cut the non-causal path;
    • Controlling for Treatment Availability\mathit{Treatment\ Availability} has no impact;
    • Not controlling for Efficacy\mathit{Efficacy} allows to let the information flow from Drug Administration\mathit{Drug\ Administration} to Outcome\mathit{Outcome};
    • Not controlling for Litigation\mathit{Litigation} prevents to bias the estimation of the effect.

We can, therefore, select our two nodes of interest, use Menus > Analysis > Report > Target > Direct Effects on Target, and confirm that we want to perform the analysis on the selected nodes only:

Likelihood Matching Direct Effects for Gender and Drug Administration with Efficacy and Litigation left free.

Graph Surgery Versus Likelihood Matching

Before concluding this chapter, let us summarize the main characteristics of Graph Surgery and Likelihood Matching:

  • Graph Surgery
    • requires a fully specified Causal Bayesian Network;
    • uses the mutilated Causal Bayesian Network for causal inference;
  • Likelihood Matching
    • requires the causal analysis of the domain to define the variables that need to be adjusted for to block the non-causal paths and let the causal paths open;
    • uses the Bayesian network to carry out probabilistic inference with the adjusted variables. Note that this network does not have to be causal! It just needs to represent the Joint Probability Distribution of the domain.

This last point is especially important. It is indeed sometimes challenging, if not impossible, to design the fully specified Causal Bayesian Network. However, BayesiaLab offers a wide range of machine-learning algorithms that we can use to induce a network that represents the Joint Probability Distribution. Hence, we only need to have a limited amount of causal knowledge to define the variables that have to be adjusted for.

For this example, we generated a CSV of 64,000 records from the causal network. Each combination of states occurs in proportion to its joint probability. The G-tests in the reports use these generated counts. With Outcome\mathit{Outcome} as the target, we selected Menus > Learning > Supervised Learning > Augmented Naive Bayes, used Delete All Arcs, and left Variable Selection unchecked.

Augmented Simpson Records.csv
CSV
Augmented Naive Bayes.xbl
XBL
Loading SVG...

The main architecture of the network is Naïve, i.e., the Target Node is the parent of all nodes. Therefore, this Bayesian network is clearly not causal. If we were to use Graph Surgery, we would not find any total or direct effects (see the corresponding mutilated graph below when estimating the Direct Effects with Efficacy\mathit{Efficacy} and Litigation\mathit{Litigation} in the Non_Confounder\mathrm{Non\_Confounder} class).

Loading SVG...

Likelihood Matching estimates the Total Effects in two separate analyses.

For Gender\mathit{Gender}, the Total Effect is −0.3715-0.3715 without adjustment:

Total Effects on Outcome for Gender in the learned network. Total Effect −0.3715 and G-test 9,088.9545.

For Drug Administration\mathit{Drug\ Administration}, fixing Side Effects\mathit{Side\ Effects} at its prior distribution gives a Total Effect of −0.0798-0.0798, close to the −0.08-0.08 obtained by intervention:

Loading SVG...
Total Effects on Outcome for Drug Administration in the learned network. With Side Effects fixed, the estimate is −0.0798.

For Direct Effects, we can analyze both variables together with Efficacy\mathit{Efficacy} and Litigation\mathit{Litigation} in the Non_Confounder\mathrm{Non\_Confounder} class. The learned network gives −0.3990-0.3990 for Gender\mathit{Gender} and −0.0904-0.0904 for Drug Administration\mathit{Drug\ Administration}. The corresponding estimates in the causal network are −0.4000-0.4000 and −0.0800-0.0800.

Direct Effects on Outcome in the learned network. Gender has an effect of −0.3990 and Drug Administration an effect of −0.0904.

Conclusion

This chapter highlights how much effort is required to derive causal effect estimates from observational data. Simpson’s Paradox illustrates how much can go wrong even in simple circumstances. Given such potentially serious consequences, it is a must for policy analysts to examine all aspects of causality formally. To paraphrase Judea Pearl, we must not leave causal considerations to the mercy of intuition and good judgment. Fortunately, causality has emerged from its pariah status in recent decades, which has allowed tremendous progress in theoretical research and practical tools: “[…] practical problems relying on causal information that long were regarded as either metaphysical or unmanageable can now be solved using elementary mathematics” (Pearl, 1999).