ctseff: Estimating average effect curve for continuous treatment

Description Usage Arguments Value References Examples

View source: R/ctseff.R

Description

ctseff is used to estimate the mean outcomes in a population had all subjects received given levels of a continuous (unconfounded) treatment.

Usage

1
2
ctseff(y, a, x, bw.seq, sl.lib=c("SL.earth","SL.gam","SL.glm","SL.glmnet",
  "SL.glm.interaction","SL.mean","SL.ranger"))

Arguments

y

outcome of interest.

a

continuous treatment.

x

covariate matrix.

bw.seq

sequence of bandwidth values.

sl.lib

algorithm library for SuperLearner. Default library includes "earth", "gam", "glm", "glmnet", "glm.interaction", "mean", and "ranger".

Value

A list containing the following components:

res

estimates/SEs/CIs for population means.

bw.risk

estimated risk at sequence of bandwidth values.

References

Kennedy EH, Ma Z, McHugh MD, Small DS (2017). Nonparametric methods for doubly robust estimation of continuous treatment effects. Journal of the Royal Statistical Society, Series B. arxiv:1507.00747

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
n <- 500
x <- matrix(rnorm(n * 5), nrow = n)
a <- runif(n)
y <- a + rnorm(n, sd = .5)

ce.res <- ctseff(y, a, x, bw.seq = seq(.2, 2, length.out = 100))
plot.ctseff(ce.res)

# check that bandwidth choice is minimizer
plot(ce.res$bw.risk$bw, ce.res$bw.risk$risk)

ehkennedy/npcausal documentation built on Feb. 26, 2021, 2:43 a.m.