Description Usage Arguments Value Author(s) Examples
Computes the observed uplift per category and creates a barplot.
1 | UpliftPerCat(data, treat, outcome, x, ...)
|
data |
a data frame containing the treatment, the outcome and the variable of interest. |
treat |
name of a binary (numeric) vector representing the treatment assignment (coded as 0/1). |
outcome |
name of a binary response (numeric) vector (coded as 0/1). |
x |
name of the explanatory variable of interest. |
... |
extra parameters for the barplot. |
returns a barplot representing the uplift per category.
Mouloud Belbahri
1 2 3 4 5 6 7 8 9 10 | library(tools4uplift)
data("SimUplift")
binX1 <- BinUplift(data = SimUplift, treat = "treat", outcome = "y", x = "X1",
n.split = 100, alpha = 0.01, n.min = 30)
SimUplift$quantizedX1 <- predict(binX1, SimUplift$X1)
UpliftPerCat(data = SimUplift, treat = "treat", outcome = "y",
x = "quantizedX1", xlab='Quantized X1', ylab='Uplift',
ylim=c(-1,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.