This function creates a dataset of planned visit times for each patient, taking into account censoring due to dropouts or events. After a patient drops out or has an event (e.g., death), no further visits are generated.
Arguments
- data
A data frame of patients. If the data contains
DropoutTime/Droppedand/orEventTime/EventStatuscolumns, these will be used to censor visits.- visit_times
Numeric vector of planned visit times (in the same time units as other simulation outputs). For example,
c(0, 3, 6, 9, 12)for monthly visits over a year (if time in months). Include 0 for baseline.
Value
A data frame with one row per patient per scheduled visit (up to any censoring point). Columns:
ID: Patient ID (matchingdata$ID).Time: Scheduled visit time.