# load the data set in the package
# \donttest{
library("survival")
library("numDeriv")
library("survexp.fr")
library("statmod")
data("dataCancer", package = "xhaz") # load the data set in the package
fit.phBS <- xhaz(
formula = Surv(obs_time_year, event) ~ ageCentre + immuno_trt,
data = dataCancer,
ratetable = survexp.fr::survexp.fr,
interval = c(0, NA, NA, max(dataCancer$obs_time_year)),
rmap = list(age = 'age', sex = 'sexx', year = 'year_date'),
baseline = "bsplines", pophaz = "classic")
fit.nphBS <- xhaz(
formula = Surv(obs_time_year, event) ~ ageCentre + qbs(immuno_trt),
data = dataCancer,
ratetable = survexp.fr::survexp.fr,
interval = c(0, NA, NA, max(dataCancer$obs_time_year)),
rmap = list(age = 'age', sex = 'sexx', year = 'year_date'),
baseline = "bsplines", pophaz = "classic")
anova(fit.phBS, fit.nphBS)
# }
Run the code above in your browser using DataLab