Description Usage Arguments Value Examples
One heuristic for evaluating whether a causal forest has detected heterogeneity is to group observations into high- and low-CATE subgroups, estimate the ATE for each group, and determine whether the difference is significantly different than zero.
1 | estimate_subgroup_ate(fit, subgroup, level = 0.9)
|
fit |
A trained causal forest object from
|
subgroup |
A logical vector indicating whether an observation belongs to the subgrouping |
level |
The width of the reported confidence interval |
A one-row tibble with the following columns:
in_est
, in_se
The ATE estimate and corresponding
standard error among observations for which subgroup = TRUE
out_est
, out_se
The ATE estimate and corresponding
standard error among observations for which subgroup = FALSE
diff_est
The difference in ATE: in_est
-
out_est
diff_ci_low
, diff_ci_high
The
confidence interval around diff_est
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
require(grf)
n <- 2000; p <- 10
X <- matrix(rnorm(n * p), n, p)
W <- rbinom(n, 1, 0.4 + 0.2 * (X[, 1] > 0))
Y <- pmax(X[, 1], 0) * W + X[, 2] + pmin(X[, 3], 0) + rnorm(n)
cf <- causal_forest(X, Y, W)
results <- tidy_cf(cf)
# partition into high and low CATE subgroups
estimate_subgroup_ate(cf, results$cate > median(results$cate))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.