Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lecture 10. High-Dimensional Controls, Heterogeneity, And Double/Debiased ML

Learning Objectives

By the end of this lecture, students should be able to:

  1. explain why high-dimensional controls create inference problems beyond ordinary regression;

  2. distinguish post-double selection, orthogonal-score DML, and causal-forest heterogeneity workflows;

  3. write the partially linear model and the outcome and treatment nuisance functions;

  4. derive the residual-on-residual logic behind double/debiased ML;

  5. explain how sample splitting and cross-fitting protect inference from overfit nuisance estimates;

  6. define conditional average treatment effects and interpret causal-forest or generalized-random-forest outputs;

  7. diagnose overlap, feature leakage, learner choice, tuning, fold instability, and uncertainty for heterogeneous effects;

  8. decide when these tools sharpen an economics research design and when they are being used as a substitute for one.

Opening Orientation

Lecture 10 moves from prediction as measurement to flexible methods inside causal research designs. The central question is: how can applied economists use many controls, flexible nuisance functions, and treatment-effect heterogeneity without confusing prediction accuracy with causal identification? This is not a generic machine-learning lecture. The target is credible estimation of treatment effects or treatment-effect functions when the data contain rich worker histories, firm characteristics, geography, text-derived variables, lagged outcomes, or many possible interactions.

The key discipline is to separate three objects. The causal parameter is the object of interest. The nuisance functions help adjust for confounding or improve precision. The prediction algorithm is only a tool for estimating those nuisance functions. Double/debiased machine learning is useful precisely because it treats nuisance prediction as auxiliary rather than as the research answer Chernozhukov et al., 2018.

The paper spine is methodological and applied. Belloni, Chernozhukov, and Hansen show how high-dimensional control selection can support inference on treatment effects when selection is disciplined rather than ad hoc Belloni et al., 2014. Chernozhukov and coauthors provide the double/debiased machine learning framework for treatment and structural parameters Chernozhukov et al., 2018. Wager and Athey, and Athey, Tibshirani, and Wager, develop causal forests and generalized random forests for heterogeneous effects and local moment problems Wager & Athey, 2018Athey et al., 2019. Davis and Heller show how causal forests can be used to study heterogeneity in an economics application, while Dube and coauthors show double machine learning in an online labor-market setting Davis & Heller, 2017Dube et al., 2020.

Core Points

Bridge

Lecture 9 asked when prediction is a final object and when it is an input into measurement. Lecture 10 asks when prediction is a nuisance input for causal estimation. The bridge is subtle but important. A model can predict outcomes very well while producing a biased treatment estimate if it uses post-treatment features, violates sample-splitting discipline, or adjusts in regions with weak overlap. Conversely, a nuisance model with only moderate predictive accuracy can still be useful if the resulting orthogonal score estimates the target parameter stably.

The applied-economics framing is therefore: first define the research design and target parameter, then decide whether high-dimensional controls, double/debiased ML, or causal forests help execute that design.

Theory to applied bridge

MethodEconomic problem it helps solveSignature papersTypical implementation choicesInterpretation caveat
Post-double selectionMany observables are plausible confounders, but hand-picked controls are unreliableBelloni et al., 2014Lasso in treatment and outcome equations; union of selected controls; classical regression on selected setSelection discipline helps only if observables are the right confounders
Double/debiased MLRich nuisance objects make naive plug-in estimation invalidChernozhukov et al., 2018Choose target parameter; define orthogonal score; cross-fit nuisance learners; residual-on-residual or score-based estimationDML protects against nuisance-estimation error, not against bad design
Causal forestsTreatment effects may vary in ways that matter for targeting or mechanismWager & Athey, 2018Davis & Heller, 2017Honest forests; tuning on training folds; report subgroup support and uncertaintyVariable importance is not a causal mechanism
Generalized random forestsNuisance-rich generalized moment problems or heterogeneous local parametersAthey et al., 2019Choose moment condition carefully; set forest parameters; compare to simpler heterogeneity estimatorsFlexibility can hide the fact that the target itself is poorly motivated
DML in applied labor/platform workEstimate a causal labor parameter when controls or nuisance objects are high-dimensionalDube et al., 2020Rich scraped/admin controls; cross-fitting; robustness across nuisance learnersResults can look “modern” while still depending on the same old identifying assumptions

