| anova.joint {gmvjoint} | R Documentation |
Anova for joint models
Description
Perform a likelihood ratio test between two (nested) joint
models. The user must decide whether the models are truly nested.
Usage
## S3 method for class 'joint'
anova(object, object2, ...)
Arguments
object |
a joint model fit by the |
object2 |
a joint model fit by the |
... |
additional arguments (none used). |
Value
A list of class anova.joint with elements
mod0the name of
object.l0the log-likelihood of the nested model, i.e. fit under the null.
AIC0AIC for
object.BIC0BIC for
object.mod1the name of
object2.l1the log-likelihood under the alternative hypothesis.
AIC1AIC for
object2.BIC1BIC for
object2.LRTlikelihood ratio test statistic.
pthe p-value of
LRT.warnSurvinternal - logical value for printing difference in survival models.
warnRanefsinternal - logical value for printing difference in random effects specifications.
Author(s)
James Murray (j.murray7@ncl.ac.uk)
See Also
joint and logLik.joint.
Examples
rm(list=ls())
data(PBC)
# Compare quadratic vs linear time specification for log(serum bilirubin) -----
PBC$serBilir <- log(PBC$serBilir)
long.formulas1 <- list(serBilir ~ drug * time + (1 + time|id))
long.formulas2 <- list(serBilir ~ drug * (time + I(time^2)) + (1 + time + I(time^2)|id))
surv.formula <- Surv(survtime, status) ~ drug
family <- list('gaussian')
# Fit the two competing models (fit is nested in fit2) ------------------------
fit <- joint(long.formulas1, surv.formula, PBC, family,
control = list(verbose = FALSE))
fit2 <- joint(long.formulas2, surv.formula, PBC, family, control = list(verbose = FALSE))
anova(fit, fit2)
# Quadratic terms improve fit significantly.