# Survival analysis with recurrent events with subjects that move in and out of risk periods

I would like to model a recurrent event with subjects that move in and out of risk over the course of the observation period of the study.

I have data on the out-of-risk periods (start and end dates) where the subject cannot experience the event. In my reading of this topic, I believe that this situation is referred to as "interval truncation" or "gaps", where subjects are "unobserved" for periods. And to best represent this, my data should be structured in counting process format, with start stop times that reflect these "gaps" in observations of each subject.

Q1. I would like to confirm that my understanding is correct and this would be an appropriate approach? If not, suggestions of better approaches are welcomed!

Q2. If interval truncation is the way to go, I would appreciate any help on how to convert my data to this counting process format with start stop times that reflect both event occurrence and unobserved periods in R. I can convert the data to counting process format with event occurrence, but do not know how to partition my start stop times to reflect unobserved periods (other than manually creating the data set which I would very much like to avoid).

Other useful info about my study:

• Subjects have a common start time of 0 months.
• Subjects are right-censored.
• Subjects are observed for 3 years.
• Subjects can move in and out of risk for varying amounts of time and frequency during the 3 year observation period.

Thank you!

• Could you just definitively clarify if are the subjects truly unobserved when out of risk?Does this mean 'not actively monitored', or does it mean 'no information can be accessed about anything in the interval'. I.e. If an event occurred when considered out of risk you would never know about it? – ReneBt Dec 19 '18 at 8:21
• @ReneBt it is neither "not actively monitored" nor "no info can be accessed about anything in the interval". My subjects are observed throughout the 3 years but there are known periods where I definitively know the event cannot occur, i.e. the subject is not at risk. During such periods, the event occurrence is known to be 0. However, I would like to differentiate this from subjects that had event occurrence = 0, but remained at risk. – shitshimugi Dec 19 '18 at 8:37
• I'll use this example to illustrate my study. Event = employment. Sample: ex-offenders. There may be ex-offenders that re-offend and get incarcerated for part of the period of observation, rendering them unable to be employed in the community. This is different to other ex-offenders who are not incarcerated but remain unemployed. – shitshimugi Dec 19 '18 at 8:41

Yes interval censoring is a way to handle this. The trick is to format it like any plain ol' right censored analysis. So one subject will result in two records when they have an interval censored period. The first record has time $$0$$ to time $$t_1$$ when they go off study and the event indicator set to $$0$$, then the second record has time $$t_2$$ to time $$t_3$$ where they experience the event (or don't as indicated by the censoring variable). The trick is time $$t_2 > t_1$$.

Handling multiple events can be done a few ways. The easiest is just the same as above. As soon as the event happens, say at time $$t_1$$, re-enter them in the study with a new record starting at time $$t_1$$ and following the patient until experience of their next event (if any).

People hem and haw about using methods for dependent data in these scenarios. A few applied examples and simulations have convinced me the interpretation of the above method is usually not far off from more complicated frailty models. For extra assurance, you can use a robust error estimator by specifying clusters within subject.

Sometimes a useful addition to these models is adding a covariate which either indicates whether the event has occurred or how many times it has occurred. For instance, in a cohort of subjects at risk for contracting a disease that is marked by "flare ups" has a much lower hazard until the patient in fact has the disease, at which point the flare ups occur much more frequently (so a diseased indicator is useful here).

• Hi AdamO, thank you for the quick answer. May I ask if the terms "interval censoring" and "interval truncation" are used interchangeably? My understanding is that "interval censoring" is used when the exact time of the event is unknown. This is different from my situation where I do know the exact time of occurrence but would like to account for unobserved periods. Or did you mean to treat the data like you would when applying interval censoring, just that for my scenario all the interval censored periods have event=0. – shitshimugi Dec 19 '18 at 5:26
• @shitshimugi that understanding of censoring is not correct. When a subject is censored, if the event happened (in your case possibly many times), you would never know it. They are subtracted from the denominator as a way of handling the missing value in the numerator is all. The 0 denotes the end of follow-up preceding the interval censoring. You know they didn't have the event for that period, so don't throw those data away. – AdamO Dec 19 '18 at 5:30
• sorry i'm having some difficulty understanding your comment. In my study, subjects are right-censored if they never experience the event during the 3 year observation period. However, during this 3 years, there are known time periods where it is impossible for the subject to experience the event. This is a little different from examples I've come across discussing "interval truncation" which typically describe subjects dropping out and in of the study and thus are "unobserved" for certain periods. – shitshimugi Dec 19 '18 at 5:54
• In my study, the subjects are never "unobserved" during the 3 years, but rather the event is impossible during specific periods. Because different subjects are out-of-risk for varying number of periods and their out-of-risk periods differ in length of time, I would like to model this. – shitshimugi Dec 19 '18 at 5:57
• @shitshimugi that's a different thing altogether. If the event can't happen, the the hazard is 0. With no events over a period of time, there's no impact on the risk sets whatsoever, so the Cox model is unfazed by this artifact of time. – AdamO Dec 20 '18 at 4:06