Skip to contents

These method tidy the estimates from survival_ln_mixture fits into a summary.

Usage

# S3 method for class 'survival_ln_mixture'
tidy(
  x,
  effects = "fixed",
  conf.int = FALSE,
  conf.level = 0.9,
  digits = NULL,
  ...
)

Arguments

x

Fitted model object (survival_ln_mixture).

effects

A character vector including one or more of "fixed" and "auxiliary.

conf.int

If TRUE columns for lower (cred.low) and upper (cred.high) bounds of the posterior uncertainty intervals are included.

conf.level

A number between 0 and 1 indicating the desired probability mass to include in the intervals. Only used if conf.int = TRUE.

digits

How many significant digits should be displayed?

...

Not used.

Value

A data.frame without rownames. When effects="fixed" (the default), tidy.survival_ln_mixutre returns one row for each coefficient for each component of the mixture with three columns:

term

The name of the corresponding term in the model.

estimate

A point estimate of the coefficient (posterior median).

std.error

A standard error for the point estimate based on mad. See the Uncertainty estimates section in print.stanreg for more details.

Setting effects="auxiliary" will select the precision and proportion of mixture components parameters.

Examples


require(survival)
lung$sex <- factor(lung$sex)
set.seed(1)
mod2 <- survival_ln_mixture(Surv(time, status == 2) ~ sex, lung)
tidy(mod2)
#> # A tibble: 4 × 3
#>   term          estimate std.error
#>   <chr>            <dbl>     <dbl>
#> 1 (Intercept)_1    5.76      0.108
#> 2 sex2_1           0.314     0.181
#> 3 (Intercept)_2    5.04      0.225
#> 4 sex2_2           0.822     0.345
tidy(mod2, conf.int = TRUE)
#> # A tibble: 4 × 5
#>   term          estimate std.error cred.low cred.high
#>   <chr>            <dbl>     <dbl>    <dbl>     <dbl>
#> 1 (Intercept)_1    5.76      0.108   5.62       5.91 
#> 2 sex2_1           0.314     0.181   0.0556     0.537
#> 3 (Intercept)_2    5.04      0.225   4.76       5.34 
#> 4 sex2_2           0.822     0.345   0.396      1.28 
tidy(mod2, effects = c("fixed", "auxiliary"), conf.int = TRUE)
#> # A tibble: 7 × 5
#>   term          estimate std.error cred.low cred.high
#>   <chr>            <dbl>     <dbl>    <dbl>     <dbl>
#> 1 (Intercept)_1    5.76     0.108    5.62       5.91 
#> 2 sex2_1           0.314    0.181    0.0556     0.537
#> 3 (Intercept)_2    5.04     0.225    4.76       5.34 
#> 4 sex2_2           0.822    0.345    0.396      1.28 
#> 5 phi_1            3.01     0.746    2.20       4.06 
#> 6 phi_2            0.550    0.115    0.425      0.706
#> 7 eta_1            0.512    0.0308   0.475      0.549