I have registry data for treatment with a certain drug for a large number of patients from the years 2005-2012. The main research question is whether the treatment is associated with higher mortality in this patient group. The problem is that treatment with this drug has become much more prevalent from 2005 to 2012 and I'm not sure if this affects my results, and how to control for it.

I will be using a stratified extended Cox regression model in a similar manner as in this paper, for example in this paper on drug treatment for ADHD and suicidal behavior. In short, each patient has multiple rows with a time-dependent treatment indicator variable that is 0 when the patient is not in treatment and 1 when the patient is in treatment. Each time the treatment status changes (from 0 to 1 or vice versa), the time variable resets to 0. In the analysis, each patient has an individual stratum so that the patient is compared with itself. Some lines of the data set:

id    start   stop   treatment    event
132   0       74     0            0
132   0      675     1            0
132   0     1232     0            1
387   0      981     0            0
387   0      145     1            1

The R code for the analysis is as follows:

coxph(Surv(start, stop, event) ~ treatment + stratum(id) + cluster(id))

This gives a highly significant result with a hazard ratio of about 3. However, since the treatment has become approximately twice as common in this patient group from 2005 to 2012, I think this might influence the results. A patient is more likely to be treated by the end of the study, and death of course marks the end of a patient's study period.

Does the overall increased rate of treatment with the drug later in the study lead to biased results, and if so, how can I adjust for it?


1 Answer 1


It depends what you have. Do you know the date of the entry of each individual in the data set? In that case you would want to include the calendar year as a (time-dependent) covariate, with 2005 as baseline. Preferably, you would include it as a factor to allow for a non-linear effect in time, but also including it as numeric should tell you something. You can do that with survSplit() in R.

I think they do something similar in the paper you refer to:

The models were adjusted for several time varying covariates, including categorical age per year, previous number of treatment switches, and previous number of suicide attempts.

However, I would not expect it to bias the hazard ratio, because you use a different time-scale ("time since change of treatment status"), which means that you assume that the clock resets every time the treatment changes. Therefore, when an individual dies, all that it matters is, by your assumption, the time since the individual is in that state (treatment 1 or 0). I do not have a proof for this, it is more of a hunch at this point. Perhaps I'll come back later with a more expanded answer.

  • $\begingroup$ Thank you for your answer. I've been thinking about the possibility to adjust for calendar year myself. I don't think the authors of the paper I linked did that. But if there is no bias, then perhaps there is no need to adjust for calendar year. I look forward for an expanded answer. $\endgroup$
    – JonB
    May 30, 2016 at 17:55
  • $\begingroup$ They adjusted for components of the history. For example, categorial age per year is to account for age, which is pretty similar to accounting for calendar year (depends on what might have an effect) $\endgroup$
    – Theodor
    May 31, 2016 at 5:13

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.