Title: Estimation of Causal Effects with Outcomes Truncated by Death
Version: 0.1.0
Author: Zhixuan Shao [cre], Bo Liu [ctb], Linbo Wang [aut], Xiao-Hua Zhou [cph]
Maintainer: Zhixuan Shao <shaozhixuansh@pku.edu.cn>
Description: Estimation of the survivor average causal effect under outcomes truncated by death, which requires the existence of a substitution variable. It can be applied to both experimental and observational data.
Depends: R (≥ 3.1.0), numDeriv
Suggests: stats
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
Encoding: UTF-8
URL: https://github.com/KillingVectorField/causal-inference-truncated-by-death
LazyData: true
RoxygenNote: 5.0.1
NeedsCompilation: no
Packaged: 2019-01-05 15:10:04 UTC; billy
Repository: CRAN
Date/Publication: 2019-01-09 17:50:03 UTC

Estimate the confidence interval of SACE using bootstrap.

Description

Give quantiles of bootstrap samples SACE.

Usage

boot.ci(object, nboot = 1000, seed = 100:(100 + nboot - 1), alpha = 0.05,
  max.step = 1000, singular.ok = FALSE, print.progress = TRUE)

Arguments

object

an object of class sace.

nboot

a positive integer. The number of bootstrap samples desired.

seed

an integer vector with length nboot. Seed to generate samples.

alpha

confidence level.

max.step

see documentation of sace.

singular.ok

see documentation of sace.

print.progress

logical. Need progress be printed?

Value

a list with 4 elements:

nskip

number of failures during bootstrap.

sace.boot.record

a vector with length nboot-skip. SACE estimates of all bootstrap samples.

boot.sd

scaler. Standard deviation of SACE estimates of all bootstrap samples.

ci

a vector with length 2. Estimated confidence interval.

Author(s)

Zhixuan Shao <shaozhixuansh@pku.edu.cn>


Print results of sace

Description

print.sace prints estimation of the SACE (survivor average causal effect).

Usage

## S3 method for class 'sace'
print(x, ...)

Arguments

x

an object of class sace.

...

additional arguments.

Value

the input object is returned silently.


Estimation of causal effects with outcomes truncated by death

Description

sace estimates survivor average causal effects (SACE) with outcomes truncated by death.

Usage

sace(Z, S, Y, X, A, subset, optim.method = "BFGS", max.step = 1000,
  singular.ok = TRUE, need.variance = TRUE, hessian = TRUE)

Arguments

Z

a logical vector. Exposure indicator. Convetionally, 1 means treatment and 0 means control. Must not have missing values.

S

a logical vector. Survival indicator. 1 means survival and 0 means death. Must not have missing values.

Y

a numeric vector. (Univariate) outcomes. May have NA where S=0 (since Y is not well-defined where S=0).

X

an optional numeric matrix or vector. Baseline covariates.

A

an optional numeric matrix or vector. Substitution variable(s) which satisfies the assumptions of "exclusion restriction" and "substitution relevance". See references. If A == NULL, then the naive method, namely OLS, will be used.

subset

an optional vector specifying a subset of obervations to be used.

optim.method

The method to be used for maximum likelihood optimization. See optim.

max.step

integer. Maximum iterating steps of maximum likelihood optimization.

singular.ok

logical. Refers to the OLS estimation of the coefficients alpha_1 and alpha_2 using lm. If FALSE (default), a singular fit raises an error.

need.variance

logical. Is variance of parameters and estimators needed? See details.

hessian

logical. If TRUE, the hessian returned by optim will be used to compute the information matrix. If FALSE, the matrix will be calculated by an explicit formula.

Details

This function sace, gives estimation of average causal effects (ACE) with outcomes truncated by death. The identification of SACE relies on the existence of a substitution variable and requires the assumptions of monotonicity, ignorability, exclusion restriction, and relevance. While the naive estimates given by the coefficient of Z from lm(Y ~ Z + X + A, subset = S == 1) are restricted among survivors and therefore may be subject to selection bias, this method gives consistent estimates of the SACE (survivor average causal effect), defined as the average causal effect among the subgroup consisting of subjects who would survive under either exposure, i.e. among the always-survivor group (G=LL). See references for details of the assumptions and the model parameterizations.

Parameters beta and gamma are estimated by MLE, using optim.

If need.variance == TRUE, the asymptotic variance estimators of both parameters and estimators will be given. This requires the numDeriv package.

