I am currently working with intraday time-to-event data, where the time to event typically spans just a few minutes. I want to compare the survival curves of two subpopulations in my sample. The dataset covers multiple years, and I suspect that the time-to-event may change over the course of the sample.

To address this, I am interested in exploring survival analysis models that can account for these changes over time. Could you refer me to any relevant literature or studies where survival analysis has been applied in a situation like this? In most papers I find, the time dimension is not really used.

  • $\begingroup$ There's no inherent problem with including something like the calendar date of the time = 0 study entry as a predictor in a survival model, even though the calendar dates go over a range of years while the event times after time = 0 in each case are only a few minutes. It sounds like that's all you would need to do. If you have something more complicated in mind, please edit the question to provide more details. $\endgroup$
    – EdM
    Commented Jul 1, 2023 at 15:00
  • $\begingroup$ Is it possible to include time fixed-effects in a Cox regression to account for changing time-to-event over different dates? Or what would be the best approach? If you know any literature or studies that have explored similar approaches, I would be grateful if you could share them with me. $\endgroup$
    – John
    Commented Jul 1, 2023 at 16:20

1 Answer 1


The time used for evaluating an individual's survival in your Cox model is the time elapsed between study entry and the time of the event (or censoring). You can include in your model any predictor variable that might be associated with survival provided that it doesn't look into the future in some way. If the calendar date of study entry might be associated with survival time, then there's no problem including that as a predictor; the calendar date of study entry is known before any event is possible.

Therneau and Grambsch show models of the classic Stanford heart transplant data that include the calendar time of study entry as a predictor; see their models sfit.2 through sfit.6 in Section 3.7.1 (page 73). The predictor is called year in those data, but it's a continuous variable expressed in units of years relative to 1 October 1967.

It's usually best to model continuous variables like age and calendar dates flexibly, for example with splines, to allow for other than linear associations with the log-hazard of an event. Here's a simple example based on the same underlying data, available in the R survival package. I used the type of penalized splines built into that package, but you could also use natural regression splines as provided by the ns() function in the splines package, or the rcs() function in the rms package.

heartMod <- coxph(Surv(start,stop,event)~pspline(age)+pspline(year)+surgery, data=heart)
# Call:
# coxph(formula = Surv(start, stop, event) ~ pspline(age) + pspline(year) + 
    surgery, data = heart)
#                          coef se(coef)     se2   Chisq   DF      p
# pspline(age), linear   0.0270   0.0125  0.0123  4.6562 1.00 0.0309
# pspline(age), nonlin                            5.9196 3.00 0.1158
# pspline(year), linear -0.1621   0.0700  0.0697  5.3677 1.00 0.0205
# pspline(year), nonlin                          12.2151 2.99 0.0066
# surgery               -0.8293   0.4041  0.3970  4.2125 1.00 0.0401
# Iterations: 5 outer, 15 Newton-Raphson
#      Theta= 0.621 
#      Theta= 0.661 
# Degrees of freedom for terms= 4 4 1 
# Likelihood ratio test=34.6  on 8.96 df, p=7e-05
# n= 172, number of events= 75 

In this case there's a significant nonlinear association of year with outcome that wouldn't have been captured by using year as a simple linear predictor. This model is probably a bit overfit, as modeling used up 9 degrees of freedom with only 75 events available, but it illustrates the way to proceed.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.