anova.curesurv {curesurv} | R Documentation |
This function computes an analysis of deviance table for two excess hazard models fitted using the curesurv R package.
## S3 method for class 'curesurv'
anova(object, ..., test = "LRT")
object |
An object of class curesurv. |
... |
Additional object of class curesurv. |
test |
A character string. Computes the likelihood-ratio test for value |
An object of class anova inheriting from class matrix. The different columns contain respectively the degrees of freedom and the log-likelihood values of the two nested models, the degree of freedom of the chi-square statistic, the chi-square statistic, and the p-value of the likelihood ratio test.
The comparison between two or more models by anova or more excess hazard models will only be valid if they are fitted to the same dataset, and if the compared models are nested. This may be a problem if there are missing values.
library("curesurv")
library("survival")
testiscancer$age_crmin <- (testiscancer$age - min(testiscancer$age)) / sd(testiscancer$age)
fit_m0 <- curesurv(Surv(time_obs, event) ~ 1 | 1,
pophaz = "ehazard",
cumpophaz = "cumehazard",
model = "nmixture", dist = "tneh",
link_tau = "linear",
data = testiscancer,
method_opt = "L-BFGS-B")
fit_m1 <- curesurv(Surv(time_obs, event) ~ age_crmin | 1,
pophaz = "ehazard",
cumpophaz = "cumehazard",
model = "nmixture", dist = "tneh",
link_tau = "linear",
data = testiscancer,
method_opt = "L-BFGS-B")
anova(fit_m0, fit_m1)