Learn R Programming

mets (version 1.3.11)

recreg: Recurrent Events Regression with Terminal Event

Description

Fits a Ghosh-Lin IPCW (Inverse Probability of Censoring Weighted) Cox-type model for recurrent events in the presence of a terminal event (e.g., death).

Usage

recreg(
  formula,
  data,
  cause = 1,
  death.code = 2,
  cens.code = 0,
  cens.model = ~1,
  weights = NULL,
  offset = NULL,
  Gc = NULL,
  wcomp = NULL,
  marks = NULL,
  augmentation.type = c("lindyn.augment", "lin.augment"),
  ...
)

Value

An object of class "recreg" (extending "phreg") containing:

coef

Estimated coefficients.

var

Robust variance-covariance matrix.

iid

Influence functions for the coefficients.

cumhaz

Cumulative hazard estimates.

se.cumhaz

Standard errors for cumulative hazard.

Arguments

formula

Formula with an 'Event' outcome.

data

Data frame containing the variables.

cause

Cause of interest (default is 1).

death.code

Codes for the terminal event/death (default is 2).

cens.code

Code for censoring (default is 0).

cens.model

Formula for a stratified Cox model without covariates used to estimate censoring probabilities.

weights

Weights for the score equations.

offset

Offsets for the model.

Gc

Censoring weights for the time argument. If NULL, these are calculated using a Kaplan-Meier estimator (should then provide \(G_c(T_i-)\)).

wcomp

Weights for composite outcomes (e.g., when cause=c(1,3), wcomp might be c(1,2)).

marks

A mark value vector from the data frame, specifying the mark value at all events.

augmentation.type

Type of augmentation when an augmentation model is given (options: "lindyn.augment", "lin.augment").

...

Additional arguments passed to lower-level functions.

Author

Thomas Scheike

Details

For the Cox-type model, the expectation is modeled as: $$ E(dN_1(t)|X) = \mu_0(t) dt \exp(X^T \beta) $$ by solving Cox-type IPCW weighted score equations: $$ \int (Z - E(t)) w(t) dN_1(t) $$ where $$w(t) = G(t) (I(T_i \wedge t < C_i)/G_c(T_i \wedge t))$$, $$E(t) = S_1(t)/S_0(t)$$, and $$S_j(t) = \sum X_i^j w_i(t) \exp(X_i^T \beta)$$.

The IID decomposition of the beta coefficients takes the form: $$ \int (Z - E) w(t) dM_1 + \int q(s)/p(s) dM_c $$ and is returned as the iid component.

Events, deaths, and censorings are specified via a start-stop structure and the Event call. The function identifies these via a status vector and cause codes, censoring codes (cens.code), and death codes (death.code). See examples and vignettes for details.

See Also

recregIPCW

Examples

Run this code
## data with no ties
data(hfactioncpx12)
hf <- hfactioncpx12
hf$x <- as.numeric(hf$treatment) 
dd <- data.frame(treatment=levels(hf$treatment),id=1)

gl <- recreg(Event(entry,time,status)~treatment+cluster(id),data=hf,cause=1,death.code=2)
summary(gl)
head(iid(gl))
pgl <- predict(gl,dd,se=1); 
plot(pgl,se=1)

## censoring stratified after treatment 
gls <- recreg(Event(entry,time,status)~treatment+cluster(id),data=hf,
cause=1,death.code=2,cens.model=~strata(treatment))
summary(gls)

glss <- recreg(Event(entry,time,status)~strata(treatment)+cluster(id),data=hf,
cause=1,death.code=2,cens.model=~strata(treatment))
summary(glss)
plot(glss)

## IPCW at 2 years 
ll2 <- recregIPCW(Event(entry,time,status)~treatment+cluster(id),data=hf,
cause=1,death.code=2,time=2,cens.model=~strata(treatment))
summary(ll2)

ll2i <- recregIPCW(Event(entry,time,status)~-1+treatment+cluster(id),data=hf,
cause=1,death.code=2,time=2,cens.model=~strata(treatment))
summary(ll2i)

Run the code above in your browser using DataLab