Create a risk table from an object using an S3 method. Currently, no default method is defined.
get_risktable(x, ...)# S3 method for survfit
get_risktable(
x,
times = NULL,
statlist = "n.risk",
label = NULL,
group = c("strata", "statlist"),
collapse = FALSE,
...
)
# S3 method for tidycuminc
get_risktable(
x,
times = pretty(x$tidy$time, 10),
statlist = "n.risk",
label = NULL,
group = c("strata", "statlist"),
collapse = FALSE,
...
)
return list of attributes the form the risk table i.e. number of patients at risk per strata
an object of class survfit
or tidycuminc
other arguments passed on to the method
Numeric vector indicating the times at which the risk set, censored subjects, events are calculated.
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".
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".
String indicating the grouping variable for the risk tables. Current options are:
"strata": groups the risk tables per stratum.
The label
specifies the label within each risk table. The strata levels
are used for the titles of the risk tables. This is the default
"statlist": groups the risk tables per statlist.
The label
specifies the title for each risk table. The strata levels
are used for labeling within each risk table.
Default is "strata".
Boolean, indicates whether to present the data overall. Default is FALSE.