invert: Invert the censoring status of a Surv object

Description Usage Arguments Details Value Examples

Description

Invert the censoring status of a Surv object

Usage

1
invert(x)

Arguments

x

A Surv object.

Details

For each item, the "status" is reversed, so alive becomes dead, and dead becomes alive.

This may be useful to check for bias in censoring.

Value

A Surv object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  

  surv <- Surv(colon$time / 365, colon$status)

  ## normal survival plot
  surviplot(surv ~ sex, data = colon,
    xlab = 'Time (years)', ylab = 'Fraction surviving')

  ## Censoring rate plot
  surviplot(invert(surv) ~ sex, data = colon,
    xlab = 'Time (years)', ylab = 'Fraction not censored')

aroneklund/surviplot documentation built on May 10, 2019, 1:47 p.m.