
Best-linear-predictor test for treatment-effect heterogeneity
Source:R/causal_forest_honest.R
morie_hte_blp_test.RdRegress the demeaned outcome on the residualised treatment and its
interaction with the centred CATE predictions. alpha near 1 says
the forest's average effect is calibrated; beta is the
heterogeneity coefficient, and beta = 0 means the predicted
variation carries no signal. Pass out-of-bag predictions – in-bag
ones inflate beta mechanically. Mirrors morie.fn.crfhte.
References
Chernozhukov V, Demirer M, Duflo E, Fernandez-Val I (2018). Generic machine learning inference on heterogenous treatment effects in randomized experiments. arXiv:1712.04802.
Examples
set.seed(2)
n <- 100
X <- matrix(rnorm(n * 2), n, 2)
d <- rbinom(n, 1, 0.5)
y <- 1 + X[, 1] + d * (0.5 + X[, 2]) + rnorm(n, 0, 0.3)
tau <- 0.5 + X[, 2] + rnorm(n, 0, 0.2)
morie_hte_blp_test(y, d, tau)
#> $alpha
#> [1] 0.3927187
#>
#> $beta
#> [1] 1.339662
#>
#> $se_beta
#> [1] 0.2500231
#>
#> $p_value
#> [1] 2.833643e-07
#>
#> $heterogeneous
#> [1] TRUE
#>
#> $n
#> [1] 100
#>