Description Usage Arguments Value
View source: R/iterated_mean_estimate.R
This function computes an estimate of the G-computation regression at a
specified time t
using either 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
, so 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
.
1 2 3 |
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 boolean indicating whether the function should print messages to indicate progress. |
returnModels |
A boolean indicating whether to return the
|
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
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.