ivah {ivtools} | R Documentation |
Instrumental variable estimation of the causal exposure effect in additive hazards (AH) models
Description
ivah
performs instrumental variable estimation of the causal exposure effect in
AH models with individual-level data. Below, Z
, X
, and
T
are the instrument, the exposure, and the outcome, respectively.
L
is a vector of covariates that we wish to control for in the analysis;
these would typically be confounders for the instrument and the outcome.
Usage
ivah(estmethod, X, T, fitZ.L=NULL, fitX.LZ=NULL, fitT.LX=NULL, data,
ctrl=FALSE, clusterid=NULL, event, max.time, max.time.psi, n.sim=100,
vcov.fit=TRUE, ...)
Arguments
estmethod |
a string specifying the desired estimation method; either |
X |
a string specifying the name of the exposure |
T |
a string specifying the name of the follow-up time |
fitZ.L |
an object of class |
fitX.LZ |
an object of class |
fitT.LX |
If |
data |
a data frame containing the variables in the model. The covariates, instrument,
exposure and outcome can have arbitrary names, e.g. they don't need to
be called |
ctrl |
logical. Should the control function |
clusterid |
an optional string containing the name of a cluster identification variable when
data are clustered. Specifying |
event |
a string specifying the name of the status indicator, 0="no event", 1="event".
This argument is not used when |
max.time |
optional follow-up for estimating |
max.time.psi |
optional follow-up for estimating |
n.sim |
optional number of resamplings for testing goodness-of-fit of constant effects model
for G-estimation. Defaults to 100. This argument is not used when |
vcov.fit |
logical. Should the variance-covariance matrix be computed? |
... |
optional arguments passed on to the |
Details
The ivah
estimates different parameters, depending on whether
estmethod="ts"
or estmethod="g"
. If estmethod="ts"
, then
ivah
uses two-stage estimation to estimate the parameter \psi
in the causal AH model
\lambda(t|L,Z,X)-\lambda_0(t|L,Z,X)=m^T(L)X\psi.
Here, \lambda_0(t|L,Z,X)
is counterfactual hazard function,
had the exposure been set to 0. The vector function m(L)
contains interaction terms
between L
and X
. These are specified
implicitly through the model fitY
. The model fitX.LZ
is used to
construct predictions \hat{X}=\hat{E}(X|L,Z)
. These predictions are
subsequently used to re-fit the model fitY
, with X
replaced with
\hat{X}
. The obtained coefficient(s) for X
is the two-stage
estimator of \psi
.
If estmethod="g"
, then ivah
uses G-estimation to estimate the function
B(t)
in the causal AH model
\lambda(t|L,Z,X)-\lambda_0(t|L,Z,X)=XdB(t).
It also delivers an estimate of dB(t)
assuming that this function is
constant across time (=\psi
).
Value
ivah
returns an object of class "ivah"
, which inherits from
class "ivmod"
. An object of class "ivah"
is a list containing
call |
the matched call. |
input |
|
est |
a vector containing the estimate of |
vcov |
the variance-covariance matrix for the estimate of |
estfunall |
a matrix of all subject-specific contributions to the estimating functions used in the estimation process.
One row for each subject, one column for each parameter. If |
d.estfun |
the jacobian matrix of |
converged |
logical. Was a solution found to the estimating equations? |
fitY |
the re-fitted model |
stime |
the ordered event times within (0,max.time). This element is NULL when |
B |
the estimate of |
se_B |
the standard error of the estimate of |
pval_0 |
p-value corresponding to supremum test of the null |
eps_B |
the iid-decomposition of |
pval_psi |
p-value corresponding to the null |
pval_GOF_sup |
p-value corresponding to supremum test of the null |
pval_GOF_CvM |
as pval_GOF_sup but now based on the Cramer Von Mises test statistic.
This element is NULL when |
GOF.resamp |
a matrix with first row the ordered jump times in (0,max.time.bet),
second row the observed test process, and the remaining rows are
50 processes sampled under the null.
This element is NULL when |
Note
ivah
allows for weights. However, these are defined implicitly
through the input models. Thus, when models are used as input to ivah
,
these models have to be fitted with the same weights.
Left-truncation and correction of standard errors for clustered data are currently not
implemented when estmethod="g"
.
Author(s)
Arvid Sjolander and Torben Martinussen.
References
Martinussen T., Vansteelandt S., Tchetgen Tchetgen E.J., Zucker D.M. (2017). Instrumental variables estimation of exposure effects on a time-to-event endpoint using structural cumulative survival models. Epidemiology 73(4): 1140-1149.
Sjolander A., Martinussen T. (2019). Instrumental variable estimation with the R package ivtools. Epidemiologic Methods 8(1), 1-20.
Tchetgen Tchetgen E.J., Walter S., Vansteelandt S., Martinussen T., Glymour M. (2015). Instrumental variable estimation in a survival context. Epidemiology 26(3): 402-410.
Examples
require(ahaz)
set.seed(9)
n <- 1000
psi0 <- 0.2
psi1 <- 0.0
U <- runif(n)
L <- runif(n)
Z <- rbinom(n, 1, plogis(-0.5+L))
X <- runif(n, min=Z+U, max=2+Z+U)
T <- rexp(n, rate=psi0*X+psi1*X*L+0.2*U+0.2*L)
C <- 5 #administrative censoring at t=5
d <- as.numeric(T<C)
T <- pmin(T, C)
data <- data.frame(L, Z, X, T, d)
#break ties
data$T <- data$T+rnorm(n=nrow(data), sd=0.001)
#two-stage estimation
fitX.LZ <- glm(formula=X~Z+L, data=data)
fitT.LX <- ah(formula=Surv(T, d)~X+L+X*L, data=data)
fitIV <- ivah(estmethod="ts", fitX.LZ=fitX.LZ, fitT.LX=fitT.LX, data=data,
ctrl=TRUE)
summary(fitIV)
#G-estimation
fitZ.L <- glm(formula=Z~L, family="binomial", data=data)
fitIV <- ivah(estmethod="g", X="X", T="T", fitZ.L=fitZ.L, data=data,
event="d", max.time=4, max.time.psi=4, n.sim=100)
summary(fitIV)
plot(fitIV)