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 |
nboot |
a positive integer. The number of bootstrap samples desired. |
seed |
an integer vector with length |
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 |
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 |
... |
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, |
S |
a logical vector. Survival indicator. |
Y |
a numeric vector. (Univariate) outcomes. May have |
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 |
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 |
need.variance |
logical. Is variance of parameters and estimators needed? See details. |
hessian |
logical. If |
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, |
mu_1_LL |
average potential outcomes among treatment group, |
sace |
survivor average causal effect, equals |
beta |
|
gamma |
|
beta_gamma.convergence |
indicator of convergence of MLE optimization of beta and gamma. 0 means convergence. See optim. |
alpha_1 |
|
alpha_2 |
|
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
whereS = 0
- S
The survival indicator.
1
means survival and0
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 |
... |
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.