I've recently started working on survival analysis, but I'm still new to the field. My dataset consists of a cohort of 50 individuals with advanced cancer for whom I have some blood quantitative measures taken at 2 to 5 (unevenly-spaced) time points, within the first three months after enrollment in the study. These subjects have then been monitored for 2-3 years and, for those who died, I have information about death date. This is how my data looks like:

IID  Death Time  var   Age   SEX
1    0     413   0.42  51.2 M
1    0     392   0.29  51.3 M
1    0     350   0.20  51.4 M
2    1     88    0.01  73.2 F
2    1     68    0.46  73.3 F
2    1     26    0.35  73.4 F

I want to identify blood parameters associated with survival time, and therefore tried to run a mixed-effect Cox regression analysis, including a clustering factor (individual id) in order to account for the repeated measures (coxph function from survival R package):

fit <- coxph(Surv(time, death) ~ blood_variable + age + sex + cluster(iid))

I'm wondering if this a correct way to analyse the data, or there are more appropriate approaches. I've read about Cox-regression with time-dependent covariates, but I'm not sure if this is applicable to my dataset, given the irregular spacing between exposure measures, and the relatively large time difference between exposure measurement and outcome.

Thanks in advance


1 Answer 1


This involves a time-dependent covariate, your blood_variable. So you should convert your data into the Surv(startTime, stopTime, event) format needed to model such data. Read, study, and use as a guide the time-dependent vignette provided for the R survival package.

But fix the following also before you do that:

  1. Your displayed Time and Age values make no sense, as Time gets shorter while Age gets older! The Time variable should represent the time since study entry or other well-defined starting point.

  2. You maybe should not be modeling Age in the time-dependent way that you are. Often, simply using age at study entry and carrying that through all data points will suffice. Alternatively, there are ways to incorporate predictable time-varying covariates in a model more directly; see the vignette linked above.

  3. You seem to be using the Death indicator to show whether the individual ever died. That's wrong, as death is an event that only happens once. That indicator should only equal 1 at the time point of death, and should show 0 at all other times for an individual.

  4. Related to the above, the cluster() term for an individual does nothing useful here (and only might have seemed to do something because you had multiple apparent death times for the same individual the way you coded the data). The cluster() term helps deal with internal correlations in the data, as you would have if there were multiple events per individual (cluster(IID)) or you were using some across-subjects grouping factor like hospitals (cluster(hospitalID))in your model so that there are multiple events in the clustered predictor. That's not the case here.

Then you face the big question: just how do you expect the blood_variable to be associated with risk of death? Survival modeling generally takes the instantaneous value of a covariate as what determines that risk at any time.

Is that assumption of an instantaneous association OK in your situation? Is it maybe instead the value integrated over some prior time that affects the risk of death? Might you be facing a survivorship bias problem, in which only those who survive a certain length of time ever tend to reach some value of the blood_variable? Or is the blood_variable simply some epiphenomenon, always reaching some value when someone is at death's doorstep?

Those latter questions require a good deal of thought based on your understanding of the subject matter, and will need to be incorporated into how you format and model the data.

  • $\begingroup$ Note: age is often an important variable for many studies but for people diagnosed with a serious disease it is often irrelevant to survival time. $\endgroup$ Aug 30, 2021 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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