Learn R Programming

xhaz (version 2.1.0)

BIC.constant: Bayesian Information Criterion for excess hazard model with baseline hazard following a piecewise constant function

Description

Calculates the Bayesian Information Criterion' for fitted models from xhaz.

Usage

# S3 method for constant
BIC(object, ...)

Value

the value corresponds to the BIC calculated from the total log-likelihood of the fitted model if just one object is provided. If multiple objects are provided, a data.frame with columns corresponding to the objects and rows representing the number of parameters in the model (df) and the BIC.

Arguments

object

a fitted model object obtained from xhaz function

...

optionally more fitted model objects obtained from xhaz function

Examples

Run this code
library("xhaz")
library("survival")
# Esteve et al. model: baseline excess hazard is a piecewise function
#                      linear and proportional effects for the covariates on
#                      baseline excess hazard.


set.seed(1980)
simuData2 <- simuData[sample(nrow(simuData), size = 500), ]
fit.estv2 <- xhaz(formula = survival::Surv(time_year, status) ~ agec + race,
                  data = simuData2,
                  ratetable = survival::survexp.us,
                  interval = c(0, NA, NA, NA, NA, NA, 6),
                  rmap = list(age = 'age', sex = 'sex', year = 'date'),
                  baseline = "constant", pophaz = "classic")


fit.estv2

BIC(fit.estv2)

Run the code above in your browser using DataLab