I have a longitudinal medical record dataset. My cohort is made up of patients with a particular disease. There are no members of this cohort without this disease. Disease indications are denoted by a recorded date and medical code. Simply put, an individual under significant disease burden will have a greater number of disease events OR a greater number of repeated drug prescriptions compared to a patient presenting intermittently.

A particular drug will be given to patients to correct for a particular disease burden e.g., patients suffering chronic migraines will be prescribed triptans or topiramate. However, patients having infrequent migraines maybe given NSAIDs. This is clearly seen in the dataset.

Now, the issue I face: Using recurrent Cox regression (PWP-Gap time) with a drug prescription as a covariate, drugs for patients with extreme migraine burden will appear inefficient (migraine risk 1.3). Unlike, in scenarios where I have tested NSAIDs drugs and found them to be more efficient (migraine risk 0.8).

Yet, in reality, the drug for patients with extreme migraine burden are 1) only given to extreme cases, 2) are doing a good job despite how the patient might be presenting so the result of the recurrent cox regression should, in fact, be showing a reduction in migraine risk.

How can I correct for these two extremes when comparing the outcome from recurrent cox regression?


Having been told that the issue I face is "confounding by indication" I am now presented with a study design issue. A snippet from a BMJ article states:

An alternative approach would be to include only those subjects who are similar for all prognostic factors (such as a history of disease or presence of other risk factors) except treatment. https://www.bmj.com/content/315/7116/1151.full

Firstly, my entire cohort is made up of migraine patients. If I am looking at migraine treatment, then surely every individual who is similar in migraine severity to those on the drug exposure of interest, will be on that drug! This can only not be the case if the doctor the patient visits do not know how to treat the migraines.


1 Answer 1


What you are observing is "confounding by indication" and is hard to deal with, if you cannot assign treatments randomly. You essentially cannot ignore how prescription decisions are made and need to model that, too.

One approach to doing so would be propensity score methods (if prescription decision is made once at a single occasion) or structural equation models (multiple prescription occasions, which seems to be your case). The assumption that would have to be satisfied in either case is that you have the information on everything that affects both drug choice and outcomes and include it correctly (correct functional form/interactions etc.) in the model for what drug gets chosen.

  • $\begingroup$ Thank you, Björn. Having the correct set of nouns (confounding by indication) should now make the world of difference in my work. $\endgroup$ Jan 5, 2019 at 9:46
  • $\begingroup$ Further to my question, I found are interesting remark in a BMJ article and I would appreciate your thoughts. I've made an edit to my question. $\endgroup$ Jan 5, 2019 at 10:37
  • 1
    $\begingroup$ Matching as described in the article is indeed an option, but can be very difficult, if there are many factors that matter for both treatment decision and outcomes (you need to ideally match for all of those, which can be challenging). $\endgroup$
    – Björn
    Jan 5, 2019 at 11:06
  • 1
    $\begingroup$ Additionally, yes, you need to have similar patients getting and also sometimes not getting the treatment you are interested in. This happens particularly if there are multiple treatments different doctors may consider (they may have personal preferences, flip a coin, be influenced by minor irrelevant aspects etc.) or if different doctors/patients go for different treatments at different severity stages. You will not learn anything about efficacy/effectiveness of a treatment from patients that always or never get that treatment. $\endgroup$
    – Björn
    Jan 5, 2019 at 11:07
  • $\begingroup$ Thank you, you've been extremely helpful. You raised a very interesting point: "you need to have similar patients getting and also sometimes not getting the treatment you are interested in" Given that I have medical records (approx 500,000) of which may go back as far as 15 years of medical data, would it be appropriate to design my recurrent cox cohort from only those patient who has experienced the indication (headache) with exposure (migraine drug) and also without exposure (a different drug or no drug at all)? $\endgroup$ Jan 5, 2019 at 15:00

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.