| 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
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.
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.