get_GATES | R Documentation |
Accessor function for the GATES generic target estimates
get_GATES(x, learner = "best", plot = TRUE)
x |
An object of the class |
learner |
A character string of the learner whose GATES generic target estimates shall be accessed. Default is |
plot |
Logical. If |
An object of class "GATES_info"
, which consists of the following components:
estimate
A numeric vector of point estimates of the GATES generic targets.
confidence_interval
A numeric matrix of the lower and upper confidence bounds for each generic target. The confidence level of the implied confidence interval is equal to 1 - 2 * significance_level
.
confidence_level
The confidence level of the confidence intervals. Equals 1 - 2 * significance_level
.
learner
The argument learner
.
plot
An object of class "ggplot"
. Only returned if the argument plot = TRUE
.
GenericML()
,
get_BLP()
,
get_CLAN()
,
get_best()
,
print.BLP_info()
,
print.GATES_info()
,
print.CLAN_info()
if(require("rpart") && require("ranger")){ ## generate data set.seed(1) n <- 150 # number of observations p <- 5 # number of covariates D <- rbinom(n, 1, 0.5) # random treatment assignment Z <- matrix(runif(n*p), n, p) # design matrix Y0 <- as.numeric(Z %*% rexp(p) + rnorm(n)) # potential outcome without treatment Y1 <- 2 + Y0 # potential outcome under treatment Y <- ifelse(D == 1, Y1, Y0) # observed outcome ## column names of Z colnames(Z) <- paste0("V", 1:p) ## specify learners learners <- c("tree", "mlr3::lrn('ranger', num.trees = 10)") ## perform generic ML inference # small number of splits to keep computation time low x <- GenericML(Z, D, Y, learners, num_splits = 2, parallel = FALSE) ## access best learner get_best(x) ## access BLP generic targets for best learner w/o plot get_BLP(x, learner = "best", plot = FALSE) ## access BLP generic targets for ranger learner w/o plot get_BLP(x, learner = "mlr3::lrn('ranger', num.trees = 10)", plot = FALSE) ## access GATES generic targets for best learner w/o plot get_GATES(x, learner = "best", plot = FALSE) ## access GATES generic targets for ranger learner w/o plot get_GATES(x, learner = "mlr3::lrn('ranger', num.trees = 10)", plot = FALSE) ## access CLAN generic targets for "V1" & best learner, w/o plot get_CLAN(x, learner = "best", variable = "V1", plot = FALSE) ## access CLAN generic targets for "V1" & ranger learner, w/o plot get_CLAN(x, learner = "mlr3::lrn('ranger', num.trees = 10)", variable = "V1", plot = FALSE) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.