anova.joint | R Documentation |
Perform a likelihood ratio test between two (nested) joint
models. The user must decide whether the models are truly nested.
## S3 method for class 'joint'
anova(object, object2, ...)
object |
a joint model fit by the |
object2 |
a joint model fit by the |
... |
additional arguments (none used). |
A list of class anova.joint
with elements
mod0
the name of object
.
l0
the log-likelihood of the nested model, i.e. fit under the null.
AIC0
AIC for object
.
BIC0
BIC for object
.
mod1
the name of object2
.
l1
the log-likelihood under the alternative hypothesis.
AIC1
AIC for object2
.
BIC1
BIC for object2
.
LRT
likelihood ratio test statistic.
p
the p-value of LRT
.
warnSurv
internal - logical value for printing difference in survival models.
warnRanefs
internal - logical value for printing difference in random effects specifications.
James Murray (j.murray7@ncl.ac.uk)
joint
and logLik.joint
.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.