censor.time {survcomp} | R Documentation |
The function censors the survival data at a specific point in time. This is is useful if you used datasets having different follow-up periods.
censor.time(surv.time, surv.event, time.cens = 0)
surv.time |
vector of times to event occurrence |
surv.event |
vector of indicators for event occurrence |
time.cens |
point in time at which the survival data must be censored |
surv.time.cens |
vector of censored times to event occurrence |
surv.event.cens |
vector of censored indicators for event occurrence |
Benjamin Haibe-Kains
set.seed(12345) stime <- rexp(30) cens <- runif(30,0.5,2) sevent <- as.numeric(stime <= cens) stime <- pmin(stime, cens) censor.time(surv.time=stime, surv.event=sevent, time.cens=1)