I have data for patients that were subjected to either one treatment or multiple treatments at various points in time and I need to analyse their survival times after treatments. This of course means that some patients appears only once in the dataset (those had been subjected to only one treatment) and some several times (those had been subjected to multiple treatments). So it seems I have clustered data.
So the question is: what is the best model to use in such a setting. I briefly looked at frailty models (see: https://www.jstatsoft.org/article/view/v047i04) and it seems that this may be a way to go. However, I have some doubts as for how to deal with the fact that of course if a patient was subjected, lets say, to two different treatments, then the survival time for the one that was conducted first will be longer, no matter what. So I wonder what is the best way to address this problem?