how to estimate multi-state frailty models with comxe and coxph? I aim at estimating a competing risks / multistate model with frailties with the coxme R-package and the survival package. I think that this is possible to do in the surivial package with the coxph function:
# competing risks model
survival::coxph(Surv(time, type) ~ X + frailty(ID), id = ID, data = data)  
# where type is a factor consisting of target states

# multistate model
survival::coxph(Surv(StartTime, EndTime, toState) ~ X, data = data, id = ID, state = fromState) 


However, for the multistate model, it is not possible to add the frailty(ID) part of the formula. Why?
And: How would I go about to model competing risks and multistate models with the coxme package? The surivial package documentation (p. 48) suggests that the coxme package superseds the method of adding a frailty(ID) to the coxph term. Hence, it would be better to model frailties with the coxme package. But there is no documentation for the coxme package for modeling competing risks or multi-state models.
 A: I cannot give you a definitive answer, but I faced a very similar problem with a multistate model.
Likewise, I could not make frailty(ID) work properly with coxph. The model took an enormous amount of time to run. It might be a technical problem, as suggested in the 2015 paper you cite: "Only for ordinary survival models frailties can be fitted using standard software" (p.690).
Also, cluster(ID) becomes redundant if there is a univocal ID per transition (models with and without it shuold return the same estimates).
Conversely, coxme runs very smoothly. I think you can simply use the coxme package on an appropriately structured dataset (as you would with coxph). I found this guided example quite informative to begin with. coxme is also used in this paper to estimate a multistate model with frailty.
A: I don't have experience with frailty models, so I can't speak to why a frailty term seems to be incompatible with a multi-state model.
If you are primarily interested in accounting for intra-individual correlations and aren't wedded to the particulars of frailty modeling, however, then you can accomplish something similar with a cluster(id) term instead. With the cluster approach, the initial analysis is done without regard to the id values, but error estimates take the within-individual correlations into account. The idea is that a frailty term is like using a mixed model, while a cluster term is like using a generalized estimating equation.
