[226bc8]: / man / nrisk.Rd

Download this file

31 lines (27 with data), 885 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\name{nrisk}
\alias{nrisk}
\title{ Get number-at-risk from a survfit object }
\description{ Retrieve the number-at-risk from a survfit object for the specified times, for each strata. }
\usage{
nrisk(x, times = pretty(x$time))
}
\arguments{
\item{x}{ An object of type \code{\link[survival]{survfit}}. }
\item{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{Aron Charles Eklund (survplot version 0.0.7)}
\seealso{ \code{\link{survplot}} }
\examples{
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))
}
\keyword{ survival }