A residual is the difference between an observed value and its value predicted by a fitted model. In causal analysis, residuals retain variation that the chosen confounders cannot predict. section 8.1
A residual-based adjustment removes confounder influence in four steps:
- Predict treatment D from confounders C and calculate treatment residuals: the actual treatment minus its prediction. section 8.1.1
- Predict outcome O from C and calculate outcome residuals in the same way. section 8.1.1
- Regress the outcome residuals on the treatment residuals; the coefficient estimates the effect of D on O in the linear setup. section 8.1 section 8.1.1
Airline pricing
For an airline, ticket price D is the treatment, ticket sales O are the outcome, and seasonality and inflation C are confounders. Residualizing both price and sales against C isolates variation used to estimate the price effect. section 8.1
Figure 8.1 Steps to run the DML algorithm. The main goal of this algorithm is to first get rid of the influence of confounder C on both the decision and outcome variables. This is done using two predictive models. What remains after their predictions, called residuals, is used to estimate the causal effect from D to O.
Follow the algorithm diagram to see how two predictive models remove confounder influence before residual regression. section 8.1










