ipsi: Estimating effects of incremental propensity score...

Description Usage Arguments Value Details References Examples

View source: R/ipsi.R

Description

ipsi is used to estimate effects of incremental propensity score interventions, i.e., estimates of mean outcomes if the odds of receiving treatment were multiplied by a factor delta.

Usage

1
2
3
ipsi(y, a, x.trt, x.out, time, id, delta.seq, nsplits, ci_level = 0.95,
 progress_bar = TRUE, return_ifvals = FALSE, fit,
 sl.lib=c("SL.earth","SL.gam","SL.glm","SL.glmnet","SL.glm.interaction", "SL.mean","SL.ranger","rpart"))

Arguments

y

Outcome of interest measured at end of study.

a

Binary treatment.

x.trt

Covariate matrix for treatment regression.

x.out

Covariate matrix for outcome regression.

time

Measurement time.

id

Subject identifier.

delta.seq

Sequence of delta increment values for incremental propensity score intervention.

nsplits

Integer number of sample splits for nuisance estimation. If nsplits = 1, sample splitting is not used, and nuisance functions are estimated n full sample (in which case validity of standard errors and confidence intervals requires empirical process conditions). Otherwise must have nsplits > 1.

ci_level

A numeric value giving the level (1 - alpha) of the confidence interval to be computed around the point estimate.

progress_bar

A logical value indicating whether to print a customized progress bar as various stages of computation reach completion. The default is TRUE, printing a progress bar to inform the user.

return_ifvals

A logical indicating whether the estimated observation-level values of the influence function ought to be returned as part of the output object. The default is FALSE as these values are rarely of interest in standard usage.

fit

How nuisance functions should be estimated. Options are "rf" for random forests via the ranger package, or "sl" for super learner.

sl.lib

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

Value

A list containing the following components:

res

estimates/SEs and uniform CIs for population means.

res.ptwise

estimates/SEs and pointwise CIs for population means.

calpha

multiplier bootstrap critical value.

Details

Treatment and covariates are expected to be time-varying and measured throughout the course of the study. Therefore if n is the number of subjects and T the number of timepoints, then a, time, and id should all be vectors of length nxT, and x.trt and x.out should be matrices with nxT rows. However y should be a vector of length n since it is only measured at the end of the study. The subject ordering should be consistent across function inputs, based on the ordering specified by id. See example below for an illustration.

References

Kennedy EH. Nonparametric causal effects based on incremental propensity score interventions. arxiv:1704.00211

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
n <- 500
T <- 4

time <- rep(1:T, n)
id <- rep(1:n, rep(T, n))
x.trt <- matrix(rnorm(n * T * 5), nrow = n * T)
x.out <- matrix(rnorm(n * T * 5), nrow = n * T)
a <- rbinom(n * T, 1, .5)
y <- rnorm(mean=1,n)

d.seq <- seq(0.1, 5, length.out = 10)

ipsi.res <- ipsi(y, a, x.trt, x.out, time, id, d.seq)

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