Skip to contents

Tabulate the log-likelihood, the number of estimated parameters, AIC and BIC of several fits of the same data.

Usage

sest_ic(...)

Arguments

...

sest_fit objects, or one list of them. Names become the fit column (the method otherwise).

Value

A data frame with fit, method, likelihood, n, n_events, loglik, k, aic, bic and delta_aic.

Details

\(AIC = -2\ell + 2k\) and \(BIC = -2\ell + k \log n\), with \(k\) the degrees of freedom the backend reports for its log-likelihood (the number of coefficients, or the effective degrees of freedom of a penalised or frailty fit) and \(n\) the number of observations (the convention of flexsurv; survival's BIC() for a Cox fit uses the number of events instead). The likelihood column says what \(\ell\) is: "full" for parametric, spline and cure fits, "partial" for Cox-type fits, and "none" for Kaplan-Meier (whose criteria are then NA). Criteria are comparable only between fits with the same kind of likelihood on the same rows; the delta_aic column is computed within each likelihood type.

Examples

v <- survival::veteran
f <- survival::Surv(time, status) ~ trt + karno
sest_ic(weibull = survestimand(f, v, method = "weibull"),
           lognormal = survestimand(f, v, method = "lognormal"),
           cox = survestimand(f, v, method = "cox"))
#>         fit    method likelihood   n n_events    loglik k       aic       bic
#> 1   weibull   weibull       full 137      128 -725.7921 4 1459.5843 1471.2642
#> 2 lognormal lognormal       full 137      128 -721.3610 4 1450.7220 1462.4019
#> 3       cox       cox    partial 137      128 -483.9657 2  971.9314  977.7714
#>   delta_aic
#> 1  8.862267
#> 2  0.000000
#> 3  0.000000