anova {JM} | R Documentation |
Performs a likelihood ratio test between two nested joint models.
## S3 method for class 'jointModel': anova(object, object2, test = TRUE, ...)
object |
an object inheriting from class jointModel , nested in object2 . |
object2 |
an object inheriting from class jointModel . |
test |
logical; if TRUE the likelihood ratio test is performed. |
... |
additional arguments; currently none is used. |
An object of class aov.jointModel
with components,
nam0 |
the name of object . |
L0 |
the log-likelihood under the null hypothesis (object ). |
aic0 |
the AIC value for the model given by object . |
bic0 |
the BIC value for the model given by object . |
nam1 |
the name of object2 . |
L1 |
the log-likelihood under the alternative hypothesis (object2 ). |
aic1 |
the AIC value for the model given by object2 . |
bic1 |
the BIC value for the model given by object2 . |
df |
the degrees of freedom for the test (i.e., the difference in the number of parameters). |
LRT |
the value of the Likelihood Ratio Test statistic (returned if test = TRUE ). |
p.value |
the p-value of the test (returned if test = TRUE ). |
The code minimally checks whether the models are nested! The user is responsible to supply nested models in order the LRT to be valid.
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
# linear mixed model fit without treatment effect fitLME.null <- lme(sqrt(CD4) ~ obstime, random = ~ 1 | patient, data = aids) # cox model fit without treatment effect fitCOX.null <- coxph(Surv(Time, death) ~ 1, data = aids.id, x = TRUE) # joint model fit, under the additive log cumulative hazard model # without treatment effect fitJOINT.null <- jointModel(fitLME.null, fitCOX.null, timeVar = "obstime", method = "ch-GH") # linear mixed model fit with treatment effect fitLME.alt <- lme(sqrt(CD4) ~ obstime * drug - drug, random = ~ 1 | patient, data = aids) # cox model fit with treatment effect fitCOX.alt <- coxph(Surv(Time, death) ~ drug, data = aids.id, x = TRUE) # joint model fit, under the additive log cumulative hazard model # with treatment effect fitJOINT.alt <- jointModel(fitLME.alt, fitCOX.alt, timeVar = "obstime", method = "ch-GH") # likelihood ratio test for treatment effect anova(fitJOINT.null, fitJOINT.alt)