Member-only story
Unlock the Power of Causal Inference and Front-door Adjustment: An In-Depth Guide for Data Scientists
A full explanation of causal inference front-door adjustment with examples including all the Python source code
Objective
By the end of this article you will understand the magic of causal inference front-door adjustment that can calculate the effect of an event on an outcome even where there are other factors affecting both that are unmeasured or even unknown and you will have full access to all the Python code.
I have scoured the Internet and many books trying to find a fully working example of the front-door formula in Python and I have drawn a blank, so unless there are sources out there that I have missed, what you are about to read is genuinely unique …
Introduction
In a recent article I explored the power of the backdoor adjustment formula to calculate the true effect of an event on an outcome even if there are observable factors that are “confounding” both …
The aim was to establish the true effect of taking a drug on patient recovery rates and the magic of the backdoor adjustment formula recovered this effect even though “male” was obscuring that result because -
- A higher proportion of males took the drug compared to females
- Males had a higher recovery rate than females
In this example “male” is a “confounder” but the values for “male” were included in the observation data and then the back door formula was applied to prove that the drug trial was having a positive impact.
But what if the “confounder” could not be measured and was not included in the data?