Wraps DoubleML (+ mlr3 / mlr3learners) when available. Without DoubleML, falls back to a hand-rolled cross-fitting estimator using ridge regression (glmnet) or, last-ditch, OLS partialling out.
Examples
# \donttest{
set.seed(1)
n <- 200
X <- matrix(rnorm(n * 2), n, 2)
tr <- rbinom(n, 1, plogis(X[, 1]))
y <- 2 * tr + X[, 1] + rnorm(n)
df <- data.frame(y = y, d = tr, x1 = X[, 1], x2 = X[, 2])
res <- suppressWarnings(estimate_plr(df, treatment = "d", outcome = "y",
covariates = c("x1", "x2")))
res$ate
#> [1] 2.063619
# }
