Lies, Damned Lies, and Causal Inference

- 7 mins

To paraphrase Benjamin Disraeli, statistics makes it easy to lie. In this post, I’ll go over an example from Judea Pearl’s excellent textbook, Causality, that shows how different statistical approaches can lead to different estimates of the causal effect of smoking on lung cancer.

First, the (fictional) data, which is taken from Section 3.3 of Causality. Say we have results from an observational (i.e. non-randomized) study, that aims to assess the affect of smoking on developing lung cancer. For every person, we have a binary variable that indicates whether that person is a smoker and a binary outcome variable that indicates whether that person developed lung cancer. Additionally, we have a binary variable that indicates whether each person had a significant amount of tar in their lungs.

The results from the (fictional) study are depicted in the table below:

\begin{array}{c|c|c|c} \text{Smoker } (X) & \text{Tar }(Z) & \text{Group Size (% of population)} & \text{Cancer Prevalence (% of group)} \\ \hline 0 & 0 & 47.5\% & 10\%\\ 0 & 1 & 2.5\% & 5\%\\ 1 & 0 & 2.5\% & 90\%\\ 1 & 1 & 47.5\% & 85\%\\ \end{array}

At first glance, it seems that smoking is likely to cause cancer. Ignoring , both groups of have a far larger prevalence of cancer than . Even considering , smokers with tar buildup are more likely to have cancer than nonsmokers with tar buildup, and smokers without tar buildup are still more likely to have cancer than nonsmokers without tar buildup.

Indeed, simple calculations using Bayes’ rule verify and , indicating one is much more likely to have lung cancer if that person is also a smoker.

However, this might be misleading. The Bayes’ rule calculation above corresponds to a prediction problem: What’s the probability someone has cancer if she’s a smoker? In real life, we may be more curious about the causal problem: What’s the probability that smoking will cause someone to have cancer? The distinction may seem like a subtle one but it’s important. It may be possible that lung cancer and smoking are correlated due to a common cause, but that lung cancer does not directly (or indirectly) cause smoking. Since we’re concerned with an intervention (i.e. choosing to smoke or not), we would like to estimate the direct cause of this intervention.

This problem came up in a causal inference class I’m taking this semester, and our professor likes to say it’s easy to go down philosophical rabbit holes when defining causality. I’ll leave that to the experts (there are excellent textbooks by Guido Imbens and Don Rubin along with Stephen Morgan and Christopher Winship).

An intuitive approach for me is through the use of causal graphs. I won’t go over all the details, but the main idea is that every node in the graph represents a variable in the causal problem of interest, and the arrows between each node show the causal direction. Nodes can either be observed (shaded) or latent (unshaded).

For example, in the smoking example, we would depict , , and with observed nodes. It’s fair to imagine that the decision to smoke will cause the amount of tar buildup in the lungs, and we can also assume that lung cancer is only caused by tar in the lungs. In this case, we would have an arrow from to followed by another arrow from to .

This is unrealistic, however, as there are likely unknown, unobserved causes that confound these variables. For example, genetics can influence our decision to smoke, and it can also determine our predisposition to cancer. It wouldn’t be a stretch to assume that tar buildup is determined only by smoking. (These assumptions are definitely simplifying and unrealistic, but that’s besides the point for this example.) Accounting for this confounder illuminates the difficulties posed by the causal approach: people who are genetically inclined to smoke may also be more genetically likely to have cancer, correlating these two variables without a causal relationship.

Denoting genetics as the latent variable , the causal graph is depicted in subfigure (a) below:

Causal Graphs

If we’re interested in the causal effect of on , we are thinking in terms of interventions; that is, would no longer depend on if someone is forced to smoke or to not smoke. Thus, Pearl introduces the operator, which imagines the causal graph under intervention. If , we force to be 1, and imagine that is only caused by the “do-er” as opposed to any of its causal predecessors, since we can intervene. Thus, the causal effect of interest becomes as opposed to . This scenario is depicted in subfigure (b) above.

Because of the confounding variable , the numbers at the beginning of this post do not accurately reflect the causal effect. There are several set of criteria for calculating causal effects based off causal graphs, most notably the back-door and front-door criteria. Using the front-door criterion (which I won’t elaborate on here but deserves its own post), we can see that is an intermediate causal effect. That is, only depends on through .

We can then calculate the effect of on ; however, there exists what’s called a back-door path from to through . That is, if we just calculate the causal effect of on , because of the confounder , we would include spurious effects that are due to . Therefore, we must block by accounting for it when calculating the causal effect. Chapter 3.3 of Pearl’s textbook goes through these derivations in more depth.

Mathematically, then, we can calculate

The term accounts for the intermediate causal effect of on . The term in the sum estimates by conditioning on to account for the final causal effect of on . Using this formula with the same data (re-posted below), we can calculate and , indicating that smoking would actually decrease the chance of lung cancer.

Intuitively, what’s going on? It appears that smoking increases the amount of tar buildup in the lungs, which is easily verified in the table below, since and . However, we can see that conditioning on , tar buildup decreases your likelihood of getting lung cancer. That is, and Thus, combining these results: smoking causes a larger amount of tar buildup in the lungs, and large tar buildups in the lungs prevent cancer.

\begin{array}{c|c|c|c} \text{Smoker } (X) & \text{Tar }(Z) & \text{Group Size (% of population)} & \text{Cancer Prevalence (% of group)} \\ \hline 0 & 0 & 47.5\% & 10\%\\ 0 & 1 & 2.5\% & 5\%\\ 1 & 0 & 2.5\% & 90\%\\ 1 & 1 & 47.5\% & 85\%\\ \end{array}

I want to stress this data is fictional, and the arguments are simplistic. One could easily come up with another causal diagram to show that smoking increases the likelihood of cancer. However, I think this example illustrates the importance of being careful when performing causal inference analyses, along with the differences between causal inference and prediction problems.

Keyon Vafa

Keyon Vafa

Statistics PhD student focusing on machine learning

rss facebook twitter github youtube mail spotify instagram linkedin google google-plus pinterest medium vimeo stackoverflow reddit quora