Field Core

A. Why High-Dimensional Controls Create A Causal Problem

Many empirical projects now contain more plausible controls than a researcher can justify by hand: pre-treatment earnings histories, firm fixed effects, vacancy text, location histories, lagged outcomes, interactions, and sector-by-place-by-time measures. The problem is not only computational. It is inferential.

If the researcher searches over controls and then reports ordinary regression standard errors as if the model had been fixed in advance, inference can be badly misleading. If the researcher includes everything, high dimensionality can create weak signal, collinearity, overfitting, and unstable estimates. If the researcher hand-picks controls after seeing results, the design becomes difficult to defend.

The target remains a causal estimand. For a binary treatment, a baseline average treatment effect is:

θ0=E[Yi(1)−Yi(0)].\theta_0 = \mathbb E\left[Y_i(1)-Y_i(0)\right].

High-dimensional controls help only under a design assumption such as conditional independence:

(Yi(1),Yi(0))⊥Di∣Xi,0<Pr⁡(Di=1∣Xi)<1.\left(Y_i(1),Y_i(0)\right) \perp D_i \mid X_i, \qquad 0 < \Pr(D_i=1\mid X_i) < 1.

The first condition says the relevant confounders are observed in XiX_i. The second says overlap is strong enough to compare treated and untreated units at similar covariate values. No machine-learning method removes the need to defend those conditions.

B. Post-Double Selection And The Role Of Lasso

The canonical partially linear model is:

Yi=θ0Di+g0(Xi)+Ui,E[Ui∣Di,Xi]=0.Y_i = \theta_0 D_i + g_0(X_i) + U_i, \qquad \mathbb E[U_i\mid D_i,X_i]=0.

The treatment equation is:

Di=m0(Xi)+Vi,E[Vi∣Xi]=0.D_i = m_0(X_i) + V_i, \qquad \mathbb E[V_i\mid X_i]=0.

Post-double selection uses lasso or a related sparse selector twice:

S^Y=supp⁡(γ^Y),S^D=supp⁡(γ^D),S^=S^Y∪S^D.\widehat S_Y = \operatorname{supp}\left(\widehat\gamma_Y\right), \qquad \widehat S_D = \operatorname{supp}\left(\widehat\gamma_D\right), \qquad \widehat S = \widehat S_Y \cup \widehat S_D.

Then the researcher estimates θ0\theta_0 by ordinary least squares of YiY_i on DiD_i and the controls in S^\widehat S. The point of the union is economic: a covariate may be important because it predicts treatment assignment, because it predicts the outcome, or because it does both. Selecting only from the outcome equation can omit confounders that are weak outcome predictors but strong treatment predictors Belloni et al., 2014.

Post-double selection is best used when the target is low-dimensional, the control set is large but approximate sparsity is plausible, and the researcher wants a transparent selected-control regression. It identifies the treatment effect under the same selection-on-observables logic as the partially linear model. It does not identify effects when confounding is unobserved, when important nonlinearities are missed, or when overlap is weak. The selected controls should be reported as an estimation device, not as a structural list of mechanisms.

C. Orthogonalization And Double/Debiased ML

Double/debiased ML starts from a related model but focuses on a different problem: how to estimate the target parameter when the nuisance functions are learned flexibly and may be imperfect.

Define the outcome and treatment nuisance functions:

g0(Xi)=E[Yi∣Xi],m0(Xi)=E[Di∣Xi].g_0(X_i)=\mathbb E[Y_i\mid X_i], \qquad m_0(X_i)=\mathbb E[D_i\mid X_i].

Residualize outcome and treatment:

Y~i=Yi−g0(Xi),D~i=Di−m0(Xi).\widetilde Y_i = Y_i-g_0(X_i), \qquad \widetilde D_i = D_i-m_0(X_i).

If the nuisance functions were known, the residual-on-residual estimand would be:

θ0=E[D~iY~i]E[D~i2].\theta_0 = \frac{\mathbb E[\widetilde D_i\widetilde Y_i]} {\mathbb E[\widetilde D_i^2]}.

