I am working on longitudinal data and currently trying to test the potential preventive effect of a class of antihypertensive drugs on the evolution of cognitive performances over time.

Patients were followed 7 times (each 6 months) and data regarding drug consumption, many covariates as well as cognition were collected at each time (visit).

I initially thought to do a linear mixed model with the antihypertensive class at baseline and the cognition at each time as the outcome and adjust on different confounders.

However, many patients changed of antihypertensive drugs over time. Thus, only considering the class at baseline is not a very good method.

  1. Is considering the treatment as a time varying covariate a good idea?
  2. Would you recommend other kind of models ? I heard about functional data analysis but I do not know at all how to implement it?
  3. I would like to use propensity score matching but the fact that I am working on panel data strongly complicates the situation and I do not know how to use propensity scores in panel data?

I am using STATA 15.

Someome to help me a little bit to start with this problem?

  • $\begingroup$ Mixing the effects of different drugs will be hard to take into account, if they all potentially slow disease progression during intake (and it's even worse if they have such effects that last after intake). It's notoriously hard to appropriately model disease progression and how drugs modify it and it's incredibly easy to falsely introduce 'treatment effects' that are artifacts. $\endgroup$
    – Björn
    Commented Mar 15, 2018 at 17:59
  • $\begingroup$ Thank you Björn for your message. Yes I know that it is not perfect at all but there is litterature investigating the effect of a given class of treatment independently of this other classes. But my problem is (1) to consider changes over time in drug consumption and (2) use propensity scores in mixed models with repeated data over time. I think I will create a new variable "non user of the therapeutic class" vs "intermittent use" vs "continuous use" so I will avoid the problem of drug consumption changes over time. The main problem I have is to integrate my propensity scores in mixed models.. $\endgroup$ Commented Mar 15, 2018 at 18:21
  • $\begingroup$ Is there not a problem of using the future to predict the past? I thought the standard solution for this type of problem with treatments changing over time (in symptomatic treatments) was structural equation models - I'm just not sure how one would marry that up with treatments that might affect disease progression. $\endgroup$
    – Björn
    Commented Mar 15, 2018 at 21:39

1 Answer 1


The method you want to use is inverse probability weighting for marginal structural models. See Robins, Hernan, & Brumback (2000) or Thoemmes & Ong (2016) for an introduction to the method.

Basically, at each time point, units can be assigned to any treatment. You want to mimic a sequentially randomized control trial (i.e., where each unit is randomly assigned to a treatment at each time point). With a sequential RCT, you could find the causal effect of any one pattern of drug assignments (e.g., drug at all time points vs. no drug at all time points, or drug at all time points. vs. drug at only the first few time points, etc.). You can also build a model that relates outcome to the number of time points where the drug was received, or the to the timing of drug receipt, etc.

In your situation, you might not have a sequential RCT; there may be confounding at each time point. What you need to do is generate weights that, when applied to your sample, mimic a sequential RCT, in that sense that at each time point, all covariates are balanced between the control and treated units. Then, a weighted analysis will give you an unbiased estimate of the causal effect of interest (assuming you have balanced all the relevant covariates at each time point).

The way you estimate the weights is the following: at each time point, model the probability of being treated based on all previously measured covariates (including previous treatments and intermediate outcomes). At time 1, your model will include baseline covariates. At time 2, your model will include baseline covariates, the time 1 treatment status, and any variables that may have changed values between time 1 and time 2 (e.g., a measure of disease progression after time 1 but before the next treatment was given). From each of these models, generate predicted probabilities (i.e., propensity scores), and the generate IPW weights by taking the inverse of the propensity score for treated units and the inverse of 1 minus the propensity score for control units. Then, for each unit, multiply all of their weights together. These are the weights that will balance your groups at each time point. Finally, do a weighted regression of your outcome on all the treatment variables using these weights. You can then interpret the parameters of the regression as causal (assuming assumptions are met).

  • 1
    $\begingroup$ Noah's method sounds very reasonable to me. Is there a reference for this method or an application using it? Thank you, Orna. $\endgroup$
    – orint
    Commented Sep 4, 2018 at 1:22

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.