# Software

**Inference for Shared-Frailty Survival Models with Left-Truncated Data**

Van den Berg, G., and B. Drepper (2016) **Econometric Reviews** (**pdf**)

Shared-frailty survival models specify that systematic unobserved determinants of duration outcomes are identical within groups of individuals. We consider random-effects likelihood-based statistical inference if the duration data are subject to left-truncation. Such inference with left-truncated data can be performed in previous versions of the Stata software package for parametric and semi-parametric shared frailty models. We show that with left-truncated data, the commands ignore the weeding-out process before the left-truncation points, affecting the distribution of unobserved determinants among group members in the data, namely among the group members who survive until their truncation points. We critically examine studies in the statistical literature on this issue as well as published empirical studies that use the commands. Simulations illustrate the size of the (asymptotic) bias and its dependence on the degree of truncation.

**Frailty survival models in Stata: A performance review with delayed entry data**

Drepper, B., and G. Van den Berg (2019) (**pdf**)

This article reviews how Stata’s frailty models take account of survival data with delayed entries (left-truncation). It is explained how the com- mands streg and stcox do not sufficiently take account of the effects of left-truncation on the frailty distribution in the observed sample when frailties are shared within groups with the option shared(). The consequences for the estimators are illustrated in an application with data on kidney patients, as well as in a simulation study. In particular, estimates of the covariate effects and the baseline hazard are biased towards zero irrespective of the sample size. This bias can be substantial even for moderate levels of left-truncation and frailty variance. Furthermore, for the commands streg, stcox and the user-written command for discrete time frailty models pgmhaz by Jenkins (1997) it is described how the correspond- ing likelihood functions can be adjusted to accurately take account of the effects of delayed entries. For the parametric shared gamma frailty model the appropriate estimator is implemented in the command stregshared that is designed as an alternative to streg, frailty(gamma) shared() for duration data subject to left-truncation.

User-written Stata command stregshared: (**stregshared_help.pdf**) (**stregshared.ado**)