In practice, g0g_0 and m0m_0 are estimated. The orthogonal score for the partially linear model is:

ψ(Wi;θ,η)=(Di−m(Xi))[Yi−g(Xi)−θ(Di−m(Xi))],η=(g,m).\psi(W_i;\theta,\eta) = \left(D_i-m(X_i)\right) \left[ Y_i-g(X_i)-\theta\left(D_i-m(X_i)\right) \right], \qquad \eta=(g,m).

The estimator solves:

1n∑i=1nψ(Wi;θ^,η^)=0.\frac{1}{n}\sum_{i=1}^{n} \psi(W_i;\widehat\theta,\widehat\eta) =0.

Equivalently, after cross-fitted residualization:

θ^DML=(1n∑i=1nD~^i2)−1(1n∑i=1nD~^iY~^i).\widehat\theta_{DML} = \left(\frac{1}{n}\sum_{i=1}^{n}\widehat{\widetilde D}_i^2\right)^{-1} \left(\frac{1}{n}\sum_{i=1}^{n}\widehat{\widetilde D}_i\widehat{\widetilde Y}_i\right).

Orthogonality means that small first-stage nuisance errors have only second-order effects on the score for θ0\theta_0 at the truth. Informally, mistakes in g^\widehat g and m^\widehat m enter as products rather than as first-order bias terms. This is why the nuisance functions can be learned with lasso, random forests, boosted trees, neural nets, or ensembles without requiring those learners to be the causal object Chernozhukov et al., 2018.

The interpretation is narrow and powerful. DML estimates a low-dimensional treatment or structural parameter under an orthogonal moment condition, credible identification assumptions, and adequate nuisance rates. It does not prove that treatment is as good as random conditional on XiX_i. It does not repair bad timing, post-treatment controls, or poor support.

D. Sample Splitting And Cross-Fitting

Sample splitting prevents the same observation from both training the nuisance model and evaluating the target score. Partition the sample into folds I1,…,IKI_1,\ldots,I_K. For each fold kk, estimate nuisance functions on the complement IkcI_k^c, then predict residuals only for observations in IkI_k:

Y~^i=Yi−g^(−k)(Xi),D~^i=Di−m^(−k)(Xi),i∈Ik.\widehat{\widetilde Y}_i = Y_i-\widehat g^{(-k)}(X_i), \qquad \widehat{\widetilde D}_i = D_i-\widehat m^{(-k)}(X_i), \qquad i\in I_k.

Cross-fitting rotates this procedure across all folds and stacks the held-out residuals. The final score condition uses every observation, but each observation is evaluated with nuisance functions trained elsewhere.

A credible implementation reports:

Cross-fitting is not cosmetic. If tuning or feature selection uses the full sample before splitting, the procedure can leak information from the score sample into the nuisance learner and weaken the inferential argument.

E. What DML Identifies, And What It Does Not

For high-dimensional controls and double/debiased ML, the researcher should be able to fill in the following design statement before running code:

Target parameter:
Identifying variation:
Observed confounders:
Timing of controls:
Overlap population:
Nuisance learners:
Cross-fitting plan:
Robustness checks:

DML is best used when the target parameter is low-dimensional, the identification story is already credible, and nuisance functions are too rich for a hand-specified linear model. It identifies the target implied by the moment condition, such as an ATE in a partially linear model or another structural parameter with an orthogonal score. It does not identify causal effects from purely predictive variation, unobserved confounding, support extrapolation, or mechanically selected post-treatment controls.

The most common abuse is to report a DML estimate as if the algorithm itself supplied the research design. A better report says: the design relies on conditional comparison given pre-treatment observables; DML is used to estimate the nuisance adjustment flexibly; overlap and sensitivity checks indicate the estimate is or is not stable.

F. CATEs And Substantively Meaningful Heterogeneity

A conditional average treatment effect is:

τ(x)=E[Yi(1)−Yi(0)∣Xi=x].\tau(x) = \mathbb E\left[Y_i(1)-Y_i(0)\mid X_i=x\right].

Sometimes the conditioning variable is a lower-dimensional policy feature Zi=h(Xi)Z_i=h(X_i), such as baseline earnings, prior employment, market thickness, or youth risk score:

