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.

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

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.

Author

Thomas Scheike

Examples


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)
#> 
#>    n events
#>  408    245
#> 
#>  408 clusters
#> coeffients:
#>              Estimate   Std.Err      2.5%     97.5% P-value
#> (Intercept)  3.014391  0.063784  2.889376  3.139406  0.0000
#> tcell        0.106875  0.139461 -0.166463  0.380212  0.4435
#> platelet     0.246943  0.098921  0.053061  0.440825  0.0125
#> age         -0.185972  0.043746 -0.271712 -0.100231  0.0000
#> 
#> exp(coeffients):
#>             Estimate     2.5%   97.5%
#> (Intercept) 20.37668 17.98209 23.0901
#> tcell        1.11279  0.84665  1.4626
#> platelet     1.28011  1.05449  1.5540
#> age          0.83030  0.76207  0.9046
#> 
#> 

 ### 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)
#>                        Estimate Std.Err  2.5% 97.5%   P-value
#> inttcell=0, platelet=0    13.60  0.8316 11.97 15.23 3.829e-60
#> inttcell=0, platelet=1    18.90  1.2696 16.41 21.39 4.004e-50
#> inttcell=1, platelet=0    16.19  2.4061 11.48 20.91 1.705e-11
#> inttcell=1, platelet=1    17.77  2.4536 12.96 22.58 4.464e-13
out1 <- phreg(Surv(time,cause!=0)~strata(tcell,platelet),data=bmt)
rm1 <- resmean.phreg(out1,times=30)
summary(rm1)
#>                     strata times    rmean  se.rmean years.lost
#> tcell=0, platelet=0      0    30 13.60292 0.8315433   16.39708
#> tcell=0, platelet=1      1    30 18.90123 1.2693327   11.09877
#> tcell=1, platelet=0      2    30 16.19119 2.4006162   13.80881
#> tcell=1, platelet=1      3    30 17.76608 2.4422050   12.23392

## 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)
#>                        Estimate Std.Err   2.5%  97.5%   P-value
#> inttcell=0, platelet=0   12.105  0.8508 10.438 13.773 6.162e-46
#> inttcell=0, platelet=1    6.884  1.1741  4.583  9.185 4.536e-09
#> inttcell=1, platelet=0    7.261  2.3533  2.648 11.873 2.033e-03
#> inttcell=1, platelet=1    5.780  2.0925  1.679  9.882 5.738e-03
## same as integrated cumulative incidence 
rmc1 <- cif.yearslost(Event(time,cause)~strata(tcell,platelet),data=bmt,times=30)
summary(rmc1)
#>                     strata times    intF11   intF12 se.intF11 se.intF12
#> tcell=0, platelet=0      0    30 12.105159 4.291923 0.8508126 0.6161430
#> tcell=0, platelet=1      1    30  6.884176 4.214597 1.1741014 0.9057117
#> tcell=1, platelet=0      2    30  7.260734 6.548077 2.3532796 1.9703431
#> tcell=1, platelet=1      3    30  5.780373 6.453549 2.0924990 2.0815267
#>                     total.years.lost
#> tcell=0, platelet=0         16.39708
#> tcell=0, platelet=1         11.09877
#> tcell=1, platelet=0         13.80881
#> tcell=1, platelet=1         12.23392