cate | R Documentation |
Conditional Average Treatment Effect estimation via Double Machine Learning
cate( treatment, response_model, propensity_model, contrast = c(1, 0), data, nfolds = 5, type = "dml1", ... )
treatment |
formula specifying treatment and variables to condition on |
response_model |
SL object |
propensity_model |
SL object |
contrast |
treatment contrast (default 1 vs 0) |
data |
data.frame |
nfolds |
Number of folds |
type |
'dml1' or 'dml2' |
... |
additional arguments to SuperLearner |
cate.targeted object
Klaus Kähler Holst
sim1 <- function(n=1e4, seed=NULL, return_model=FALSE, ...) { suppressPackageStartupMessages(require("lava")) if (!is.null(seed)) set.seed(seed) m <- lava::lvm() regression(m, ~a) <- function(z1,z2,z3,z4,z5) cos(z1)+sin(z1*z2)+z3+z4+z5^2 regression(m, ~u) <- function(a,z1,z2,z3,z4,z5) (z1+z2+z3)*a + z1+z2+z3 + a distribution(m, ~a) <- binomial.lvm() if (return_model) return(m) lava::sim(m, n, p=par) } d <- sim1(200) if (require("SuperLearner",quietly=TRUE)) { e <- cate(a ~ z1+z2+z3, response=u~., data=d) e }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.