create_uplift_formula: Create an uplift formula.

View source: R/create_uplift_formula.R

create_uplift_formulaR Documentation

Create an uplift formula.

Description

create_uplift_formula is a helper function to create a formula object as required by most functions in the uplift package.

Usage

create_uplift_formula(x, y, trt, env = parent.frame())

Arguments

x

A character vector of predictor names.

y

A character vector of the response name.

trt

A character vector of the treatment name.

env

The environment associated with the result, the calling environment by default.

Value

A formula object.

Author(s)

Leo Guelman leo.guelman@gmail.com

Examples

set.seed(1)
df <- sim_uplift(n = 100, p = 20, response = "binary")
f <- create_uplift_formula(names(df)[-c(1:3)], "y", "T")
class(f)
environment(f) # the callling environment

leoguelman/uplift2 documentation built on April 15, 2022, 4:34 a.m.