View source: R/causal_forest.R
causal_forest | R Documentation |
Trains a causal forest that can be used to estimate conditional average treatment effects.
causal_forest(
n_trees,
data,
outcome,
covariates,
treat,
minsize = 5,
alpha = 0.05,
feature_fraction = 0.3,
sample_fraction = 0.5,
honest_split = TRUE,
honesty_fraction = 0.5
)
n_trees |
number of trees to grow as numeric vector. |
data |
a data frame with predictor, treatment assignment and outcome variables. |
outcome |
name of the outcome variable as character vector. |
covariates |
names of the predictors as character vector. |
treat |
name of the treatment indicator variable as character vector (treatment indicator must be binary numeric 1 = treatment, 0 = control with no NA). |
minsize |
minimum number of treatment and control observations that must be present in each split as numeric vector. Default 5. |
alpha |
weighting of cost function numeric vector between 0-1. weights closer to 1 put more emphasis on maximizing heterogeneity. weights closer to 0 put more weight on precisely estimating treatment effects. Default 0.05. |
feature_fraction |
fraction of total number of predictors to use in fitting each tree as numeric vector between 0-1. Default 0.3. |
sample_fraction |
fraction of observations to fit each tree with. Default 0.5. |
honest_split |
enables honest splitting. Default TRUE. |
honesty_fraction |
fraction of data to be used for honest estimation as numeric vector between 0-1. Default 0.5. |
list of causal trees.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.