plot_bias: Plot a histogram of estimated bias

Description Usage Arguments Value Examples

View source: R/diagnose_fit.R

Description

Plot a histogram of estimated bias

Usage

1

Arguments

results

The output from tidy_cf

...

Additional arguments passed to geom_histogram.

Value

A ggplot2 plot object

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)

 # fit the model and extract results
 cf <- causal_forest(X, Y, W)
 results <- tidy_cf(cf)

 plot_bias(results, bins = 30)

## End(Not run)

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