get_risktable {visR} | R Documentation |
Obtain risk tables for tables and plots
Description
Create a risk table from an object using an S3 method. Currently, no default method is defined.
Usage
get_risktable(x, ...)
## S3 method for class 'survfit'
get_risktable(
x,
times = NULL,
statlist = "n.risk",
label = NULL,
group = c("strata", "statlist"),
collapse = FALSE,
...
)
## S3 method for class 'tidycuminc'
get_risktable(
x,
times = pretty(x$tidy$time, 10),
statlist = "n.risk",
label = NULL,
group = c("strata", "statlist"),
collapse = FALSE,
...
)
Arguments
x |
an object of class |
... |
other arguments passed on to the method |
times |
Numeric vector indicating the times at which the risk set, censored subjects, events are calculated. |
statlist |
Character vector indicating which summary data to present. Current choices are "n.risk" "n.event" "n.censor", "cum.event", "cum.censor". Default is "n.risk". |
label |
Character vector with labels for the statlist. Default matches "n.risk" with "At risk", "n.event" with "Events", "n.censor" with "Censored", "cum.event" with "Cum. Event", and "cum.censor" with "Cum. Censor". |
group |
String indicating the grouping variable for the risk tables. Current options are:
Default is "strata". |
collapse |
Boolean, indicates whether to present the data overall. Default is FALSE. |
Value
return list of attributes the form the risk table i.e. number of patients at risk per strata