estimate.causalTree {causalTree} | R Documentation

## Replace leaf predictions for an `rpart` object, such as one generated by `causalTree`, with estimates of treatment effects within each leaf, using a new dataset.

### Description

Estimate treatment effects within the leaves of a tree (a `rpart` object) using a new dataset.

### Usage

    estimate.causalTree(object, data, treatment, na.action = na.pass)

### Arguments

`object` | A tree-structured fit `rpart` object, such as one generated as a `causalTree` fit.
`data` | New data frame to be used for estimating effects within leaves.
`treatment` | The treatment status of observations in the new dataframe, where 1 represents treated and 0 represents control.

### Details

When the leaf contains only treated or control cases, the function will trace back to the leaf's parent node recursively until the parent can be used to compute causal effect. Please see Athey and Imbens Machine Learning Methods for Estimating Heterogeneous Causal Effects (2015) for details.

### Value

An `rpart` object, where the leaf estimates are treatment effects within the leaves in the input dataset.

### References

Susan A., Guido I. (2015) Recursive Partitioning for Heterogeneous Causal Effects.

### See Also

`honest.causalTree`, `causalTree`, `predict.rpart`,

### Examples

    fit <- 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 <- fit$cptable[,1][which.min(fit$cptable[,4])]

    opfit <- prune(fit, opcp)

    honestFit <- estimate.causalTree(opfit, data = simulation.2,
                                      treatment = simulation.2$treatment)

[Package causalTree version 0.0 Index]