causal_tree: Trains a single causal tree

View source: R/causal_tree.R

causal_treeR Documentation

Trains a single causal tree

Description

Trains a single causal tree

Usage

causal_tree(
  data,
  outcome,
  covariates,
  treat,
  minsize,
  alpha,
  feature_fraction,
  sample_fraction,
  honest_split,
  honesty_fraction
)

Arguments

data

a data frame with predictor, treatment assignment, outcome variables and no NA.

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.

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.

feature_fraction

fraction of total number of predictors to use in fitting each tree as numeric vector between 0-1.

sample_fraction

fraction of observations to fit tree with.

honest_split

enables honest splitting. Default TRUE.

honesty_fraction

fraction of data to be used for honest estimation as numeric vector between 0-1.

Value

trained causal tree (splitting structure, cate estimates, oob samples, data for variable importance computation)


till-tietz/rcf documentation built on May 7, 2023, 10:23 p.m.