anova.joint: Anova for joint models

View source: R/loglik.R

anova.jointR 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 joint function. This should be nested in object2.

object2

a joint model fit by the joint function. This should be more complex than object.

...

additional arguments (none used).

Value

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.

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. 


gmvjoint documentation built on Oct. 6, 2024, 1:07 a.m.