UpliftPerCat: Uplift barplot for categorical variables

Description Usage Arguments Value Author(s) Examples

View source: R/UpliftPerCat.R

Description

Computes the observed uplift per category and creates a barplot.

Usage

1
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

 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))

tools4uplift documentation built on Jan. 11, 2022, 3 a.m.