Description Usage Arguments Value Examples
Estimate the causal effects using honest tree model.
1 |
object |
A tree-structured fit object. |
formula |
A regression formula. |
data |
New data frame in which to interact the variables named in the formula. |
weights |
The treatment status of new observations |
The estimated causal effects of data
.
Notice here when the leaf contains only treated or control cases, the function will trace back to the leaf's parent mnode recursively until the parent can be used to compute causal effect.
1 2 3 4 5 6 7 8 9 | fit <- causalTree(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x10,
data = simulation.1, treatment = simulation.1$treatment, split.option = "CT",
cv.option = "matching", cp = 0, minsize = 5, minbucket = 5)
opcp <- fit$cptable[,1][which.min(fit$cptable[,4])]
opfit <- prune(fit, opcp)
estimation <- estimate.causalTree(opfit, data = simulation.2, treatment = simulation.2$treatment)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.