estimate_subgroup_ate: Find difference in ATE between subgroups

Description Usage Arguments Value Examples

View source: R/diagnose_fit.R

Description

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.

Usage

1
estimate_subgroup_ate(fit, subgroup, level = 0.9)

Arguments

fit

A trained causal forest object from causal_forest

subgroup

A logical vector indicating whether an observation belongs to the subgrouping

level

The width of the reported confidence interval

Value

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

Examples

 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)

ensley-nexant/cfeval documentation built on May 20, 2020, 12:34 a.m.