powered by
censor.time(surv.time, surv.event, time.cens = 0)
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)
Run the code above in your browser using DataLab