Skip to contents

Estimates theta in Y = theta D + g(X) + U with the Robinson partialling-out Neyman-orthogonal score \(\psi(W; \theta, \eta) = (Y - l(X) - \theta(D - m(X)))(D - m(X))\) (Chernozhukov et al. 2018, Eq. 4.4), l(X) = E(Y|X), m(X) = E(D|X) fit by OLS on each fold complement, and the pooled DML2 moment (their Definition 3.2): theta = sum(Vhat (Y - lhat)) / sum(Vhat^2) with Vhat = D - mhat. The variance is the Theorem 3.2 plug-in, se = sqrt(sigma2 / n) with sigma2 = mean(psi^2) / mean(Vhat^2)^2. The K folds come from a seeded R sample.int shuffle, positions assigned round-robin.

Usage

Causdr2(y, d, X, K = 2L, seed = 1L)

Arguments

y

Outcome, length n.

d

Treatment (continuous or binary).

X

Control matrix, n rows.

K

Number of cross-fitting folds; K = 1 disables cross-fitting (anchoring use only).

seed

Seed for the fold shuffle.

Value

List with estimate, se, K, n, folds, method.

References

Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., Hansen, C., Newey, W. and Robins, J. (2018), Double/debiased machine learning for treatment and structural parameters, The Econometrics Journal 21(1), C1-C68, doi:10.1111/ectj.12097, Eq. 4.4, Definition 3.2, Theorem 3.2.

Examples

Causdr2(y = c(1, 2, 3, 4, 5, 6, 7, 8), d = c(1, 2, 3, 4, 5, 6, 7, 8),
  X = c(2.5, 1.0, 3.5, 4.0, 2.0, 5.5, 3.0, 6.5))
#> $estimate
#> [1] 1
#> 
#> $se
#> [1] 0
#> 
#> $K
#> [1] 2
#> 
#> $n
#> [1] 8
#> 
#> $folds
#> [1] 1 2 2 2 2 1 1 1
#> 
#> $method
#> [1] "Chernozhukov et al. (2018) DML2, partialling-out score Eq. 4.4"
#>