Description Usage Arguments Value Author(s) Examples
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.
1 | 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
1 2 3 4 5 6 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.