Description Usage Arguments Value Author(s) Examples
This function generates a number at risk table that typically seen in publications.
1 | get_nrisk_tbl(sfit, timeby)
|
sfit |
A survival::survfit object. |
timeby |
The "step" in which to calculate the risk. |
A data.frame with the number of risks at each timeby step.
Abhijit Dasgupta https://gist.github.com/araastat/9927677.
1 2 | fit <- survival::survfit(survival::Surv(time,status) ~ rx, data = survival::colon)
get_nrisk_tbl(fit, timeby = 500)
|
strata time n.risk
1 rx=Obs 0 630
2 rx=Obs 500 470
3 rx=Obs 1000 372
4 rx=Obs 1500 315
5 rx=Obs 2000 256
6 rx=Obs 2500 90
7 rx=Obs 3000 11
8 rx=Lev 0 620
9 rx=Lev 500 464
10 rx=Lev 1000 360
11 rx=Lev 1500 318
12 rx=Lev 2000 266
13 rx=Lev 2500 107
14 rx=Lev 3000 8
15 rx=Lev+5FU 0 608
16 rx=Lev+5FU 500 498
17 rx=Lev+5FU 1000 425
18 rx=Lev+5FU 1500 387
19 rx=Lev+5FU 2000 328
20 rx=Lev+5FU 2500 127
21 rx=Lev+5FU 3000 14
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.