*! version 30aug2024

help ddml iv, help ddml fiv v1.4.4

ddml - estimation of partially-linear IV models in Double Debiased Machine Learning

ddml implements algorithms for causal inference aided by supervised
machine learning as proposed in
Double/debiased machine learning for treatment and structural parameters
(Econometrics Journal, 2018). Five different models are supported, allowing for
binary or continuous treatment variables and endogeneity, high-dimensional
controls and/or instrumental variables.

ddml supports a variety of different ML programs, including
but not limited to pystacked and lassopack.
pystacked is the recommended way to specify multiple learners in ddml,
and ddml has integrated support for various features provided by pystacked.

The ddml package also includes the wrapper program qddml,
which uses a simplified one-line syntax, but offers less flexibility.

This help file illustrates usage of the partially-linear IV model
and the flexible partially-linear IV model.
For examples of other models,
follow the links in the main ddml help file.

We use Y to denote the outcome variable,
X to denote confounders,
Z to denote instrumental variable(s), and
D to denote the treatment variable(s) of interest.

Partially-linear IV model [iv]

Y = a.D + g(X) + U
Z = m(X) + V

where the aim is to estimate a.
We estimate the conditional expectations E[Y|X],
E[D|X] and E[Z|X] using supervised machine learners.
Note that the instrument set Z is low-dimensional.

Flexible partially-linear IV model [fiv]

Y = a.D + g(X) + U
D = m(Z) + g(X) + V

where the estimand of interest is a.
We estimate the conditional expectations
E[Y|X],
E[D^|X] and D^:=E[D|Z,X] using supervised machine learnerd.
The instrument is then formed as D^-E^[D^|X] where E^[D^|X] denotes
the estimate of E[D^|X].

Note: "" is a placeholder that is used because last step (estimation of E[D|X])
uses the fitted values from estimating E[D|X,Z].

Which IV model?

The flexible partially-linear IV Model allows for approximation of optimal instruments
as in Belloni et al. (2012),
but relies on a stronger independence assumption than the partially-linear IV Model.
Specifically, the partially-linear IV model uses an orthogonality condition,

E[Cov(U,Z|X)] = 0

whereas the flexible partially-linear IV model uses the conditional mean independence condition

E[U|Z,X] = 0

Note that the generated instruments are generally valid,
Also note that (unlike the standard partially-linear IV model above),
the flexible partially-linear IV model can accommodate both low- and high-dimensional instrument sets Z.

Examples

Below we demonstrate the use of ddml for partially-linear IV models.
Note that estimation models are chosen for demonstration purposes only and
may be kept simple to allow you to run the code quickly.

1. Basic example of the partially-linear IV model with pystacked

2. Basic example of the partially-linear IV model with any learner(s)

3. Basic example of the flexible partially-linear IV model with any learner(s)

4. Detailed example of the flexible partially-linear IV model with any learner(s)