Causal inference is the branch of data science concerned with answering questions about cause and effect: not just whether two things are associated, but whether changing one thing will change another. Its central problem is that data alone rarely distinguish causation from mere correlation. Two variables can be associated because one causes the other, because they share a common cause, or because of how the data were collected. Causal inference develops the formal language, assumptions, and methods needed to move from observed data to reliable conclusions about what would happen under intervention.
The stakes are practical as well as intellectual. A pharmaceutical company needs to know whether a drug lowers blood pressure, not merely whether patients who take it have lower blood pressure. A platform deciding whether to show a new recommendation algorithm needs to know whether the algorithm increases engagement, not whether engaged users happen to see it. In both cases, the question is about a counterfactual: what would happen if the world were changed in a specific way. Causal inference provides the tools to answer such questions when randomized experiments are impossible, unethical, or too expensive.
The conceptual foundation of modern causal inference is the potential outcomes framework, also called the Rubin causal model after its influential proponent Donald Rubin. The core idea is simple: for each unit (a person, a firm, a plot of land), there exists a potential outcome under each possible treatment condition. If a patient takes a drug, there is an outcome; if the same patient does not take the drug, there is another outcome. The causal effect for that patient is the difference between these two potential outcomes.
The difficulty is that only one of these outcomes can ever be observed. A patient either takes the drug or does not; the other outcome is counterfactual and permanently missing. This is the fundamental problem of causal inference. The field's methods are, in large part, strategies for estimating the average of these unobservable individual effects from observable data.
The framework makes explicit the conditions under which a comparison of treated and untreated groups yields a valid causal estimate. The key condition is exchangeability (also called ignorability): the treatment assignment must be independent of the potential outcomes, given the observed covariates. In a randomized experiment, randomization guarantees this condition. In observational data, it must be assumed, and the assumption is often questionable. The framework also requires positivity (every unit has a nonzero chance of receiving each treatment) and consistency (the observed outcome for a treated unit equals its potential outcome under that treatment).
This framework is not merely a philosophical clarification; it generates concrete estimators. The simplest is the difference in means between treated and untreated groups, valid only under exchangeability. When exchangeability holds only after conditioning on covariates, one can use matching, stratification, or inverse probability weighting to construct comparable groups. More flexible approaches include doubly robust methods, which combine outcome modeling with treatment modeling so that the estimate remains consistent if at least one of the two models is correctly specified.
A second major tradition, associated with Judea Pearl and others, approaches causation through directed acyclic graphs (DAGs) and structural causal models. A DAG represents causal relationships as arrows between variables: an arrow from X to Y means X directly causes Y. The graph encodes qualitative assumptions about which variables affect which others, and these assumptions have precise mathematical consequences.
The central concept is d-separation, a graphical criterion that tells when two sets of variables are independent conditional on a third set. From this, one can derive which associations should appear in the data if the graph is correct. More importantly, the graph allows one to determine whether a causal effect is identifiable: whether it can be computed from the observed distribution given the assumed structure. The back-door criterion and front-door criterion provide graphical rules for selecting adjustment sets—the covariates one must condition on to remove confounding.
Structural causal models go further by assigning each variable a deterministic function of its causes plus an unobserved error term. This allows the definition of counterfactuals as formal mathematical objects: the value a variable would take if another variable were set to a specific value by intervention. Pearl's do-calculus provides a complete set of rules for translating expressions involving interventions into expressions involving only observed quantities.
The graph-based and potential-outcomes traditions were historically in tension, with disagreements about notation, philosophy, and the proper role of counterfactuals. Over time, the two have largely converged. Modern practice routinely uses DAGs to clarify assumptions and potential-outcomes estimators to implement analyses. The graph tradition contributes a rigorous language for expressing assumptions; the potential-outcomes tradition contributes a rigorous language for defining effects and a rich set of estimators. Most contemporary work draws on both.
The central obstacle in observational causal inference is confounding: a variable that influences both treatment and outcome, creating an association even when no causal effect exists. A classic example is the association between coffee drinking and lung cancer, which is confounded by smoking: smokers drink more coffee and get more lung cancer, so coffee appears harmful even if it is not.
The most direct remedy is randomization, which breaks the link between confounders and treatment assignment. Randomized controlled trials remain the gold standard for causal inference. But randomization is often impossible: one cannot randomly assign smoking, education, or economic policy. Observational methods must instead adjust for measured confounders.
Regression adjustment is the most common approach: include the confounders as covariates in a regression model and interpret the treatment coefficient as the causal effect. This works only if the model is correctly specified—linear in the right variables, with no unmeasured confounding. Propensity score methods reduce the dimensionality of adjustment: instead of conditioning on all covariates, one conditions on the probability of treatment given covariates. Matching constructs a comparison group by pairing each treated unit with similar untreated units. Inverse probability weighting reweights the sample so that treated and untreated groups resemble each other in their covariate distributions.
All these methods share a critical limitation: they can only adjust for measured confounders. If an important confounder is unmeasured or unknown, no adjustment method can remove the resulting bias. This is the unmeasured confounding problem, and it is the fundamental threat to observational causal inference. Methods such as instrumental variables and difference-in-differences attempt to address it by exploiting natural experiments or quasi-experimental variation.
When randomization is impossible, researchers sometimes find situations where treatment assignment is "as if" random, or where a natural intervention creates a comparison that mimics an experiment. These designs exploit instrumental variables, regression discontinuity, and difference-in-differences.
An instrumental variable is a variable that affects treatment but has no direct effect on the outcome except through treatment. If such a variable exists, it can be used to estimate the causal effect even in the presence of unmeasured confounding. A classic example uses the distance to a hospital as an instrument for receiving intensive care: distance affects treatment but presumably not health outcomes directly. The method estimates the effect only for those whose treatment is influenced by the instrument—the compliers—which may not represent the general population.
Regression discontinuity exploits a threshold rule: students above a test cutoff receive a scholarship, patients above a blood pressure cutoff receive a drug. Comparing outcomes just above and just below the cutoff approximates a randomized experiment, because units near the threshold are nearly identical. The method estimates a local effect at the cutoff, not the average effect across the whole population.
Difference-in-differences compares the change in outcomes over time between a treated group and an untreated comparison group. The key assumption is parallel trends: in the absence of treatment, the two groups would have followed the same trajectory. This assumption is often plausible when the groups are similar in their pre-treatment trends, but it cannot be verified directly.
These quasi-experimental designs are powerful because they can address unmeasured confounding, but each rests on assumptions that are often difficult to verify. They also estimate effects for specific subpopulations or under specific conditions, so their results do not always generalize to other settings.
The potential outcomes framework naturally extends beyond the average treatment effect. Heterogeneous treatment effects ask whether the effect varies across individuals or subgroups. This is central to precision medicine, where the goal is to identify who benefits from a treatment and who does not. Methods include subgroup analysis, effect modification modeling, and causal forests, which adapt machine learning to estimate conditional average treatment effects.
Mediation analysis asks not just whether a treatment works but how: through which intermediate variables does the effect flow? The treatment might reduce mortality by lowering blood pressure, and the question is how much of the effect operates through blood pressure and how much through other pathways. This requires assumptions about the absence of unmeasured confounding of the mediator-outcome relationship, which are often strong.
Time-varying treatments and longitudinal data introduce additional complexity. When treatment is administered repeatedly over time, and covariates are affected by earlier treatments, standard adjustment methods break down. G-methods—including g-computation, inverse probability weighting of marginal structural models, and g-estimation—were developed to handle this setting. They require modeling the entire treatment history and the time-varying confounding structure.
Contemporary causal inference is a mature and rapidly expanding field. The two foundational traditions have merged into a common toolkit: DAGs for expressing assumptions, potential outcomes for defining effects, and a wide array of estimators for different settings. The field has also absorbed modern machine learning, using flexible models to estimate nuisance parameters (propensity scores, outcome regressions) while maintaining valid inference for the causal effect of interest.
Several developments characterize the current landscape. Targeted learning and doubly robust machine learning combine flexible estimation with rigorous inference, allowing data-adaptive methods without sacrificing valid confidence intervals. Causal discovery attempts to learn causal structure from data rather than assuming it, though its results are generally weaker and more assumption-dependent than those of confirmatory analysis. Sensitivity analysis has become standard practice: rather than simply asserting no unmeasured confounding, researchers quantify how strong an unmeasured confounder would have to be to overturn their conclusions.
The field's central message is both empowering and humbling. Causal inference provides a rigorous language for asking causal questions and a rich set of tools for answering them. But every method rests on assumptions, and the validity of any causal conclusion depends on the plausibility of those assumptions in the specific setting. The field does not offer a way to get something from nothing; it offers a way to make assumptions explicit, to derive their consequences, and to know what can be concluded when they hold and what cannot be concluded when they fail.