I have an observational dataset with only treated observations with different ages, but treated at different times for 7 years. Each treatment had different durations; from 2 days to 160 days. The outcome variable is continuous measured at the same point in time for all observations after 7 years elapsed from the time of the 1$^{st}$ treatment. The cofounders were time invariant.

I would like to measure the causal impact of the treatment on my dependent variable. In particular, treatments occurring at an early age, affected the outcome more so than for older subjects.

The Generalized Propensity Score (gspsore in Stata) with the focus on dose-response function is not interesting for me given that I don't care about the impact of the treatment duration, but rather about the early versus late time of treatment administration.

I have tried to consider the early treatments as "treated" and late treatments as "control" groups and run a normal PSM (psmatch2 in Stata), but this definition is blurry given that in the end all subjects were treated.

What will be the most suitable method of testing for differences?

  • $\begingroup$ Look into Marginal Structural Models (MSMs). I think they do exactly what you want. When you've figured out how to use them, check out the CBPS package, which has methods of estimating them. I can't help you any further, though. $\endgroup$
    – Noah
    Dec 1, 2016 at 0:50
  • $\begingroup$ Thank you very much for your answers. The Marginal Structural Models require time changing covariates which I unfortunately don't have. As for the Hirano & Imbens (2004), Imai and van Dyk (2004) they explore the dose-response function, which analyses the intensity of the treatment which is not my interest in this study. I will explore Kennedy et al. (2016). Thank you once again $\endgroup$
    – Joramo
    Dec 8, 2016 at 12:10

2 Answers 2


You are probably interested in accelerated failure time models. These will, unlike Cox models, account for the interaction between fixed effects and time-at-risk in the study.

The Cox model does not work because it models the hazard: A hazard is an instantaneous risk of failure. If most people die after receiving the treatment, the Cox model has no power to detect an effect. You cannot model time at-risk as an exposure or outcome because it is continuously varying, as you allude to earlier. One crude way of overcoming this is by binning time into equal intervals and entering each participant in a staggered entry with a time-varying covariate that increments at each subsequent duration of study interval. The idea of calculating the limit with a finer and finer stratification of time ultimately leads to AFTs.

The AFT models are a generalization of the Cox models. A "negative" (<1) risk ratio for treatment initiation indicates that earlier treatment tends to be associated with better health outcomes. However, adjustment for confounding becomes quite complicated. You allude to propensity models, so using a propensity matched dataset alleviates this problem somewhat by balancing the design in the distribution of confounders. You can read more about AFT-models on wikipedia here.

A more rigorous resource is Kalbfleisch JD, Prentice RL (2002). "The Statistical Analysis of Failure Time Data". John Wiley & Sons. Also consider LJ Wei (1992) "The accelerated failure time model: A useful alternative to the cox regression model in survival analysis" https://doi.org/10.1002/sim.4780111409


As I understand, you are having a continuous treatment. If that is the case, you may find the following references on continuous treatment helpful: Hirano & Imbens (2004), Imai and van Dyk (2004), and Kennedy et al. (2016).


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.