View source: R/predict.xhaz.constant.R
predict.constant | R Documentation |
constant
objectFunction to predict excess hazard and net survival based on an
object of class constant
. The function allows the
predictions at several time points but not exceeding the maximum time of
follow-up from the baseline model.
## S3 method for class 'constant'
predict(object, new.data = NULL, times.pts = NULL, baseline = TRUE, ...)
object |
An object of class constant |
new.data |
new.data where is covariates |
times.pts |
time in year scale to calculate the excess hazard. The default value is NULL. In this case, time variable must be provided in the new.data |
baseline |
default is survival baseline; put |
... |
additional arguments affecting the predictions of excess hazard and net survival |
An object of class predxhaz. The return of this fonction can be used to produce graphics of excess hazard or net survival, when times.pts argument is provided. This object contains:
times.pts |
the times value in year at which the excess hazard and or the net survival have been estimated |
hazard |
the excess hazard values based on the model of interest |
survival |
the net survival values based on the model of interest |
Juste Goungounga, Robert Darlin Mba, Nathalie Graff\'eo and Roch Giorgi
Goungounga JA, Touraine C, Graff\'eo N, Giorgi R; CENSUR working survival group. Correcting for misclassification and selection effects in estimating net survival in clinical trials. BMC Med Res Methodol. 2019 May 16;19(1):104. doi: 10.1186/s12874-019-0747-3. PMID: 31096911; PMCID: PMC6524224. (PubMed)
Touraine C, Graff\'eo N, Giorgi R; CENSUR working survival group. More accurate cancer-related excess mortality through correcting background mortality for extra variables. Stat Methods Med Res. 2020 Jan;29(1):122-136. doi: 10.1177/0962280218823234. Epub 2019 Jan 23. PMID: 30674229. (PubMed)
Mba RD, Goungounga JA, Graff\'eo N, Giorgi R; CENSUR working survival group. Correcting inaccurate background mortality in excess hazard models through breakpoints. BMC Med Res Methodol. 2020 Oct 29;20(1):268. doi: 10.1186/s12874-020-01139-z. PMID: 33121436; PMCID: PMC7596976. (PubMed)
xhaz
, print.bsplines
, print.constant
# load the data set in the package
library("xhaz")
library("numDeriv")
# load the data sets 'simuData
data("simuData", package = "xhaz")
#define the levels of variable sex
levels(simuData$sex) <- c("male", "female")
# Esteve et al. model
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")
predict_est <- predict(object = fit.estv2,
new.data = simuData2,
times.pts = c(seq(0, 4, 1)),
baseline = TRUE)
predict_est
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.