Summarize the descriptive statistics across strata from a survival object using S3 method
Source:R/get_summary.R
get_summary.Rd
S3 method for extracting descriptive statistics across strata. No default method is available at the moment.
Usage
get_summary(x, ...)
# S3 method for survfit
get_summary(
x,
statlist = c("strata", "records", "events", "median", "LCL", "UCL", "CI"),
...
)
Arguments
- x
An object of class
survfit
- ...
other arguments passed on to the method
- statlist
Character vector containing the desired information to be displayed. The order of the arguments determines the order in which they are displayed in the final result. Default is the strata ("strata"), number of subjects ("records"), number of events ("events"), the median survival time ("median"), the Confidence Interval ("CI"), the Lower Confidence Limit ("UCL") and the Upper Confidence Limit ("UCL").
Value
list of summary statistics from survfit object
A data frame with summary measures from a survfit
object
Examples
survfit_object <- survival::survfit(data = adtte, survival::Surv(AVAL, 1 - CNSR) ~ TRTP)
get_summary(survfit_object)
#> strata No. of subjects
#> TRTP=Placebo TRTP=Placebo 86
#> TRTP=Xanomeline High Dose TRTP=Xanomeline High Dose 84
#> TRTP=Xanomeline Low Dose TRTP=Xanomeline Low Dose 84
#> No. of events Median(surv.time) 0.95LCL 0.95UCL
#> TRTP=Placebo 29 NA NA NA
#> TRTP=Xanomeline High Dose 61 36 25 47
#> TRTP=Xanomeline Low Dose 62 33 28 51
#> 0.95CI
#> TRTP=Placebo (NA;NA)
#> TRTP=Xanomeline High Dose (25;47)
#> TRTP=Xanomeline Low Dose (28;51)