Learn R Programming

mets (version 1.3.11)

cifreg: Cumulative Incidence Function (CIF) Regression

Description

Fits a regression model for the cumulative incidence function (CIF) in the presence of competing risks. Supports two link functions:

  • propodds=1 (default): Logistic link model (logit of CIF), providing Odds Ratio (OR) interpretations.

  • propodds=NULL: Fine-Gray (cloglog) regression model, providing subdistribution hazard ratio interpretations.

Usage

cifreg(
  formula,
  data,
  propodds = 1,
  cause = 1,
  cens.code = 0,
  no.codes = NULL,
  death.code = NULL,
  ...
)

Value

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

coef

Estimated coefficients.

var

Robust variance-covariance matrix.

iid

Influence functions for the coefficients.

cumhaz

Cumulative incidence estimates.

propodds

Indicator of the link function used.

Arguments

formula

Formula with an 'Event' outcome.

data

Data frame containing the variables.

propodds

Logical; if 1 (default), fits the logit link model. If NULL, fits the Fine-Gray model.

cause

Cause of interest (default is 1).

cens.code

Code for censoring (default is 0).

no.codes

Event codes to be ignored when identifying competing causes (useful for administrative censoring).

death.code

Codes for death (terminal events). If NULL, defaults to all remaining codes (excluding cause, cens.code, and no.codes).

...

Additional arguments passed to recreg.

Author

Thomas Scheike

Details

For the Fine-Gray model, the score equations are: $$ \int (X - E(t)) Y_1(t) w(t) dM_1 $$ summed over clusters and returned as iid.naive (multiplied by the inverse of the second derivative). Here, $$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 Y_{i1}(t) w_i(t) \exp(X_i^T \beta)$$.

The full influence function (IID decomposition) for the beta coefficients includes a censoring term: $$ \int (X - E(t)) Y_1(t) w(t) dM_1 + \int q(s)/p(s) dM_c $$ which is returned as the iid component.

For the logistic link model, standard errors may be slightly underestimated because uncertainty from the recursive baseline estimation is not fully accounted for. For smaller datasets, it is recommended to use the prop.odds.subdist function from the timereg package (which uses more efficient weights) or to bootstrap the standard errors.

See Also

cifregFG, recreg, gofFG

Examples

Run this code
## data with no ties
data(bmt,package="mets")
bmt$time <- bmt$time+runif(nrow(bmt))*0.01
bmt$id <- 1:nrow(bmt)

## logistic link  OR interpretation
or=cifreg(Event(time,cause)~tcell+platelet+age,data=bmt,cause=1)
summary(or)
par(mfrow=c(1,2))
plot(or)
nd <- data.frame(tcell=c(1,0),platelet=0,age=0)
por <- predict(or,nd)
plot(por)

## approximate standard errors 
por <-mets:::predict.phreg(or,nd)
plot(por,se=1)

## Fine-Gray model
fg=cifregFG(Event(time,cause)~tcell+platelet+age,data=bmt,cause=1)
summary(fg)
##fg=recreg(Event(time,cause)~tcell+platelet+age,data=bmt,cause=1,death.code=2)
##summary(fg)
plot(fg)
nd <- data.frame(tcell=c(1,0),platelet=0,age=0)
pfg <- predict(fg,nd,se=1)
plot(pfg,se=1)

## bt <- iidBaseline(fg,time=30)
## bt <- IIDrecreg(fg$cox.prep,fg,time=30)

## not run to avoid timing issues
## gofFG(Event(time,cause)~tcell+platelet+age,data=bmt,cause=1)

sfg <- cifregFG(Event(time,cause)~strata(tcell)+platelet+age,data=bmt,cause=1)
summary(sfg)
plot(sfg)

### predictions with CI based on iid decomposition of baseline and beta
### these are used in the predict function above
fg <- cifregFG(Event(time,cause)~tcell+platelet+age,data=bmt,cause=1)
Biid <- iidBaseline(fg,time=20)
pfg1 <- FGprediid(Biid,nd)
pfg1

Run the code above in your browser using DataLab