nrisk: Get number-at-risk from a survfit object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/survplot.R

Description

Retrieve the number-at-risk from a survfit object for the specified times, for each strata.

Usage

1
nrisk(x, times = pretty(x$time))

Arguments

x

An object of type survfit.

times

The timepoints of interest.

Details

This function was written and documented by Aron Charles Eklund in his package survplot version 0.0.7.

Value

A matrix indicating the number-at-risk for each timepoint (columns) and stratum (rows).

Author(s)

Aron Charles Eklund (survplot version 0.0.7)

See Also

survplot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  
library(survival)
data(colon)
surv <- Surv(colon$time, colon$status)

## example with stratification
nrisk(survfit(surv ~ colon$rx))

## example without stratification
nrisk(survfit(surv ~ 1))

MalgorzataOles/pace documentation built on Nov. 18, 2017, 7:51 a.m.