R/hazards_fluctuate.R
fluctuateHazards.Rd
This function performs a fluctuation of an initial estimate of
the cause-specific hazard functions via a call to glm
(i.e., a logistic submodel) or a call to optim
(to
ensure fluctuations stay within model space). The structure of the function
is specific to how it is called within hazard_tmle
. In
particular, dataList
must have a very specific structure for this
function to run properly. The list should consist of data.frame
objects. The first will have the number of rows for each observation equal
to the ftime
corresponding to that observation. Subsequent entries
will have t0
rows for each observation and will set trt
column equal to each value of trtOfInterest
in turn. The function
will fit a logistic regression with (a scaled version of) Nj
as
outcome, the logit of the current (pseudo-) hazard estimate as offset and
the targeted minimum loss-based estimation "clever covariates". The
function then obtains predictions based on this fit on each of the
data.frame
objects in dataList
.
fluctuateHazards( dataList, allJ, ofInterestJ, nJ, uniqtrt, ntrt, t0, verbose, ... )
dataList | A list of |
---|---|
allJ | Numeric vector indicating the labels of all causes of failure. |
ofInterestJ | Numeric vector indicating |
nJ | The number of unique failure types. |
uniqtrt | The values of |
ntrt | The number of |
t0 | The timepoint at which |
verbose | A |
... | Other arguments. Not currently used. |
The function returns a list that is exactly the same as the input
dataList
, but with updated columns corresponding with estimated
cumulative incidence at each time and estimated "clever covariates" at each
time.