# Extended Cox regression time dependent variables

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?

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.