I am trying to find some books or texts specifically on mixed effect/multilevel/hierarchical survival analysis models and having a hard time. I have found books on survival analysis, OR, on linear or GLM mixed effect/multilevel/hierarchical models. Is anyone aware of resources when one is trying to do both? Ideally the code would be in R, but at this point I'm desperate.

The particular data set I'm trying to analyze is for student retention in a college. We track the credits earned as "time", and graduation or retained as the baseline, with leaving as the "death" event. However, we track piles of data for each year a student is at the institution. So, for example a bursary or scholarship received in 4th year is hugely predictive. I wish to make a multilevel model based on the program the student is in, as they have different retention patterns (i.e. engineers stick around with lower marks for longer than other degrees) and by year the student is in, to both separate out the above mentioned year effects, and add other information such as 2nd year GPA, 3rd year GPA and so on.

Currently in a classical cox survival model, I can look at 1st year effects or general characteristics (i.e. sex, race, high school etc) but would have to fit a separate model for 2nd year, 3rd year and so on retention effects (i.e. 3rd year GPA). Currently we have many fascinating findings after studying our 1st year student retention, but need to specifics on higher year students and program without fitting about 28 different models. (4 years * 7 programs)

  • 1
    $\begingroup$ 1. Why do you need a random effect in your model? Aren't you simply dealing with a case of time-varying covariates (e.g., year, presence/absence of a scholarship, ...)? See, e.g., cran.r-project.org/web/packages/survival/vignettes/timedep.pdf for more info on how to fit such a model in R. 2. I'm wondering whether you might need to consider a mixture model to account for two populations of students: those who drop out and those who graduate. Then you could model the time till dropout given that the student will drop out. $\endgroup$ Jul 8, 2023 at 2:33
  • $\begingroup$ Thank you for the mention of the time varying covariates, as I have not looked into that in detail. So long as the model can handle subjects having diverse times (i.e. one first year student may only complete 21 credits, and another 36 credits) it could work. The mixture model approach you suggest could be interesting... We also have to account for the students that have simply enrolled and haven't dropped out or graduated yet. There is also institutional familiarity with survival models, so there are political considerations as well. $\endgroup$
    – Tytalus
    Jul 10, 2023 at 16:10

1 Answer 1


from your question, I understand that you need some references. Below I suggest some. The last book has many examples developed in R. The first goes more to theory and the one in the middle does both.

For the modelling, I will set the predicted variable as the probability of leaving the program. For this, I will run a GLMM with a binomial response and logit link function. This may simplify the problem as the outcome would be just one variable which could take two values (leave or not) and the predictors could be the program, the year (as categorical) and if received scholarship (1 or 0).


  • Stroup, W.W., 2013. Generalized Linear Mixed Models Modern Concepts, Methods and Applications. CRC press, Boca Raton.
  • Mehtätalo, L., Lappi, J., 2020. Biometry for forestry and environmental data: With examples in R. CRC press, Boca Raton.
  • Zuur, A. F., Ieno, E. N., Walker, N. J., Saveliev, A. A., & Smith, G. M. (2009). Mixed effects models and extensions in ecology with R (Vol. 574, p. 574). New York: springer.
  • $\begingroup$ On the modelling side, we have an institutional history with the survival analysis, so I'm stuck with that. Thank you for the interesting references! $\endgroup$
    – Tytalus
    Jul 10, 2023 at 16:01

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.