Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/susanathey/causalTree

Working repository for Causal Tree and extensions
https://github.com/susanathey/causalTree

Last synced: 3 days ago
JSON representation

Working repository for Causal Tree and extensions

Awesome Lists containing this project

README

        

# causalTree Introduction

The _causalTree_ function builds a regression model and returns an _rpart_ object, which is the object derived from _rpart_ package, implementing many ideas in the CART (Classification and Regression Trees), written by Breiman, Friedman, Olshen and Stone. Like _rpart_, _causalTree_ builds a binary regression tree model in two stages, but focuses on estimating heterogeneous causal effect.

To install this package in R, run the following commands:

```R
install.packages("devtools")
library(devtools)
install_github("susanathey/causalTree")
```

Example usage:

```R
library(causalTree)
tree <- causalTree(y~ x1 + x2 + x3 + x4, data = simulation.1, treatment = simulation.1$treatment,
split.Rule = "CT", cv.option = "CT", split.Honest = T, cv.Honest = T, split.Bucket = F,
xval = 5, cp = 0, minsize = 20, propensity = 0.5)

opcp <- tree$cptable[,1][which.min(tree$cptable[,4])]

opfit <- prune(tree, opcp)

rpart.plot(opfit)

```

For More details, please check out briefintro.pdf.

#### References
Susan Athey, Guido Imbens. Recursive Partitioning for Heterogeneous Causal Effects. [link]