Learn R Programming

coxme (version 2.2-22)

anova.coxme: Analysis of Deviance for a Cox model.

Description

Compute an analysis of deviance table for one or more Cox model fits.

Usage

# S3 method for coxme
anova(object, ...,  test = 'Chisq')

Value

An object of class "anova" inheriting from class "data.frame".

Arguments

object

An object of class coxme or coxph

...

Further coxme objects

test

a character string. The appropriate test is a chisquare, all other choices result in no test being done.

Warning

The comparison between two or more models by anova or will only be valid if they are fitted to the same dataset. This may be a problem if there are missing values.

Details

Specifying a single object gives a sequential analysis of deviance table for that fit. That is, the reductions in the model log-likelihood as each term of the formula is added in turn are given in as the rows of a table, plus the log-likelihoods themselves.

If more than one object is specified, the table has a row for the degrees of freedom and loglikelihood for each model. For all but the first model, the change in degrees of freedom and loglik is also given. (This only make statistical sense if the models are nested.) It is conventional to list the models from smallest to largest, but this is up to the user.

The table will optionally contain test statistics (and P values) comparing the reduction in loglik for each row.

See Also

coxme, anova.

Examples

Run this code
# Testing a shrunken estimate of ECOG performace status
fit1 <- coxph(Surv(time, status) ~ age + sex, data=lung,
               subset=(!is.na(ph.ecog)))
fit2 <- coxme(Surv(time, status) ~ age + sex + (1|ph.ecog), lung)
anova(fit1,fit2)
 

Run the code above in your browser using DataLab