Skip to contents

Each family is fitted by maximum likelihood and ranked by AIC, with BIC reported alongside so a disagreement between the two is visible rather than hidden.

Usage

Paracompare(time, event, X = NULL, dists = NULL)

morie_survival_compare_parametric(time, event, X = NULL, dists = NULL)

Arguments

time

observed follow-up times.

event

event indicator, 1 = event, 0 = censored.

X

optional covariate matrix.

dists

families to compare; defaults to all supported.

Value

list with one row per family giving the log-likelihood, AIC and BIC, ordered by AIC.

References

Kalbfleisch, J. D. and Prentice, R. L. (2002). The Statistical Analysis of Failure Time Data, 2nd ed., Wiley.

Examples

Paracompare(time = c(1, 2, 3, 4, 5, 6, 7, 8), event = c(0, 1, 0, 1, 1, 0, 1, 0))
#> $table
#>          dist    loglik      aic      bic n_par
#> 3   lognormal -5.582336 15.16467 15.32355     2
#> 2     weibull -5.618207 15.23641 15.39530     2
#> 4 loglogistic -5.625141 15.25028 15.40917     2
#> 1 exponential -7.154109 16.30822 16.38766     1
#> 
#> $best_aic
#> [1] "lognormal"
#> 
#> $best_bic
#> [1] "lognormal"
#> 
#> $fits
#> $fits$exponential
#> $fits$exponential$dist
#> [1] "exponential"
#> 
#> $fits$exponential$coef
#> [1] 2.197225
#> 
#> $fits$exponential$log_scale
#> [1] 0
#> 
#> $fits$exponential$scale
#> [1] 1
#> 
#> $fits$exponential$loglik
#> [1] -7.154109
#> 
#> $fits$exponential$n_par
#> [1] 1
#> 
#> $fits$exponential$n
#> [1] 8
#> 
#> $fits$exponential$n_events
#> [1] 4
#> 
#> $fits$exponential$aic
#> [1] 16.30822
#> 
#> $fits$exponential$bic
#> [1] 16.38766
#> 
#> $fits$exponential$fixed_scale
#> [1] TRUE
#> 
#> $fits$exponential$convergence
#> [1] 0
#> 
#> $fits$exponential$intercept
#> [1] 2.197225
#> 
#> $fits$exponential$weibull_shape
#> [1] 1
#> 
#> $fits$exponential$weibull_scale
#> [1] 9
#> 
#> $fits$exponential$method
#> [1] "maximum likelihood for a log-location-scale family with right censoring"
#> 
#> 
#> $fits$weibull
#> $fits$weibull$dist
#> [1] "weibull"
#> 
#> $fits$weibull$coef
#> [1] 1.945123
#> 
#> $fits$weibull$log_scale
#> [1] -0.8480575
#> 
#> $fits$weibull$scale
#> [1] 0.428246
#> 
#> $fits$weibull$loglik
#> [1] -5.618207
#> 
#> $fits$weibull$n_par
#> [1] 2
#> 
#> $fits$weibull$n
#> [1] 8
#> 
#> $fits$weibull$n_events
#> [1] 4
#> 
#> $fits$weibull$aic
#> [1] 15.23641
#> 
#> $fits$weibull$bic
#> [1] 15.3953
#> 
#> $fits$weibull$fixed_scale
#> [1] FALSE
#> 
#> $fits$weibull$convergence
#> [1] 0
#> 
#> $fits$weibull$intercept
#> [1] 1.945123
#> 
#> $fits$weibull$weibull_shape
#> [1] 2.335107
#> 
#> $fits$weibull$weibull_scale
#> [1] 6.99449
#> 
#> $fits$weibull$lr_vs_exponential
#> [1] 3.071804
#> 
#> $fits$weibull$lr_p_value
#> [1] 0.07966103
#> 
#> $fits$weibull$constant_hazard_rejected
#> [1] FALSE
#> 
#> $fits$weibull$method
#> [1] "maximum likelihood for a log-location-scale family with right censoring"
#> 
#> 
#> $fits$lognormal
#> $fits$lognormal$dist
#> [1] "lognormal"
#> 
#> $fits$lognormal$coef
#> [1] 1.752123
#> 
#> $fits$lognormal$log_scale
#> [1] -0.5050076
#> 
#> $fits$lognormal$scale
#> [1] 0.603501
#> 
#> $fits$lognormal$loglik
#> [1] -5.582336
#> 
#> $fits$lognormal$n_par
#> [1] 2
#> 
#> $fits$lognormal$n
#> [1] 8
#> 
#> $fits$lognormal$n_events
#> [1] 4
#> 
#> $fits$lognormal$aic
#> [1] 15.16467
#> 
#> $fits$lognormal$bic
#> [1] 15.32355
#> 
#> $fits$lognormal$fixed_scale
#> [1] FALSE
#> 
#> $fits$lognormal$convergence
#> [1] 0
#> 
#> $fits$lognormal$intercept
#> [1] 1.752123
#> 
#> $fits$lognormal$method
#> [1] "maximum likelihood for a log-location-scale family with right censoring"
#> 
#> 
#> $fits$loglogistic
#> $fits$loglogistic$dist
#> [1] "loglogistic"
#> 
#> $fits$loglogistic$coef
#> [1] 1.763188
#> 
#> $fits$loglogistic$log_scale
#> [1] -1.058525
#> 
#> $fits$loglogistic$scale
#> [1] 0.3469673
#> 
#> $fits$loglogistic$loglik
#> [1] -5.625141
#> 
#> $fits$loglogistic$n_par
#> [1] 2
#> 
#> $fits$loglogistic$n
#> [1] 8
#> 
#> $fits$loglogistic$n_events
#> [1] 4
#> 
#> $fits$loglogistic$aic
#> [1] 15.25028
#> 
#> $fits$loglogistic$bic
#> [1] 15.40917
#> 
#> $fits$loglogistic$fixed_scale
#> [1] FALSE
#> 
#> $fits$loglogistic$convergence
#> [1] 0
#> 
#> $fits$loglogistic$intercept
#> [1] 1.763188
#> 
#> $fits$loglogistic$method
#> [1] "maximum likelihood for a log-location-scale family with right censoring"
#> 
#> 
#> 
#> $failed
#> list()
#> 
#> $families_not_nested
#> [1] TRUE
#> 
#> $aic_is_not_goodness_of_fit
#> [1] TRUE
#> 
#> $method
#> [1] "AIC / BIC comparison of parametric survival families"
#> 
#> $lr_weibull_vs_exponential
#> [1] 3.071804
#> 
#> $lr_p_value
#> [1] 0.07966103
#>