R: Identify Clusters

cluster {survival} | R Documentation

## Identify Clusters

### Description

This is a special function used in the context of survival models. It identifies correlated groups of observations, and is used on the right hand side of a formula. Using `cluster()` in a formula implies that robust sandwich variance estimators are desired.

### Usage

    cluster(x)

### Arguments

`x` | A character, factor, or numeric variable.

### Value

`x`

### See Also

`coxph`, `Surv`

### Examples

    data(kidney)
    frailty.model <- coxph(Surv(time, status)~ age + sex + disease + frailty(id), kidney)
    marginal.model <- coxph(Surv(time, status)~ age + sex + disease+cluster(id), kidney)
    summary(frailty.model)
    summary(marginal.model)

    data(rats)
    frailty.model <- survreg(Surv(time, status) ~ rx +  frailty(litter), rats )
    marginal.model <- survreg(Surv(time, status) ~ rx +  cluster(litter), rats )
    summary(frailty.model)
    summary(marginal.model)

[Package survival version 2.30 Index]