powered by
For a given age interval, each spell is cut to fit into the given age interval.
age.window(dat, window, surv = c("enter", "exit", "event"))
Input data frame. Must contain survival data.
Vector of length two; the age interval.
Vector of length three giving the names of the central variables in 'dat'.
A data frame of the same form as the input data frame, but 'cut' as desired. Intervals exceeding window[2] will be given event = 0
window[2]
event = 0
The window must be in the order (begin, end)
window
(begin, end)
cal.window, coxreg, aftreg
cal.window
coxreg
aftreg
# NOT RUN { dat <- data.frame(enter = 0, exit = 5.731, event = 1, x = 2) window <- c(2, 5.3) dat.trim <- age.window(dat, window) # }
Run the code above in your browser using DataLab