τ(z)=E[Yi(1)−Yi(0)∣Zi=z].\tau(z) = \mathbb E\left[Y_i(1)-Y_i(0)\mid Z_i=z\right].

CATEs are useful when heterogeneity answers an economic question: who benefits from a job-training program, which workers are harmed by a policy, where monopsony power is stronger, or whether an intervention works through a mechanism predicted by theory. They are less useful when the researcher merely asks a flexible algorithm to find any subgroup with large effects.

The support burden is higher than for an ATE. Estimating τ(x)\tau(x) requires treated and untreated observations with comparable covariates near xx. A highly variable CATE surface may reflect sparse support, weak treatment variation, or adaptive overfitting rather than meaningful heterogeneity.

G. Causal Forests And Generalized Random Forests

Causal forests adapt random-forest logic to treatment-effect estimation. Instead of splitting only to predict YiY_i, the forest searches for covariate partitions that reveal differences in treatment effects. Honest forests separate the data used to choose splits from the data used to estimate effects within leaves, which reduces adaptive overfitting Wager & Athey, 2018.

A useful way to view the heterogeneity object is a local residual-on-residual problem. With forest weights αi(x)\alpha_i(x) centered around target covariate value xx, a causal-forest style estimator solves:

τ^(x)=arg⁡min⁡τ∑i=1nαi(x)[(Yi−μ^(Xi))−τ(Di−e^(Xi))]2,\widehat\tau(x) = \arg\min_{\tau} \sum_{i=1}^{n} \alpha_i(x) \left[ \left(Y_i-\widehat\mu(X_i)\right) - \tau\left(D_i-\widehat e(X_i)\right) \right]^2,

where μ^(Xi)\widehat\mu(X_i) is an outcome nuisance estimate and e^(Xi)\widehat e(X_i) is a propensity-score or treatment nuisance estimate. Generalized random forests extend the same idea to local moment conditions rather than only treatment effects Athey et al., 2019.

Causal forests are best used for disciplined heterogeneity discovery, targeting diagnostics, and comparison with simpler interaction models. They identify treatment-effect heterogeneity under the same causal assumptions as the underlying design, plus stronger support and regularity demands for local estimation. They do not make variable importance causal, they do not prove mechanisms, and they do not create overlap.

In applied papers, forest output should be interpreted as evidence about patterns of heterogeneity, not as a ranked list of causes. A variable can be important for splitting because it marks support, precision, or correlated economic environments. Mechanism claims still need theory, timing, and additional evidence.

H. Implementation Caveats That Matter In Practice

High-dimensional controls, DML, and heterogeneity: diagnostic checklist

ObjectCore questionWhat it identifiesBest scenarioMain failure modePractical diagnostic
Post-double selectionWhich controls should enter the partially linear model?A treatment effect under selection-on-observables with high-dimensional controlsMany controls, moderate dimension, relatively linear target parameterMissed nonlinear confounding; instability in selected controlsCompare selected sets, inspect treatment-model and outcome-model overlap
DML / orthogonalizationCan nuisance functions be estimated flexibly without contaminating inference on the target parameter?Low-dimensional target parameter under orthogonal score conditionsHigh-dimensional controls with credible overlap and a clearly defined target parameterBad overlap, leakage, poor learner choice, weak nuisance qualityCross-fit stability, overlap checks, learner-sensitivity checks
CATE / causal forestDoes treatment heterogeneity vary systematically with observables?A conditional treatment-effect function under stronger support demandsLarge samples, substantively meaningful heterogeneity, good overlapNoisy subgroup estimates, adaptive overfitting, spurious “heterogeneity”Honest forests, subgroup support checks, stability across tuning choices
Policy targetingCan estimated heterogeneity improve assignment or policy design?A ranking or policy score rather than a single ATEHeterogeneous benefits/costs and real targeting decisionsOverfitting the target rule, welfare claims without policy objectiveHold-out validation, compare to simple targeting rules

Several implementation issues deserve explicit reporting.

Overlap support. Flexible adjustment is dangerous in thin support. Report the propensity-score distribution, trimming rules, effective sample, and whether estimates are driven by regions where one treatment state is rare.

