Solved – how to code and interpret categorical time varying variable in Cox PH model

categorical datacox-modelmodelingtime-varying-covariate

I'm working on a project looking at the relationship between exposure to several different drugs on the risk of preterm delivery in a cohort of pregnant women with a particular disease. I'm confident that I need to use a time-dependent variable in a Cox PH model for the drug exposures as women started the drugs at various points in pregnancy, and some were not exposed at all. So far, I've coded the drug variable in two ways: 1) as a categorical variable listing the drug types (they were never taken concurrently, but sometimes sequentially) with no drug exposure as the reference group, and 2) as a binomial variable for each drug with a 1 for exposed time intervals and a 0 otherwise.

My problem lies in interpreting the HRs. For the case where the variable is categorical, the HR are relative to the reference group. But for the second case, are they relative to all other exposure types (including no exposure), or are they still relative to no exposure as the presence of all of the other drug variables in the model deals with the effects of those separately? In other words, is the interpretation of the HR more or less the same between the two types of models, or is the second model different, and less interpretable?

Please forgive me if this is a basic question! I've scoured the intertubes and my reference library and can't seem to find quite this same problem addressed. If you know of a good source I should read, please do point it out. I'll say though that all of the time-dependent Cox PH resources I've found seem to deal with binary exposures…

Thanks!

Best Answer

The hazard ratios are always relative to the reference group, but you need to be careful what the definition of "reference group" is in your model.

Your second model is almost definitely the better way to interpret the data, but if the treatments are not always given in the same sequence, you may want to include an indicator like "prior exposure to treatment 1" or "prior duration of exposure to treatment 1" if there could be carry-over.

In general, there is no reason that predictors in a Cox model must be binary; there are many examples of continuous measures (e.g. drug exposure).

Related Question