nrisk | R Documentation |
Retrieve the number-at-risk from a survfit object for the specified times, for each strata.
nrisk(x, times = pretty(x$time))
x |
An object of type |
times |
The timepoints of interest. |
This function was written and documented by Aron Charles Eklund in his package survplot version 0.0.7.
A matrix indicating the number-at-risk for each timepoint (columns) and stratum (rows).
Aron Charles Eklund (survplot version 0.0.7)
survplot
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.