Which frailty model is better for survival analysis with recurrent events and competing (teminal) risks: joint or shared? I am going to analyse data with multiple recurring events and additional terminal event.
The recurrent events are of the same kind, no hierarchy in them (like in the Prentice-Williams-Petersen).
The terminal event, the "elimination from experiment" is single and precludes all over events, it is an absorbing state.
I want to analyse it with frailty models. In most sources in the Internet I noticed the use of joint two frailties: for recurrence and competing risk. But in some places, authors mention shared frailty, which theoretically means the same frailty is spanned across all subjects and both types of frailty. I don't fully understand this.
Can anyone explain, which kind of frailty model is better here?
Also, I know, that mixed-effect models have parametric assumptions about the random effects. It should be Gaussian. In frailty models I know it should be gamma. Can I check the compliance of distribution using Lilliefors adjustment for the Kolmogorov-Smirnov? The adjustment helps when I have to estimate the model parameters from the data via MLE, which would invalidate the use of the classic K-S, where the parameters must be known rather than estimated. Or I could bootstrap the K-S? Or maybe I should use the ECDF to visually compare them?
 A: The term "shared frailty" can be confusing. The terminology is best understood in situations where there is a single type of event, with at most one occurrence for each individual. There are, however, several groups of individuals expected to have similar risks, within each group, beyond what is explained by the modeled covariates. For example, members of the same family might "share" a "frailty"; patients treated at the same hospital might "share" a "frailty."
This shared frailty is not "spanned across all subjects." The sharing is within each of multiple groups of subjects. You can think of the frailty as an unobserved covariate, but instead of modeling that covariate as a fixed effect for each group you model its distribution among groups.
If you now consider a repeated-events situation, then the "sharing" might just be  within each individual: the "sharing" then is among events within an individual. The modeling, however, is the same as the within-group sharing described above. You just think of all the events within an individual as forming a "group" for this purpose. (A "nested" frailty structure further allows for sharing both within an individual and among individuals within groups.)
The "joint" frailty terminology, as used in the frailtypack package in R, extends the shared frailty for repeated events to include a terminal event. Separate baseline hazards and covariates are possible for the repeated versus terminal events; each frailty for the terminal event is the corresponding frailty for the repeated event but raised to a power, a further coefficient estimated in the modeling. If that power coefficient estimate isn't distinguishable from 0, then there is no evidence of frailty contributing to the terminal event (beyond the modeled covariates).
Evaluating the assumption about the form of the distribution of frailties is of secondary interest at best. Remember that you're already trying to force that form onto the frailty distribution as part of the overall model-fitting process. I'd recommend reading Chapter 9 of Therneau and Grambsch on Frailty Models, which shows Gaussian and gamma frailty distributions to be alternate penalization methods in the tradeoff between ignoring individuals/groups completely and modeling them individually.
If your main interest is in evaluating the associations of covariates with events, then the question is more which type of penalization best leads to that goal. So far as I see, Therneau and Grambsch don't even address evaluating the assumed distributional form in itself. Section 9.5.1, however, shows a situation in which data simulated from a uniform distribution of frailties are modeled pretty well by a gamma frailty. So strict adherence to the assumed form is not so crucial.