Feature leakage. All controls and features must be pre-treatment. In labor-market data, leakage can enter through post-hire outcomes, post-policy firm behavior, edited platform metadata, or text created after treatment assignment.

Nuisance-learner choice. Lasso is attractive when approximate sparsity is plausible. Forests and boosted trees are attractive for nonlinearities and interactions. Ensembles can improve nuisance fit but make transparency harder. The learner choice should match the nuisance problem, not the desire for an impressive method label.

Hyperparameter tuning. Tuning should occur inside the training fold. Tuning on the full sample can quietly undo sample-splitting discipline.

Fold instability. Estimates that move sharply across fold assignments, seeds, or learner classes should be reported as fragile. Instability can be a sign of weak support, weak signal, or overly flexible learners.

Uncertainty for heterogeneous effects. Average-effect standard errors are not enough for CATE claims. Researchers should report uncertainty for subgroup effects, honest forest intervals when available, and whether discovered heterogeneity survives hold-out or pre-specified validation.

Honest forests versus adaptive overfitting. Forests that use the same observations to choose splits, estimate leaf effects, and select highlighted subgroups can overfit heterogeneity. Honesty and held-out validation are not technical niceties; they are part of the design.

I. Reporting Discipline

A strong applied paper using these tools usually reports four layers:

  1. a simple design-based or low-dimensional benchmark;

  2. the high-dimensional or DML estimate and the exact target parameter;

  3. overlap, leakage, tuning, and fold-stability diagnostics;

  4. a heterogeneity analysis that is labeled exploratory or confirmatory.

The result should be readable without knowing the software package. DoubleML, EconML, and grf are useful implementation stacks, but the paper should explain the estimand, score, nuisance functions, cross-fitting plan, and interpretation in economics language.

Research Lab

The Week 10 lab follows the standard Reproduce -> Diagnose -> Transfer structure. It is a bounded synthetic teaching path, not an official replication package. The primary anchor is Dube and coauthors because their online labor-market application uses double machine learning to estimate a causal labor-market parameter while adjusting flexibly for rich observables Dube et al., 2020. The challenge anchor is Davis and Heller because their causal-forest application pushes students to decide when discovered heterogeneity is substantively meaningful and when it is only noisy subgroup variation Davis & Heller, 2017.

Reproduce

Students work with a deterministic synthetic online labor-market dataset. They estimate a wage-setting treatment effect using:

The goal is to reproduce the design logic of DML:

Diagnose

Students inspect whether the DML result is credible:

The required memo should say whether DML sharpens a credible design or merely hides design uncertainty behind a modern estimator.

Transfer

Students transfer the logic to treatment-effect heterogeneity inspired by causal-forest applications. The transfer dataset represents a youth employment program with baseline risk, neighborhood conditions, prior work, and treatment assignment. Students estimate:

The point is not to produce a frontier forest implementation. The point is to learn what a publishable heterogeneity claim would need: overlap, pre-specified economic dimensions, uncertainty, and validation against simpler alternatives.

Minimum student deliverables are:

  1. one Reproduce paragraph defining the target parameter, nuisance functions, and cross-fitting plan;

  2. one Diagnose paragraph interpreting overlap, leakage, learner sensitivity, and fold stability;

  3. one Transfer paragraph explaining whether heterogeneity is substantively meaningful;

  4. one final sentence stating what the method identifies and what it does not identify.

Methods Box

Reading Ladder And References

Reading architecture

Core methodological readings

Applied economics readings

Optional extensions

First pass: high-dimensional controls. Read Belloni, Chernozhukov, and Hansen on post-double selection and the logic of inference after selecting controls Belloni et al., 2014.

Second pass: orthogonal scores and DML. Read Chernozhukov and coauthors for the partially linear model, Neyman orthogonality, sample splitting, cross-fitting, and the broader treatment/structural-parameter framework Chernozhukov et al., 2018.

Third pass: heterogeneity. Read Wager and Athey for causal forests and Athey, Tibshirani, and Wager for generalized random forests Wager & Athey, 2018Athey et al., 2019. Nie and Wager are useful for the R-learner view of heterogeneous treatment effects Nie & Wager, 2021.

