Panel-data survival models
- Random effects and random coefficients
- Exponential, loglogistic, Weibull, lognormal, and gamma survival models
- Proportional-hazards metric
- Accelerated failure-time metric
- Single- and multiple-record survival-time data
Stata fits survival models. In survival models relevant here, survival time is modeled using a parametric distribution, and right-censoring is allowed.
Stata fits panel-data models. In panel-data models relevant here, the data occur in groups of observations that share something in common that is modeled as unobserved random effects.
In Stata 14, we put the two models together.
We model the time to infection after catheter insertion. We have multiple observations on each patient.
xtstreg is fully integrated with Stata's xt and st features, so first, we must stset our survival data,
. stset time, failure(infect)
and we must xtset our panel data (same data),
. xtset patient
We fit a panel-data Weibull survival model of time to next infection on age and female. We type
. xtstreg age female, distribution(weibull)
The results look just as if streg had reported them, but with the addition of panel-data features and an estimated /sigma2_u, which is the estimated variance of the random effect.
We could fit a similar model using streg with shared frailties, but streg assumes the frailties follow a gamma distribution. xtstreg makes the often more plausible assumption that random effects are normally distributed, meaning frailties are lognormal.
Stata can also fit survival models with both random intercepts and random coefficients.Upgrade now Order Stata
Read even more about panel-data survival models.