Menu

More in statistics

Bayesian survival models

You can fit parametric survival models in Stata using streg. You can fit multilevel parametric survival models using mestreg. You can now fit Bayesian parametric survival models by simply typing bayes: in front of streg and mestreg!

Parametric survival models

Consider a dataset in which we model the time until hip fracture as a function of age and whether the patient wears a hip-protective device (variable protect). Let's fit a Bayesian Weibull model to these data and compare the results with the classical analysis.

First, we declare our survival data.

Parametric survival models

Then, we fit a Weibull survival model using streg:

Parametric survival models

 

Finally, to fit a Bayesian survival model, we simply prefix the abovestreg command with bayes:

Parametric survival models

Because the default priors used are noninformative for these data, the above results are similar to those obtained from streg. Instead of the default priors, you can specify your own; see Custom priors.

The hazard ratios are reported by default, but you can use the nohr option with bayes, during estimation or on replay, to report coefficients. Alternatively, you can specify this option with streg during estimation.

Parametric survival models

Unlikestreg, bayes: streg reports only the log of the shape parameter. We can use the bayesstats summary command [BAYES]bayesstats summary) to obtain the estimates of the shape parameter and its reciprocal.

Parametric survival models

More new features in statistics

Zero inflated ordered probit

Add your own power and sample size methods

Bayesian sample selection models

Even more!

Post your comment

Timberlake Consultants