In the usual construction of a Kaplan-Meier curve in R where individuals are observed from when first at risk through to either failure or censoring, one can specify something like:
survfit(Surv(time, status) ~ group, data = dat)
Which creates separate survival curves by levels of the grouping variable, where there is a single observation period for each individual.
That's all fine, but I don't fully appreciate the following two extensions of that basic scenario:
- The grouping variable is time-varying. Thus, there is potentially more than one row of data per individual (counting process format)
- Additionally, delayed-entry (left-truncation) may be present where the individual comes under observation at some time past when their risk of having the event commences (counting process format with potential non-zero time1)
Both of these situations are represented using time1, time2 format in the same way (as I understand):
survfit(Surv(time1, time2, status) ~ group, data = dat)
Is the KM curve produced from this correct/meaningful given an individual may not belong uniquely to a group?