Learn R Programming

JM (version 0.8-1)

anova: Anova Method for Fitted Joint Models

Description

Performs a likelihood ratio test between two nested joint models.

Usage

## S3 method for class 'jointModel':
anova(object, object2, test = TRUE, \dots)

Arguments

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.

Value

  • An object of class aov.jointModel with components,
  • nam0the name of object.
  • L0the log-likelihood under the null hypothesis (object).
  • aic0the AIC value for the model given by object.
  • bic0the BIC value for the model given by object.
  • nam1the name of object2.
  • L1the log-likelihood under the alternative hypothesis (object2).
  • aic1the AIC value for the model given by object2.
  • bic1the BIC value for the model given by object2.
  • dfthe degrees of freedom for the test (i.e., the difference in the number of parameters).
  • LRTthe value of the Likelihood Ratio Test statistic (returned if test = TRUE).
  • p.valuethe $p$-value of the test (returned if test = TRUE).

Warning

The code minimally checks whether the models are nested! The user is responsible to supply nested models in order the LRT to be valid.

References

Rizopoulos, D. (2010) JM: An R Package for the Joint Modelling of Longitudinal and Time-to-Event Data. Journal of Statistical Software 35 (9), 1--33. http://www.jstatsoft.org/v35/i09/

See Also

jointModel

Examples

Run this code
# 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 without treatment effect
fitJOINT.null <- jointModel(fitLME.null, fitCOX.null, 
    timeVar = "obstime", method = "weibull-PH-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 with treatment effect
fitJOINT.alt <- jointModel(fitLME.alt, fitCOX.alt, timeVar = "obstime", 
    method = "weibull-PH-GH")

# likelihood ratio test for treatment effect
anova(fitJOINT.null, fitJOINT.alt)

Run the code above in your browser using DataLab