Learn R Programming

mets (version 1.3.4)

resmeanIPCW: Restricted IPCW mean for censored survival data

Description

Simple and fast version for IPCW regression for just one time-point thus fitting the model $$E( min(T, t) | X ) = exp( X^T beta) $$ or in the case of competing risks data $$E( I(epsilon=1) (t - min(T ,t)) | X ) = exp( X^T beta) $$ thus given years lost to cause.

Usage

resmeanIPCW(
  formula,
  data,
  cause = 1,
  time = NULL,
  type = c("II", "I"),
  beta = NULL,
  offset = NULL,
  weights = NULL,
  cens.weights = NULL,
  cens.model = ~+1,
  se = TRUE,
  kaplan.meier = TRUE,
  cens.code = 0,
  no.opt = FALSE,
  method = "nr",
  model = "exp",
  augmentation = NULL,
  h = NULL,
  MCaugment = NULL,
  Ydirect = NULL,
  ...
)

Arguments

formula

formula with outcome (see coxph)

data

data frame

cause

cause of interest

time

time of interest

type

of estimator

beta

starting values

offset

offsets for partial likelihood

weights

for score equations

cens.weights

censoring weights

cens.model

only stratified cox model without covariates

se

to compute se's based on IPCW

kaplan.meier

uses Kaplan-Meier for IPCW in contrast to exp(-Baseline)

cens.code

gives censoring code

no.opt

to not optimize

method

for optimization

model

exp or linear

augmentation

to augment binomial regression

h

h for estimating equation

MCaugment

iid of h and censoring model

Ydirect

to bypass the construction of the response Y=min(T,tau) and use this instead

...

Additional arguments to lower level funtions

Author

Thomas Scheike

Details

When the status is binary assumes it is a survival setting and default is to consider outcome Y=min(T,t), if status has more than two levels, then computes years lost due to the specified cause, thus

Based on binomial regresion IPCW response estimating equation: $$ X ( \Delta (min(T , t))/G_c(min(T_i,t)) - exp( X^T beta)) = 0 $$ for IPCW adjusted responses. Here $$ \Delta(min(T,t)) I ( min(T ,t) \leq C ) $$ is indicator of being uncensored.

Can also solve the binomial regresion IPCW response estimating equation: $$ h(X) X ( \Delta (min(T, t))/G_c(min(T_i,t)) - exp( X^T beta)) = 0 $$ for IPCW adjusted responses where $h$ is given as an argument together with iid of censoring with h.

By using appropriately the h argument we can also do the efficient IPCW estimator estimator.

Variance is based on $$ \sum w_i^2 $$ also with IPCW adjustment, and naive.var is variance under known censoring model.

When Ydirect is given it solves : $$ X ( \Delta( min(T,t)) Ydirect /G_c(min(T_i,t)) - exp( X^T beta)) = 0 $$ for IPCW adjusted responses.

The actual influence (type="II") function is based on augmenting with $$ X \int_0^t E(Y | T>s) /G_c(s) dM_c(s) $$ and alternatively just solved directly (type="I") without any additional terms.

Censoring model may depend on strata.

Examples

Run this code

data(bmt); bmt$time <- bmt$time+runif(nrow(bmt))*0.001
# E( min(T;t) | X ) = exp( a+b X) with IPCW estimation 
out <- resmeanIPCW(Event(time,cause!=0)~tcell+platelet+age,bmt,
                time=50,cens.model=~strata(platelet),model="exp")
summary(out)

 ### same as Kaplan-Meier for full censoring model 
bmt$int <- with(bmt,strata(tcell,platelet))
out <- resmeanIPCW(Event(time,cause!=0)~-1+int,bmt,time=30,
                             cens.model=~strata(platelet,tcell),model="lin")
estimate(out)
out1 <- phreg(Surv(time,cause!=0)~strata(tcell,platelet),data=bmt)
rm1 <- resmean.phreg(out1,times=30)
summary(rm1)

## competing risks years-lost for cause 1  
out <- resmeanIPCW(Event(time,cause)~-1+int,bmt,time=30,cause=1,
                            cens.model=~strata(platelet,tcell),model="lin")
estimate(out)
## same as integrated cumulative incidence 
rmc1 <- cif.yearslost(Event(time,cause)~strata(tcell,platelet),data=bmt,times=30)
summary(rmc1)

Run the code above in your browser using DataLab