Learn R Programming

mets (version 1.3.11)

resmeanIPCW: Restricted IPCW Mean for Censored Survival Data

Description

Provides a fast implementation of Inverse Probability of Censoring Weighting (IPCW) regression for a single time point. It fits 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) $$ which represents the "Years Lost Due to Cause" (RMTL).

Usage

resmeanIPCW(formula, data, outcome = c("rmst", "rmtl"), ...)

Value

An object of class "binreg" containing:

coef

Coefficient estimates.

se

Standard errors.

var

Variance-covariance matrix.

iid

Influence function decomposition.

naive.var

Variance under known censoring model (if applicable).

time

Time point used.

outcome

Type of outcome analyzed.

Arguments

formula

Formula with an Event outcome (e.g., Event(time, cause)).

data

Data frame containing the variables.

outcome

Outcome type: "rmst" (Restricted Mean Survival Time) or "rmtl" (Restricted Mean Time Lost).

...

Additional arguments passed to binreg, such as time, cause, cens.model, model, type, etc.

Author

Thomas Scheike

Details

The method solves the binomial regression IPCW response estimating equation: $$ X \left( \frac{\Delta(\min(T,t)) Y}{G_c(\min(T,t))} - \exp( X^T \beta) \right) = 0 $$ where \(\Delta(\min(T,t)) = I(\min(T,t) \leq C)\) is the indicator of being uncensored at the time of interest.

When the status variable is binary, the outcome is assumed to be \(Y = \min(T,t)\) (RMST). If the status has more than two levels (competing risks), the outcome is \(Y = (t - \min(T,t)) I(\text{status}=\text{cause})\) (RMTL for a specific cause).

The function supports:

  • IPCW Adjustment: Weights by the inverse of the censoring survival probability.

  • Augmentation: Can include an augmentation term (type="II" or "III") to improve efficiency and robustness (Double Robust estimation).

  • Variance Estimation: Based on the influence function, including adjustments for the estimation of the censoring model.

References

Scheike, T. and Holst, K. K. (2024). Restricted mean time lost for survival and competing risks data using mets in R. WIP.

See Also

binreg, resmeanATE, rmstIPCW

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)

 ## Reduce Ex.Timings
## Weighted GLM version (RMST)
out2 <- logitIPCW(Event(time,cause!=0)~tcell+platelet+age, bmt,
            time=50, cens.model=~strata(platelet), model="exp", outcome="rmst")
summary(out2)

### Time-lost (RMTL)
outtl <- resmeanIPCW(Event(time,cause!=0)~tcell+platelet+age, bmt,
                time=50, cens.model=~strata(platelet), model="exp", outcome="rmtl")
summary(outtl)

### 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)

### Years lost regression
outl <- resmeanIPCW(Event(time,cause!=0)~-1+int, bmt, time=30, outcome="years-lost",
                             cens.model=~strata(platelet, tcell), model="lin")
estimate(outl)

## 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