Learn R Programming

broom (version 0.4.5)

survdiff_tidiers: Tidiers for Tests of Differences between Survival Curves

Description

Tidiers for Tests of Differences between Survival Curves

Usage

# S3 method for survdiff
tidy(x, strata = FALSE, ...)

# S3 method for survdiff glance(x, ...)

Arguments

x

a "survdiff" object

strata

logical, whether to include strata in the output

...

other arguments passed to/from other methods, currently ignored

Value

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

See Also

survdiff

Examples

Run this code
# NOT RUN {
if( require("survival") ) {
    s <- survdiff( Surv(time, status) ~ pat.karno + strata(inst), data=lung)
    tidy(s)
    glance(s)
}
# }

Run the code above in your browser using DataLab