plot.cf_eval: Visualize a causal forest evaluation object

Description Usage Arguments Details Value See Also Examples

View source: R/cf_eval.R

Description

Many different figures and diagnostic plots can be created. Specify the desired plot using the kind argument.

Usage

1
2
## S3 method for class 'cf_eval'
plot(x, kind, ...)

Arguments

x

A cf_eval object

kind

The type of plot to create

...

Additional arguments passed to subsequent plot functions

Details

Possible options for kind are

cate

A density plot of estimated conditional average treatment effects, i.e. the causal forest predictions. The most straightforward way to look for treatment effect heterogeneity.

bias

A histogram of each observation's contribution to the overall bias of the model, relative to a simple difference in means.

propensities

A histogram of fitted propensities. The causal forest requires the assumption that we cannot deterministically tell the treatment status of an individual given its covariates. In other words, none of the propensity scores should be near zero or one.

balnum, balcat

After accounting for propensity, covariate distributions should be balanced between treated and control observations. balnum plots overlaid histograms, one for treated and one for control, of each numeric covariate. balcat plots stacked bar charts of the proportions of each categorical covariate.

catecovar

A scatter plot of estimated CATEs as a function of a certain covariate.

Value

A plot

See Also

Other plotting methods: plot.ate(), plot.results(), plot.tuning_output()

Examples

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

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

 cfe <- cf_eval(cf, Xdat)
 plot(cfe, kind = 'cate')
 plot(cfe, kind = 'balnum', covar = c('V1', 'V2', 'V3'))

## End(Not run)

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