R/iterated_mean_estimate.R
estimateIteratedMean.Rd
This function computes an estimate of the G-computation
regression at a specified time t
using glm
or
SuperLearner
. The structure of the function is
specific to how it is called within mean_tmle
. In particular,
wideDataList
must have a very specific structure for this function
to run properly. The list should consist of data.frame
objects. The
first should have all rows set to their observed value of trt
. The
remaining should in turn have all rows set to each value of
trtOfInterest
in the survtmle
call. Currently the code
requires each data.frame
to have named columns for each name in
names(adjustVars)
, as well as a column named trt
. It must
also have a columns named Nj.Y
where j corresponds with the numeric
values input in allJ
. These are the indicators of failure due to the
various causes before time t
and are necessary for determining who
to include in the regression. Similarly, each data.frame
should have
a column call C.Y
where Y is again t - 1
, such that
right-censored observations are not included in the regressions. The
function will fit a regression with Qj.star.t+1
(also needed as a
column in wideDataList
) on functions of trt
and
names(adjustVars)
as specified by glm.ftime
or
SL.ftime
.
estimateIteratedMean( wideDataList, t, whichJ, allJ, t0, adjustVars, SL.ftime = NULL, glm.ftime = NULL, verbose, cvControl, returnModels = FALSE, bounds = NULL, ... )
wideDataList | A list of |
---|---|
t | The timepoint at which to compute the iterated mean. |
whichJ | Numeric value indicating the cause of failure for which regression should be computed. |
allJ | Numeric vector indicating the labels of all causes of failure. |
t0 | The timepoint at which |
adjustVars | Object of class |
SL.ftime | 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 |
verbose | A |
cvControl | A |
returnModels | A |
bounds | A list of bounds to be used when performing the outcome regression (Q) with the Super Learner algorithm. NOT YET IMPLEMENTED. |
... | Other arguments. Not currently used. |
The function then returns a list that is exactly the same as the
input wideDataList
, but with a column named Qj.t
added to it,
which is the estimated conditional mean of Qj.star.t+1
evaluated at
the each of the rows of each data.frame
in wideDataList
.