ccif
implements recursive partitioning in a causal conditional inference framework."ccif"(formula, data, ...)
"ccif"(
x,
y,
ct,
mtry = floor(sqrt(ncol(x))),
ntree = 100,
split_method = c("ED", "Chisq", "KL", "L1", "Int"),
interaction.depth = NULL,
pvalue = 0.05,
bonferroni = FALSE,
minsplit = 20,
minbucket_ct0 = round(minsplit/4),
minbucket_ct1 = round(minsplit/4),
keep.inbag = FALSE,
verbose = FALSE,
...)
"print"(x, ...)
trt()
must be used in the model equation to identify the binary treatment variable. For example, if the treatment is represented by a variable named treat
, then the right hand side of the formula must include the term +trt(treat)
.TRUE
, an nrow(x) by ntree matrix is returned, whose entries are the "in-bag" samples in each tree.independence_test{coin}
. See details.ccif
, which is a list with the
following components:ccif
The independence test between each input and the transformed response is performed by calling independence_test{coin}
. Additional arguments may be passed to this function via `$\ldots$'.
All split methods are described in Guelman et al. (2013a, 2013b).
This function is very slow at the moment. It was built as a prototype in R. A future version of this package will provide an interface to C++ for this function, which is expected to significantly improve speed.
Guelman, L., Guillen, M., and Perez-Marin A.M. (2013a). Uplift random forests. Cybernetics & Systems, forthcoming.
Guelman, L., Guillen, M., and Perez-Marin A.M. (2013b). Optimal personalized treatment rules for marketing interventions: A review of methods, a new proposal, and an insurance case study. Submitted.
Hothorn, T., Hornik, K. and Zeileis, A. (2006).Unbiased recursive partitioning: A conditional inference framework. Journal of Computational and Graphical Statistics, 15(3): 651-674.
Strasser, H. and Weber, C. (1999). On the asymptotic theory of permutation statistics. Mathematical Methods of Statistics, 8: 220-250.
library(uplift)
### Simulate train data
set.seed(12345)
dd <- sim_pte(n = 100, p = 6, rho = 0, sigma = sqrt(2), beta.den = 4)
dd$treat <- ifelse(dd$treat == 1, 1, 0)
### Fit model
form <- as.formula(paste('y ~', 'trt(treat) +', paste('X', 1:6, sep = '', collapse = "+")))
fit1 <- ccif(formula = form,
data = dd,
ntree = 50,
split_method = "Int",
distribution = approximate (B=999),
pvalue = 0.05,
verbose = TRUE)
print(fit1)
summary(fit1)
Run the code above in your browser using DataLab