Learn R Programming

frailtyEM (version 1.0.1)

ca_test: Commenges-Andersen test for heterogeneity

Description

Commenges-Andersen test for heterogeneity

Usage

ca_test(object, id = NULL)

Arguments

object

A coxph object with a cluster() statement in the right-hand side of the formula.

id

Optionally, a vector determining the grouping to be tested. See details.

Value

A named vector containing the test statistic, variance, and p-value

Details

The Cox model with a +cluster() statement has the same point estimates as the one without that statmenet. The only difference is in the adjusted standard errors. In some cases, a model with +cluster() statments can't be fitted. For example, when there are no covariates. In that case, a vector may be passed on in the cluster argument.

References

Commenges, D. and Andersen, P.K., 1995. Score test of homogeneity for survival data. Lifetime Data Analysis, 1(2), pp.145-156.

Examples

Run this code
# NOT RUN {
mcox1 <- coxph(Surv(time, status) ~ rx + sex + cluster(litter),
rats, model = TRUE, x = TRUE)
ca_test(mcox1)

mcox2 <- coxph(Surv(time, status) ~ 1, rats, x = TRUE)
ca_test(mcox2, rats$litter)
# }

Run the code above in your browser using DataLab