hete_tot: Transformed Outcome Estimator

Description Usage Arguments Value Examples

View source: R/hete_tot.R

Description

Transformed Outcome Estimator

Usage

1
2
3
4
5
6
7
hete_tot(x, ...)

## Default S3 method:
hete_tot(x, y, tmt, est, ...)

## S3 method for class 'formula'
hete_tot(x, data, est, ...)

Arguments

x

a data.frame or matrix with predictor variables measured prior to treatment or unaffected by treatment. Alternatively, this can be a model formula: outcome ~ x1 + x2 | treatment

...

ignored.

y

a vector of outcomes.

tmt

a vector indicating which units received treatment.

est

an estimator to use for modeling the treatment effect. This must be a function which takes two arguments, x and y and returns an object which has an implementation of predict. The predict implementation must return a single vector with the estimated outcome or probability of success in the case of binary outcomes.

data

a data.frame containing the variables specified in x when using a formula to specify the model.

Value

A hete_tot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
library(tidyverse)
data(gotv)

df <- gotv %>%
  filter(treatment %in% c("Control", "Neighbors")) %>%
  mutate(treatment = ifelse(treatment == "Control", 0, 1))

m <- hete_tot(voted ~ . | treatment, data = df, est = random_forest)
p <- predict(m, df)

uc <- uplift(df$voted, df$treatment, p)
plot(uc)


## End(Not run)

wlattner/hete documentation built on May 4, 2019, 12:57 a.m.