R/survtmle.R
survtmle.Rd
This function estimates the marginal cumulative incidence for failures of specified types using targeted minimum loss-based estimation.
survtmle( ftime, ftype, trt, adjustVars, t0 = max(ftime[ftype > 0]), SL.ftime = NULL, SL.ctime = NULL, SL.trt = NULL, glm.ftime = NULL, glm.ctime = NULL, glm.trt = NULL, returnIC = TRUE, returnModels = TRUE, ftypeOfInterest = unique(ftype[ftype != 0]), trtOfInterest = unique(trt), cvControl = list(V = 10L, stratifyCV = FALSE, shuffle = TRUE, validRows = NULL), method = "hazard", bounds = NULL, verbose = FALSE, tol = 1/(sqrt(length(ftime))), maxIter = 10, Gcomp = FALSE, gtol = 0.001, returnCall = TRUE )
ftime | An integer-valued vector of failure times. Right-censored
observations should have corresponding |
---|---|
ftype | An integer-valued vector indicating the type of failure.
Observations with |
trt | A numeric vector indicating observed treatment assignment. Each unique value will be treated as a different type of treatment. Currently, only two unique values are supported. |
adjustVars | A data.frame of adjustment variables that will be used in estimating the conditional treatment, censoring, and failure (hazard or conditional mean) probabilities. |
t0 | The time at which to return cumulative incidence estimates. By
default this is set to |
SL.ftime | A character vector or list specification to be passed to the
|
SL.ctime | A character vector or list specification to be passed to the
|
SL.trt | A character vector or list specification to be passed to the
|
glm.ftime | A character specification of the right-hand side of the
equation passed to the |
glm.ctime | A character specification of the right-hand side of the
equation passed to the |
glm.trt | A character specification of the right-hand side of the
equation passed to the |
returnIC | A |
returnModels | A |
ftypeOfInterest | An input specifying what failure types to compute
estimates of incidence for. The default value computes estimates for values
|
trtOfInterest | An input specifying which levels of |
cvControl | A |
method | A character specification of how the targeted minimum
loss-based estimators should be computed, either |
bounds | A |
verbose | A |
tol | The stopping criteria when |
maxIter | A maximum number of iterations for the algorithm when
|
Gcomp | A |
gtol | The truncation level of predicted censoring survival. Setting to larger values can help performance in data sets with practical positivity violations. |
returnCall | A |
An object of class survtmle
.
The call to survtmle
.
A numeric vector of point estimates -- one for each combination
of ftypeOfInterest
and trtOfInterest
.
A covariance matrix for the point estimates.
The empirical mean of the efficient influence function at the estimated, targeted nuisance parameters. Each value should be small or the user will be warned that excessive finite-sample bias may exist in the point estimates.
The efficient influence function at the estimated, fluctuated nuisance parameters, evaluated on each of the observations. These are used to construct confidence intervals for post-hoc comparisons.
If returnModels=TRUE
the fit object(s) for the call
to glm
or SuperLearner
for the outcome regression models. If method="mean"
this will be
a list of length length(ftypeOfInterest)
each of length t0
(one regression for each failure type and for each timepoint). If
method="hazard"
this will be a list of length
length(ftypeOfInterest)
with one fit corresponding to the hazard
for each cause of failure. If returnModels = FALSE
, this entry
will be NULL
.
If returnModels=TRUE
the fit object for the call to
glm
or SuperLearner
for
the pooled hazard regression model for the censoring distribution. If
returnModels=FALSE
, this entry will be NULL
.
If returnModels = TRUE
the fit object for the call to
glm
or SuperLearner
for
the conditional probability of trt
regression model. If
returnModels = FALSE
, this entry will be NULL
.
The timepoint at which the function was evaluated.
The numeric
vector of failure times used in the fit.
The numeric
vector of failure types used in the fit.
The numeric
vector of treatment assignments used in the
fit.
The data.frame
of failure times used in the fit.
# simulate data set.seed(1234) n <- 200 trt <- rbinom(n, 1, 0.5) adjustVars <- data.frame(W1 = round(runif(n)), W2 = round(runif(n, 0, 2))) ftime <- round(1 + runif(n, 1, 4) - trt + adjustVars$W1 + adjustVars$W2) ftype <- round(runif(n, 0, 1)) # Fit 1 # fit a survtmle object with glm estimators for treatment, censoring, and # failure using the "mean" method fit1 <- survtmle( ftime = ftime, ftype = ftype, trt = trt, adjustVars = adjustVars, glm.trt = "W1 + W2", glm.ftime = "trt + W1 + W2", glm.ctime = "trt + W1 + W2", method = "mean", t0 = 6 ) fit1#> $est #> [,1] #> 0 1 0.5660495 #> 1 1 0.7412935 #> #> $var #> 0 1 1 1 #> 0 1 0.0042149062 0.0002205963 #> 1 1 0.0002205963 0.0023100990 #># Fit 2 # fit an survtmle object with SuperLearner estimators for failure and # censoring and empirical estimators for treatment using the "mean" method fit2 <- survtmle( ftime = ftime, ftype = ftype, trt = trt, adjustVars = adjustVars, SL.ftime = c("SL.mean"), SL.ctime = c("SL.mean"), method = "mean", t0 = 6 )#> Warning: glm.trt and SL.trt not specified. Proceeding with glm.trt = '1'#>fit2#> $est #> [,1] #> 0 1 0.5284170 #> 1 1 0.6584069 #> #> $var #> 0 1 1 1 #> 0 1 0.005393382 0.000000000 #> 1 1 0.000000000 0.004369973 #>