|
a |
|
b/man/nrisk.Rd |
|
|
1 |
\name{nrisk} |
|
|
2 |
\alias{nrisk} |
|
|
3 |
\title{ Get number-at-risk from a survfit object } |
|
|
4 |
\description{ Retrieve the number-at-risk from a survfit object for the specified times, for each strata. } |
|
|
5 |
\usage{ |
|
|
6 |
nrisk(x, times = pretty(x$time)) |
|
|
7 |
} |
|
|
8 |
\arguments{ |
|
|
9 |
\item{x}{ An object of type \code{\link[survival]{survfit}}. } |
|
|
10 |
\item{times}{ The timepoints of interest. } |
|
|
11 |
} |
|
|
12 |
\details{ |
|
|
13 |
This function was written and documented by Aron Charles Eklund in his package |
|
|
14 |
survplot version 0.0.7.} |
|
|
15 |
\value{ A matrix indicating the number-at-risk for each timepoint (columns) and stratum (rows). } |
|
|
16 |
\author{Aron Charles Eklund (survplot version 0.0.7)} |
|
|
17 |
\seealso{ \code{\link{survplot}} } |
|
|
18 |
\examples{ |
|
|
19 |
library(survival) |
|
|
20 |
data(colon) |
|
|
21 |
surv <- Surv(colon$time, colon$status) |
|
|
22 |
|
|
|
23 |
## example with stratification |
|
|
24 |
nrisk(survfit(surv ~ colon$rx)) |
|
|
25 |
|
|
|
26 |
## example without stratification |
|
|
27 |
nrisk(survfit(surv ~ 1)) |
|
|
28 |
|
|
|
29 |
} |
|
|
30 |
\keyword{ survival } |