library("numDeriv")
library("survexp.fr")
data("simuData","rescaledData", "dataCancer")
# load the data sets 'simuData', 'rescaledData' and 'dataCancer'.
# 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 = Surv(time_year, status) ~ agec + race,
data = simuData2,
ratetable = survexp.us,
interval = c(0, NA, NA, NA, NA, NA, 6),
rmap = list(age = 'age', sex = 'sex', year = 'date'),
baseline = "constant", pophaz = "classic")
print(fit.estv2)
Run the code above in your browser using DataLab