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 history contains the information observed strictly before : baseline characteristics, previous events and censoring, and therefore which individuals are currently eligible and under observation. Formally it is the pre- information in the relevant filtration. The at-risk process is 1 if individual is observed and event-free immediately before , and 0 otherwise. Let and write for the cumulative hazard increment.
The counting-process intensity in survival analysis gives
The common conditional hazard function is assumed to remain applicable after conditioning on the observed history, as under suitable independent censoring. Summing gives the conditional mean of the total event increment:
On times with , invert this relation to estimate the hazard increment:
The last sum is for untied events. This is the Nelson–Aalen estimator; for ties replace 1 by the number of events at that time. No increment can be estimated once the risk set is empty.
In the counting-process intensity in survival analysis, the counting process jumps once if an observed event occurs; the at-risk process is one immediately before only while individual is still observed and event-free. Conditional on that information, the chance of an event in a short interval is for an at-risk individual and zero otherwise. This is the meaning of
The history is the filtration generated by the observed event and censoring histories, entry information, and available covariates strictly before . In particular, it determines the current risk set but does not reveal future event times. The right-hand side is the infinitesimal compensator of a counting process; the equality is interpreted as an intensity statement to first order in .