| tstartfun | R Documentation |
Computes starting time for follow-up intervals in longitudinal data using counting process notation. Within each subject, starting time equals -1 for the initial record and the previous record's follow-up time for subsequent records.
tstartfun(id, timevar, data)
id |
Patient or unit identifier (unquoted symbol, string, or vector). |
timevar |
Follow-up time variable (unquoted symbol, string, or vector). |
data |
Data frame containing |
Numeric vector of starting times in the same row order as data.
Willem M. van der Wal willem@vanderwalresearch.com, Ronald B. Geskus rgeskus@oucru.org
mydata1 <- data.frame(
patient = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2),
time.days = c(14, 34, 41, 56, 72, 98, 0, 11, 28, 35)
)
mydata1$tstart <- tstartfun(patient, time.days, mydata1)
mydata1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.