Hmisc (version 3.0-10)

rcorrp.cens: Rank Correlation for Paired Predictors with a Censored Response

Description

Computes U-statistics to test for whether predictor X1 is more concordant than predictor X2, extending rcorr.cens. For method=1, estimates the fraction of pairs for which the x1 difference is more impressive than the x2 difference. For method=2, estimates the fraction of pairs for which x1 is concordant with S but x2 is not.

Usage

rcorrp.cens(x1, x2, S, outx=FALSE, method=1)

Arguments

x1
first predictor
x2
second predictor
S
a possibly right-censored Surv object. If S is a vector instead, it is converted to a Surv object and it is assumed that no observations are censored.
outx
set to T to exclude pairs tied on x1 or x2 from consideration
method
see above

Value

  • a vector of statistics

See Also

rcorr.cens, somers2, Surv

Examples

Run this code
set.seed(1)
if(.R.) library(survival)
x1 <- rnorm(400)
x2 <- x1 + rnorm(400)
d.time <- rexp(400) + (x1 - min(x1))
cens   <- runif(400,.5,2)
death  <- d.time <= cens
d.time <- pmin(d.time, cens)
rcorrp.cens(x1, x2, Surv(d.time, death))
# rcorrp.cens(x1, x2, y) ## no censoring

Run the code above in your browser using DataCamp Workspace