Separate first-event episodes from all later episodes with a stratum indicator. A Stratified Cox model permits one baseline hazard for first events and another for recurrent events while retaining a common treatment coefficient. Later episodes can share their baseline; stratifying each recurrence number separately is a stronger model than the first-versus-later distinction alone.
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.
In a proportional hazards model, individual has
The exponential term is the hazard multiplier relative to the baseline hazard . With unspecified, the Cox partial likelihood multiplies, over event times, the failing subject's multiplier divided by the sum of multipliers in the current risk set. After estimating , the Breslow estimator is
A Stratified Cox model uses a separate baseline hazard for each stratum but a common . Its partial likelihood is the product of within-stratum partial likelihoods, and a separate integrated baseline hazard is estimated in each stratum.
In a matched pair, the only informative comparison occurs while both members remain at risk. If the exposed member fails first, the pair contributes ; if the unexposed member fails first, it contributes . A censoring as the first recorded time gives no informative failure comparison, and any later one-person risk set contributes one. With only two observations per stratum, each stratum supplies almost no information about its arbitrary baseline hazard, so a useful common integrated baseline-hazard estimate is generally unavailable.
Use each matched pair as a separate stratum with its own baseline hazard and fit one common treatment coefficient . The Stratified Cox model partial likelihood multiplies the within-pair risk-set contributions, eliminating all pair-specific baselines. Test by the corresponding conditional score, likelihood-ratio, or Wald test.