The Illusion of Prediction-Driven Analysis
In data science, we often build predictive models to understand relationships. We select variables that best predict an outcome, assuming this process illuminates causal pathways. However, when the goal shifts from mere prediction to estimating the effect of a specific treatment or intervention, this approach can spectacularly backfire. The very variables that make a model predict well might be the ones that mask the true impact of the treatment you care about. This isn't a minor bug; it's a fundamental misunderstanding of how predictive accuracy relates to causal inference.
Consider a scenario where you want to know if a new drug improves patient recovery time. You build a model to predict recovery time using a wide array of patient data: age, pre-existing conditions, medication dosage, and even the attending physician's experience. Your model achieves excellent predictive accuracy, perhaps an R-squared of 0.9. You might then look at the coefficients or feature importances to understand which factors drive recovery. You might find that physician experience is a highly significant predictor. But what does this actually tell you about the drug's effect? It tells you that more experienced doctors tend to have patients who recover faster, but it doesn't disentangle the drug's independent contribution from the physician's skill or other, unmeasured factors correlated with both.
The core issue is that predictive models optimize for minimizing prediction error, not for isolating causal effects. Variables that are good predictors might be *confounders*. A confounder is a variable that influences both the treatment assignment and the outcome. If a confounder is present, it creates a spurious association that the predictive model will eagerly latch onto, often at the expense of revealing the true treatment effect.
For example, in the drug recovery scenario, suppose the drug is more likely to be prescribed to patients who are already sicker (perhaps because it's a last resort, or only for severe cases). If sicker patients naturally recover slower, then the drug appears to be associated with slower recovery, even if it's actually effective. A predictive model, aiming to predict recovery time, will identify 'sickness level' as a strong predictor. If 'sickness level' is also correlated with receiving the drug, the model will use 'sickness level' to explain away much of the variation in recovery time. This leaves little room for the drug's actual effect to be estimated accurately, potentially showing a null or even negative effect when the drug is beneficial.
The variables selected for a predictive model are those that minimize prediction error. These are often variables that are highly correlated with the outcome, regardless of whether they are causes, effects, or confounders. In contrast, causal inference requires identifying variables that are *causes* of the outcome, and critically, are *not* caused by the treatment assignment itself (unless they are mediators, which is a separate issue). Predictive models are blind to this distinction.

The Pitfall of Prediction-Driven Variable Selection
Many data scientists, when faced with a dataset and a prediction task, will perform feature selection to build the most parsimonious and accurate model. This often involves techniques like LASSO, Ridge regression, or even simpler methods like stepwise selection. The goal is to find a subset of variables that maximizes predictive performance. When this same model is then used to interpret coefficients or estimate treatment effects, a critical error is made. The selected variables are optimized for prediction, not for their role in a causal graph.
Let's formalize this. Suppose we have an outcome $Y$, a treatment $T$, and a set of potential predictors $X$. A predictive model aims to minimize $E[(Y - f(X, T))^2]$ for some function $f$. A causal model, aiming to estimate the Average Treatment Effect (ATE), wants to estimate $E[Y|T=1] - E[Y|T=0]$.
If there's a confounder $C$ such that $C$ affects $T$ and $C$ affects $Y$, and $C$ is also correlated with some $X_i$ that is a good predictor of $Y$, then $X_i$ will be selected into the predictive model. The model $f(X, T)$ might become very good at predicting $Y$ by leveraging the correlation between $X_i$ and $Y$ (which is partially mediated by $C$). However, when we look at the coefficient for $T$ in this model, it will be biased. The effect attributed to $T$ will be confounded by $C$, because $X_i$ has already 'explained away' some of the variation in $Y$ that is actually due to $C$, and $C$ is also influencing $T$.
This is akin to trying to measure the impact of adding fertilizer to a plant by looking at how much water the plant receives. If plants that receive more fertilizer also tend to receive more water (perhaps because the gardener is more attentive to them), a predictive model of plant growth might show water as a strong predictor. If we then try to estimate the effect of fertilizer based on this model, the effect might be underestimated or even masked because the model has already attributed much of the growth advantage to water, which is itself correlated with fertilizer application.

Bayesian Adjustment for Confounding (BAC) as a Solution
To address this, we need methods that are explicitly designed for causal inference, not just prediction. One such approach is Bayesian Adjustment for Confounding (BAC). BAC is a framework that aims to disentangle the effects of treatments from the influence of confounders.
Instead of selecting variables based on their predictive power, BAC starts by specifying a causal graph (a Directed Acyclic Graph, or DAG) that represents the assumed causal relationships between variables. This graph explicitly models which variables are believed to cause others, including how treatments are assigned and how confounders influence both.
In the context of estimating treatment effects, BAC aims to:
- Identify all known confounders.
- Model the relationship between these confounders and the treatment assignment.
- Model the relationship between these confounders and the outcome.
- Adjust for the influence of these confounders to isolate the effect of the treatment.
BAC uses Bayesian methods, which allow for the incorporation of prior knowledge and provide a full probability distribution for the estimated treatment effect, rather than a single point estimate with a confidence interval. This probabilistic output is crucial for understanding uncertainty in causal claims.
The process involves defining a model that accounts for the causal structure. For instance, if $Y$ is the outcome, $T$ the treatment, and $C$ the confounder, we might model:
$P(Y | T, C)$ and $P(T | C)$
By specifying these relationships within a Bayesian framework, we can derive the posterior distribution of the causal effect of $T$ on $Y$, while accounting for the influence of $C$. This is fundamentally different from prediction, where the focus is on $P(Y | X, T)$ and the selection of $X$ is driven by predictive utility.
The advantage of BAC is its transparency regarding assumptions. The causal graph is explicit, forcing researchers to state their beliefs about causal relationships. The adjustment for confounding is direct, not an emergent property of a prediction algorithm. This makes the resulting causal estimates more reliable, provided the causal graph is correctly specified.
Implications for Practice
For practitioners, this means a critical re-evaluation of how models are used. If your goal is to understand the causal impact of an intervention, a model optimized for prediction is likely the wrong tool, or at least, needs careful re-interpretation. The variables that make a model predict well are not necessarily the variables you want to control for or interpret in a causal sense.
This is particularly relevant in fields like medicine, economics, and social sciences, where understanding the effect of a policy, drug, or intervention is paramount. Relying on variable importance from a predictive model to infer causal effects is a common, yet dangerous, practice. It leads to conclusions that are brittle, prone to confounding, and ultimately misleading. The best predictive model is not necessarily the best causal model.
What nobody has addressed yet is how to effectively communicate this distinction to stakeholders who are accustomed to seeing high R-squared values as the ultimate measure of model success. The shift from prediction to causal inference requires a paradigm shift in how we evaluate and deploy models, and a new language for discussing their outputs.
