Broom methods for tidycrr objects

# S3 method for tidycrr
tidy(x, exponentiate = FALSE, conf.int = FALSE, conf.level = x$conf.level, ...)

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

# S3 method for tidycrr
augment(x, times = NULL, probs = NULL, newdata = NULL, ...)

Arguments

x

a tidycrr object

exponentiate

Logical indicating whether or not to exponentiate the coefficient estimates. Defaults to FALSE.

conf.int

Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to FALSE.

conf.level

Level of the confidence interval. Default matches that in crr(conf.level=) (typically, 0.95)

...

not used

times

Numeric vector of times to obtain risk estimates at

probs

Numeric vector of quantiles to obtain estimates at

newdata

A base::data.frame() or tibble::tibble() containing all the original predictors used to create x. Defaults to NULL.

Value

a tibble

See also

Other crr() functions: crr(), predict.tidycrr()

Examples

crr <- crr(Surv(ttdeath, death_cr) ~ age + grade, trial)
#> 11 cases omitted due to missing values

tidy(crr)
#> # A tibble: 3 × 5
#>   term     estimate std.error statistic p.value
#>   <chr>       <dbl>     <dbl>     <dbl>   <dbl>
#> 1 age       0.00588   0.00987     0.596    0.55
#> 2 gradeII   0.0601    0.361       0.166    0.87
#> 3 gradeIII  0.431     0.324       1.33     0.18

glance(crr)
#> # A tibble: 1 × 5
#>   converged logLik  nobs    df statistic
#>   <lgl>      <dbl> <int> <dbl>     <dbl>
#> 1 TRUE       -264.   189     3      2.34

augment(crr, times = 12)
#> # A tibble: 200 × 10
#>    trt      age marker stage grade response death death_cr     ttdeath `time 12`
#>    <chr>  <dbl>  <dbl> <fct> <fct>    <int> <int> <fct>          <dbl>     <dbl>
#>  1 Drug A    23  0.16  T1    II           0     0 censor          24      0.0368
#>  2 Drug B     9  1.11  T2    I            1     0 censor          24      0.0320
#>  3 Drug A    31  0.277 T1    II           0     0 censor          24      0.0386
#>  4 Drug A    NA  2.07  T3    III          1     1 death other…    17.6   NA     
#>  5 Drug A    51  2.77  T4    III          1     1 death other…    16.4    0.0621
#>  6 Drug B    39  0.613 T4    I            0     1 death from …    15.6    0.0381
#>  7 Drug A    37  0.354 T1    II           0     0 censor          24      0.0399
#>  8 Drug A    32  1.74  T1    I            0     1 death other…    18.4    0.0366
#>  9 Drug A    31  0.144 T1    II           0     0 censor          24      0.0386
#> 10 Drug B    34  0.205 T3    I            0     1 death from …    10.5    0.0370
#> # … with 190 more rows