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)

Example output

Loading required package: survival
     tstat        var       pval 
 8.8868729 44.6651749  0.1836063 
       tstat          var         pval 
1.811386e+01 2.581246e+01 3.634361e-04 

frailtyEM documentation built on Sept. 22, 2019, 5:05 p.m.