rcorr.cens {Hmisc}R Documentation

Rank Correlation for Censored Data

Description

Computes the c index and the corresponding generalization of Somers' Dxy rank correlation for a censored response variable. Also works for uncensored and binary responses, although its use of all possible pairings makes it slow for this purpose.

Usage

rcorr.cens(x, S, outx=FALSE)

Arguments

x a numeric predictor variable
S an Surv object or a vector. If a vector, assumes that every observation is uncensored.
outx set to TRUE to not count pairs of observations tied on x as a relevant pair. This results in a Goodman–Kruskal gamma type rank correlation.

Value

a vector with the following named elements: C Index, Dxy, S.D., n, missing, uncensored, Relevant Pairs, Concordant, and Uncertain

n number of observations not missing on any input variables
missing number of observations missing on x or S
relevant number of pairs of non-missing observations for which S could be ordered
concordant number of relevant pairs for which x and S are concordant.
uncertain number of pairs of non-missing observations for which censoring prevents classification of concordance of x and S.

Author(s)

Frank Harrell
Department of Biostatistics
Vanderbilt University
f.harrell@vanderbilt.edu

References

Newson R: Confidence intervals for rank statistics: Somers' D and extensions. Stata Journal 6:309-334; 2006.

See Also

somers2

Examples

set.seed(1)
x <- round(rnorm(200))
y <- rnorm(200)
rcorr.cens(x, y, outx=TRUE)   # can correlate non-censored variables
if(.R.) library(survival)
age <- rnorm(400, 50, 10)
d.time <- rexp(400)
cens   <- runif(400,.5,2)
death  <- d.time <= cens
d.time <- pmin(d.time, cens)
rcorr.cens(age, Surv(d.time, death))

[Package Hmisc version 3.1-2 Index]