hte_forest {htetree}R Documentation

Estimate Heterogeneous Treatment Effect via Random Forest

Description

Estimate heterogeneous treatment effect via random forest. In each leaf, the treatment effect is the difference of mean outcome weighted by inverse propensity scores in treatment group and control group.

Usage

hte_forest(
  outcomevariable,
  minsize = 20,
  crossvalidation = 20,
  data = edurose_mediation_20181126,
  treatment_indicator = "compcoll25",
  ps_indicator = "propsc_com25",
  ps_linear = "propsc_com25lin",
  covariates = c(linear_terms, ps_indicator),
  negative = FALSE,
  drawplot = TRUE,
  legend.x = 0.08,
  legend.y = 0.25,
  gf,
  ...
)

Arguments

outcomevariable

a character representing the column name of the outcome variable.

minsize

the minimum number of observations in each leaf. The default is set as 20.

crossvalidation

number of cross validations. The default is set as 20.

data

a data frame containing the variables in the model.

treatment_indicator

a character representing the column name of the treatment indicator.

ps_indicator

a character representing the column name of the propensity score.

ps_linear

a character representing name of a column that stores linearized propensity scores.

covariates

a vector of column names of all covariates (linear terms andpropensity score).

negative

a logical value indicating whether we expect the treatment effect to be negative. The default is set as FALSE.

drawplot

a logical value indicating whether to plot the model as part of the output. The default is set as TRUE.

legend.x, legend.y

x and y coordinate to position the legend. The default is set as (0.08, 0.25).

gf

a fitted generalized random forest object

...

further arguments passed to or from other methods.

Value

A list with three elements. The first one is the predicted outcome for each unit. The second is an causalTree object with the tree split information. The third is a data.frame summarizing the prediction results.


[Package htetree version 0.1.18 Index]