Description Usage Arguments Value Examples
Split Estimators for Control and Treatment
1 2 3 4 5 6 7 8 9 | hete_split(x, ...)
## Default S3 method:
hete_split(x, y, tmt, est, tmt_est = est, ctl_est = est,
...)
## S3 method for class 'formula'
hete_split(x, data, est, tmt_est = est, ctl_est = est,
...)
|
x |
a |
... |
ignored. |
y |
a vector of outcomes. |
tmt |
a vector indicating which units received treatment. |
est, tmt_est, ctl_est |
an estimator to use for modeling the treatment
effect. This must be a function which takes two arguments, |
data |
a |
A hete_split
object.
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_split(voted ~ . | treatment, data = df, est = random_forest)
p <- predict(m, df)
uc <- uplift(df$voted, df$treatment, p)
plot(uc)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.