Use one row per consecutive at-risk episode, retaining a patient identifier for dependence and an episode number for event order. In calendar time, the intervals are ; status is one if the row ends in a headache and zero if it ends in censoring. Patient 001 contributes
PatientNext-event episodeStartStopEvent
0011024.810
001224.833.110
001333.140.210
001440.251.910
001551.960.000
The fifth episode is censored, not a fifth observed headache. All rows retain . This start-stop recurrent-event data layout corresponds to the counting-process intensity in survival analysis
where indicates that the patient is currently observed and eligible for a headache. Fit the regression coefficient by Cox partial likelihood using the resulting risk sets, and estimate the baseline cumulative hazard nonparametrically, for example by the Breslow estimator. Patient rows are portions of one history, not new independent patients.
The second episode starts only after the first headache, at 24.8; its row is absent from every risk set before that time. More generally, episode starts at the observed end of episode . The left-open, right-closed interval convention assigns an event at a shared boundary only to the interval ending there. Thus the first event is counted once, and the second cannot be counted before the first. Preserving the episode entry times and patient history enforces the ordering; entering every recurrence as a new record starting at treatment time zero would not do so.
Set the availability indicator to zero during the three-day recovery interval after each headache. Keep each episode's endpoint, but delay its entry to the previous headache time plus three. The calendar-time rows become
PatientNext-event episodeStartStopEvent
0011024.810
001227.833.110
001336.140.210
001443.251.910
001554.960.000
The first interval still begins at zero because the patient was already headache-free for at least seven days before treatment. The recovery gaps supply no at-risk exposure and no partial-likelihood risk-set membership; they should not be retained as ordinary event-free at-risk time. If recovery extends past administrative closure, no subsequent eligible interval is created. This is a refractory period in recurrent-event analysis, represented by availability rather than by changing the event times.
For second and subsequent episodes, subtract the preceding headache time from both calendar endpoints. The new clock is the age since the start of that headache, not the age since recovery ended. Keeping the recovery restriction from part (c) therefore gives
PatientNext-event episodeGap startGap stopEvent
0011024.810
001238.310
001337.110
0014311.710
001538.100
For example, the second stop is , while its entry is . Thus subsequent rows begin at gap age three, not zero. The first row retains time since treatment started. Keep the patient and episode labels, and preferably the original calendar endpoints as auxiliary fields: gap ages in different episodes are not chronological treatment times. The value 7.1 for episode three being smaller than 8.3 for episode two does not reverse their occurrence order. This gap-time recurrent-event model forms risk sets on the episode-age scale while preserving each episode's historical eligibility.
Add a stratum indicator that is “First” for the first episode and “Later” for every subsequent episode, including the final censored episode:
PatientNext-event episodeGap startGap stopEventStratum
0011024.810First
001238.310Later
001337.110Later
0014311.710Later
001538.100Later
A Stratified Cox model then uses distinct baseline hazards and , with a common treatment coefficient unless an interaction is explicitly desired. Form separate risk sets within the two strata and multiply their partial likelihoods. There is no need to force every later event number to have its own baseline when the stated aim is only first versus subsequent headaches. This is a first-event versus recurrent-event baseline stratification.
The episodes from one patient share treatment, biological susceptibility and prior history, so they are not independent observations. Treating every row as an unrelated subject can substantially understate uncertainty. Two approaches address this within-patient recurrent-event dependence:
A patient-level bootstrap is another way to retain dependence: resample complete histories, not individual episode rows. It is not necessary to assume that robust marginal/working and frailty-conditional effect estimates target exactly the same parameter.

Articles by others on the same topic (0)

There are currently no matching articles.