Value

a list with following elements:

CALL

function call.

data

data used (within the specified subset).

optim.method

method used for optimization.

need.variance

is variance of parameters and estimators needed?

n

sample size.

mu_0_LL

average potential outcomes among control group, E[ Y(0) | G=LL ].

mu_1_LL

average potential outcomes among treatment group, E[ Y(1) | G=LL ].

sace

survivor average causal effect, equals mu_1_LL-mu_0_LL.

beta

Pr{S(1)=1| X,A}=expit(\beta_0+X' \beta_1+ A \beta_2), estimated by MLE.

gamma

Pr{S(0)=1| X,A}/Pr{S(1)=1| X,A}=expit(\gamma_0+X' \gamma_1+ A \gamma_2), estimated by MLE.

beta_gamma.convergence

indicator of convergence of MLE optimization of beta and gamma. 0 means convergence. See optim.

alpha_1

E[Y(0)| Z=0, G=LL, X, A ]=\alpha_{10}+X' \alpha_{11}+ A \alpha_{12}, coefficients of lm(Y ~ 1 + X + A, subset = Z == 0).

alpha_2

E[Y(1)| Z=1, G=LL, X, A ]=\alpha_{20}+X' \alpha_{21}+ G \alpha_{22}, coefficients of lm(Y ~ 1 + X + W.expit, subset = (Z == 1 & S == 1)).

The following items will be given only if need.variance == TRUE:

beta.var

estimated asymptotic covariance matrix of beta.

gamma.var

estimated asymptotic covariance matrix of gamma.

relevance.Pvalue

P value of the asymptotic chi-squared test on the relevance assumption for the substitution variable. A large P value suggests that the relevance assumption may not hold, namely, the substitution variable(s) may have little impact on the latent survival type.

alpha_1.var

estimated asymptotic covariance matrix of alpha_1.

alpha_2.var

estimated asymptotic covariance matrix of alpha_2.

mu_0_LL.var

estimated asymptotic variance of mu_0_LL.

mu_1_LL.var

estimated asymptotic variance of mu_1_LL.

sace.var

estimated asymptotic variance of the SACE.

Note

The length of vectors Z, Y, S, as well as the row number of matrix X and A must equal the sample size n.

Author(s)

Linbo Wang <linbo.wang@utoronto.ca>

Zhixuan Shao <shaozhixuansh@pku.edu.cn>

References

Linbo Wang, Xiao-Hua Zhou, Thomas S. Richardson; Identification and estimation of causal effects with outcomes truncated by death, Biometrika, Volume 104, Issue 3, 1 September 2017, Pages 597-612, https://doi.org/10.1093/biomet/asx034

Examples

attach(simulated_data)
X <- cbind(X.X1, X.V2, X.V3)
sace.result <- sace(Z, S, Y, X, A)
sace

Simulated data with known SACE

Description

This simulated dataset is to illustrate how to use sace to estimate the SACE, and compare it with other naive methods. In this simulated data, by design, there is confounding between Z and Y caused by X, and confounding between S and Y caused by X.

Format

A data frame with 5000 observations and 7 variables. Z, A, Y, S are 1-dimensional, and X is 3-dimensional. The variables are as follows:

Z

Binary treatment

X.X1

A factor covariate with 2 levels (1 and -1)

X.V2

A continuous covariate

X.V3

A contunuous covariate

A

The substitution variable which is continuous

Y

The continuous outcome. NA where S = 0

S

The survival indicator. 1 means survival and 0 means death.

Source

The dataset is generated by the simulation design of Wang et al. 2017 with \delta_1 = 1 and \delta_0 = 1, which allows confounding between Z and Y caused by X, and confounding between S and Y caused by X.

References

Linbo Wang, Xiao-Hua Zhou, Thomas S. Richardson; Identification and estimation of causal effects with outcomes truncated by death, Biometrika, Volume 104, Issue 3, 1 September 2017, Pages 597-612, https://doi.org/10.1093/biomet/asx034


Summarize results of sace

Description

summary.sace summary estimation of the SACE (survivor average causal effect) and all other model parameters.

Usage

## S3 method for class 'sace'
summary(object, ...)

Arguments

object

an object of class sace.

...

additional arguments.

Value

the input object is returned silently.

Note

If need.variance is TRUE, sace must have been called with need.variance == TRUE, so that the information needed was recorded.