cf_eval: Create a causal forest evaluation object

Description Usage Arguments Value Examples

View source: R/cf_eval.R

Description

Create a causal forest evaluation object

Usage

1
cf_eval(fit, Xdat, preds = NULL)

Arguments

fit

A trained causal_forest object

Xdat

The data frame fit was trained on. It may include categorical covariates.

preds

Output from predict.causal_forest. If omitted, it will be called directly to generate OOB predictions and corresponding variance estimates. This may be time consuming.

Value

A cf_eval object, which is essentially just a list with the following elements:

Xdat

The same as the input Xdat but converted to a tibble

res

A results object

varimp

A varimp (variable importance) object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
 require(grf)

 Xdat <- subset(cfex, select = -c(W, Y))
 X <- make_contrasts(Xdat, 'fct')
 cf <- causal_forest(X, cfex$Y, cfex$W)

 cf_eval(cf, Xdat)

## End(Not run)

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