Member-only story
Causal Inference
Answering causal questions with Python
This is the second post in a series of three on causality. In the last post, I introduced this “new science of cause and effect” [1] and gave a flavor for causal inference and causal discovery. In this post, we will dive further into some details of causal inference and finish with a concrete example in Python.
Where to start?
In the last post, I discussed how causality can be represented mathematically via Structural Causal Models (SCMs). SCMs consist of two parts: a graph, which visualizes causal connections, and equations, which express the details of the connections.
To recap, a graph is a mathematical construction consisting of vertices (nodes) and edges (links). Here, I will use the terms graph and network interchangeably. SCMs use a special kind of graph called a Directed Acyclic Graph (DAG), for which all edges are directed and no cycles exist. DAGs are a common starting place for causal inference.









