ca_test: Commenges-Andersen test for heterogeneity

Description Usage Arguments Details Value References Examples

View source: R/ca_test_cph.R

Description

Commenges-Andersen test for heterogeneity

Usage

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

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.

Value

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

References

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

Examples

1
2
3
4
5
6
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)

teddybalan/frailtoys documentation built on Sept. 21, 2019, 6:22 p.m.