exphaz | R Documentation |
Calculate the expected hazard and survival.
exphaz(
formula = formula(data),
data = sys.parent(),
ratetable,
rmap = list(age = NULL, sex = NULL, year = NULL),
ratedata = sys.parent(),
only_ehazard = TRUE,
subset,
na.action,
scale = 365.2425
)
formula |
a formula object of the |
data |
a data frame in which to interpret the variables named in the formula |
ratetable |
a rate table stratified by |
rmap |
a list that maps data set names to the ratetable names. |
ratedata |
a data frame of the hazards mortality in general population. |
only_ehazard |
a boolean argument (by default, |
subset |
an expression indicating which subset of the rows in data should be used in the fit. All observations are included by default |
na.action |
a missing data filter function. The default is na.fail, which returns an error if any missing values are found. An alternative is na.exclude, which deletes observations that contain one or more missing values. |
scale |
a numeric argument specifying by default |
An object of class list
containing the following components:
ehazard |
expected hazard calculated from the matching |
ehazardInt |
cumulative expected hazard calculated from the matching |
dateDiag |
date of diagnosis |
Time
is OBLIGATORY in YEARS.
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)
Therneau, T. M., Grambsch, P. M., Therneau, T. M., & Grambsch, P. M. (2000). Expected survival. Modeling survival data: extending the Cox model, 261-287.
library(survival)
library(survexp.fr)
library(xhaz)
fit.haz <- exphaz(
formula = Surv(obs_time_year, event) ~ 1,
data = dataCancer,
ratetable = survexp.fr, only_ehazard = TRUE,
rmap = list(age = 'age', sex = 'sexx', year = 'year_date')
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.