Calculates time intervals between dates or from pre-calculated values. Time intervals form the basis of person-time follow-up calculations in survival analysis. Person-time follows the accumulated time that participants contribute to a study while being at risk for the event of interest, accounting for varying entry times and censoring. Person-time is typically expressed in person-days, person-months, or person-years depending on the study duration and outcome frequency.
Usage
timeinterval(
data,
dx_date,
fu_date,
time_format = "ymd",
output_unit = "months",
use_landmark = FALSE,
landmark_time = 3,
add_times = TRUE
)