UpliftPerCat {tools4uplift} | R Documentation |
Uplift barplot for categorical variables
Description
Computes the observed uplift per category and creates a barplot.
Usage
UpliftPerCat(data, treat, outcome, x, ...)
Arguments
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. |
Value
returns a barplot representing the uplift per category.
Author(s)
Mouloud Belbahri
Examples
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))
[Package tools4uplift version 1.0.0 Index]