Gtransform: G-computation transformation

View source: R/Greg.R

GtransformR Documentation

G-computation transformation

Description

Given a pred_surv object for time to event in a time window, calculates the G-computation transformation in the time window. The transformation is used as the outcome when estimating the conditional survival probability at the next visit time.

Usage

Gtransform(
  follow.up.time,
  pred_event_obj,
  tvals,
  next.visit.time = Inf,
  id.var,
  time.var,
  event.var
)

Arguments

follow.up.time

see SDRsurv

pred_event_obj

a pred_surv object for time to event in the time window of interest

tvals

see SDRsurv. Must be sorted in ascending order and all greater than the smallest time in pred_event_obj

next.visit.time

the next visit time. Default is Inf, corresponding to the last time window

id.var

see SDRsurv

time.var

see SDRsurv

event.var

see SDRsurv

denom.survival.trunc

see SDRsurv

Value

a named matrix of transformations. Each row corresponds to an individual; each column corresponds to a value of tvals. Row names are elements in follow.up.time$id.var; column names are values of tvals.

Warning

This function is designed to be called by other functions such as Gsurv, therefore inputs are not thoroughly checked. Incorrect inputs may lead to errors with non-informative messages. The user may call this function if more flexibility is desired.


QIU-Hongxiang-David/SDRsurv documentation built on March 29, 2024, 8:41 a.m.