censor: Censor survival data at a specified time

Description Usage Arguments Details Value Note Examples

Description

Censor survival data at a specified time

Usage

1
censor(x, at)

Arguments

x

An object of class Surv.

at

Numeric, the time point at which to censor.

Details

Any samples with survival times beyond at are modified such that time = at and status = 0.

Value

An object of class Surv.

Note

This function works only on right-censored survival data.

Examples

1
2
3
4
5
6
7
8
  
  s <- with(aml, Surv(time, status))
 
  ## Plot the original data 
  surviplot(s ~ x, data = aml)

  ## Artificially censor at time = 50
  surviplot(censor(s, 50) ~ x, data = aml)

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