survdiff_tidiers {broom} | R Documentation |
Tidiers for Tests of Differences between Survival Curves
## S3 method for class 'survdiff' tidy(x, strata = FALSE, ...) ## S3 method for class 'survdiff' glance(x, ...)
x |
a "survdiff" object |
strata |
logical, whether to include strata in the output |
... |
other arguments passed to/from other methods, currently ignored |
All tidying methods return a data.frame without rownames, whose structure depends on the method chosen.
tidy
on "survdiff" objects returns a data frame with the following columns:
... |
initial column(s) correspond to grouping factors (right-hand side of the formula) |
obs |
weighted observed number of events in each group |
exp |
weighted expected number of events in each group |
N |
number of subjects in each group |
glance
on "survdiff" objects returns a data frame with the following columns:
statistic |
value of the test statistic |
df |
degrees of freedom |
p.value |
p-value |
if( require("survival") ) { s <- survdiff( Surv(time, status) ~ pat.karno + strata(inst), data=lung) tidy(s) glance(s) }