tte | R Documentation |
Calculate time-to-event and competing risks times and event indicators.
tte(start, fwup, ..., crisk = FALSE, fix = TRUE, censor = Inf, factor = 1)
start , fwup |
start and last follow-up date vectors |
... |
one or more event date vectors; note that event dates occurring
before |
crisk |
logical; if |
fix |
logical; if |
censor |
max time after which events/times are censored |
factor |
time factor to convert days (default) to months (e.g, use 30.437), years (365.242), etc. |
dd <- data.frame(
start = 0,
end = 10,
death = c(5, 2, NA, 2, NA),
prog = c(3, 2, NA, 3, 5),
trt = c(4, 1, NA, NA, 8)
)
dd[] <- lapply(dd, as.Date, origin = '2000-01-01')
tte(dd$start, dd$end, dd$death)
tte(dd$start, dd$end, dd$death, dd$prog)
tte(dd$start, dd$end, dd$death, dd$prog, crisk = TRUE)
tte(dd$start, dd$end, dd$death, dd$prog, dd$trt, crisk = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.