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,
  ...
)

Arguments

dataList

A list of data.frame objects.

allJ

Numeric vector indicating the labels of all causes of failure.

ofInterestJ

Numeric vector indicating ftypeOfInterest that was passed to hazard_tmle.

nJ

The number of unique failure types.

uniqtrt

The values of trtOfInterest passed to mean_tmle.

ntrt

The number of trt values of interest.

t0

The timepoint at which survtmle was called to evaluate.

verbose

A logical indicating whether the function should print messages to indicate progress.

...

Other arguments. Not currently used.

Value

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.