Last chance! 50% off unlimited learning
Sale ends in
rcorrp.cens(x1, x2, S, outx=FALSE, method=1)
Surv
object. If S
is a vector instead,
it is converted to a Surv
object and it is assumed that no observations
are censored.rcorr.cens
, somers2
, Surv
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 DataLab