Applied pass: economics research design. Read Dube and coauthors for DML in an online labor-market application, then Davis and Heller for a causal-forest heterogeneity application Dube et al., 2020Davis & Heller, 2017.

Exercises And Discussion Prompts

  1. Write the partially linear model for an applied labor question with high-dimensional controls. Which variables are outcome nuisances, which are treatment nuisances, and which parameter is the target?

  2. Explain why selecting controls only from the outcome equation can miss confounders. Give an example from worker, firm, or place data.

  3. Derive the residual-on-residual DML estimator from the orthogonal score in (9).

  4. Draw a sample-splitting diagram for five-fold cross-fitting. Where should hyperparameter tuning occur?

  5. A DML estimate changes sharply when random forests replace lasso in the nuisance step. What diagnostics would you inspect before interpreting the result?

  6. Give one setting where a CATE is substantively meaningful and one setting where a discovered CATE is likely to be noise.

  7. A causal forest reports that baseline earnings are the most important variable. Why is this not automatically a causal mechanism?

  8. Suppose overlap is weak for workers in small rural labor markets. What should the paper report, and how might the estimand change after trimming?

Reproducibility And Code Lab Note

The canonical Lecture 10 lab folder is:

labs/10-high-dimensional-controls-heterogeneity-and-double-debiased-ml/

The lab is a bounded teaching path. It creates deterministic synthetic data for an online labor-market DML exercise and a youth-employment heterogeneity transfer exercise. It does not claim to reproduce the published estimates in Dube and coauthors or Davis and Heller, and it does not invent official replication inputs.

The smoke path runs:

ENV_NAME=research bash smoke.sh

Expected outputs include baseline versus DML treatment-effect estimates, fold-level nuisance diagnostics, overlap summaries, leakage and selected-control audits, subgroup CATE tables, honest-tree heterogeneity summaries, and transfer design prompts.

Slide Companion Note

The Week 10 slide deck should not duplicate the chapter. It should define why high-dimensional controls create a new inference problem, show post-double selection, isolate orthogonalization and DML math, explain cross-fitting, introduce CATEs and causal forests, summarize implementation pitfalls, and end with the Reproduce -> Diagnose -> Transfer lab design.

The canonical slide source is slides/week10/10-high-dimensional-controls-heterogeneity-and-double-debiased-ml.tex.

Bridge Forward

Lecture 11 turns from high-dimensional causal estimation to policy learning, targeting, and external validity. The continuity is direct: Lecture 10 teaches how to estimate average and conditional effects credibly; Lecture 11 asks how, and whether, those heterogeneous estimates should guide decisions under constraints, welfare objectives, and distribution shift.

References
  1. Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., Hansen, C., Newey, W., & Robins, J. (2018). Double/Debiased Machine Learning for Treatment and Structural Parameters. The Econometrics Journal, 21(1), C1–C68.
  2. Belloni, A., Chernozhukov, V., & Hansen, C. (2014). Inference on Treatment Effects after Selection among High-Dimensional Controls. Review of Economic Studies, 81(2), 608–650.
  3. Wager, S., & Athey, S. (2018). Estimation and Inference of Heterogeneous Treatment Effects Using Random Forests. Journal of the American Statistical Association, 113(523), 1228–1242.
  4. Athey, S., Tibshirani, J., & Wager, S. (2019). Generalized Random Forests. The Annals of Statistics, 47(2), 1148–1178.
  5. Davis, J. M. V., & Heller, S. (2017). Using Causal Forests to Predict Treatment Heterogeneity: An Application to Summer Jobs. American Economic Review Papers and Proceedings, 107(5), 546–550.
  6. Dube, A., Jacobs, J., Naidu, S., & Suri, S. (2020). Monopsony in Online Labor Markets. American Economic Review: Insights, 2(1), 33–46.
  7. Mullainathan, S., & Spiess, J. (2017). Machine Learning: An Applied Econometric Approach. Journal of Economic Perspectives, 31(2), 87–106.
  8. Nie, X., & Wager, S. (2021). Quasi-Oracle Estimation of Heterogeneous Treatment Effects. Biometrika, 108(2), 299–319.