In my last posting I mentioned that in is possible to use Stata to run R packages by preparing an R script, calling R from within Stata so that R runs in the background and then reading R’s results into Stata for further processing. The big advantage of this method is that one does not need to […]

# Bayesian Analysis with Stata

## Stata and Advanced Statistical Methods

My recent postings have been on Bayesian non-parametric analysis with Dirichlet processes and they have raised a couple of questions in my mind that I should now like to discuss. Is Stata a suitable vehicle for advanced statistical analysis? and if so, Who should do the programming? Dirichlet processes (DPs) provide very flexible Bayesian priors with […]

## Gibbs Sampling with a Dirichlet Process

This is the third in a series of postings on the use of Dirichlet processes for non-parametric Bayesian analysis and their implementation in Stata. In this posting I will create a Stata program that fits a Bayesian model that incorporates a Dirichlet process prior. As my example I will model the peak expiratory flow measurements […]

## Selecting a Dirichlet Process Prior

This is a continuation my previous posting on non-parametric Bayesian analysis and this time I will try to show how a Dirichlet process can be used to create a family of distributions that provide much more flexible priors than the standard options such as the normal or gamma. Last time we saw how we can represent a distribution […]

## Non-parametric Bayesian Analysis

On the internet there is a host of sites that describe the mathematics of Dirichlet processes, but very few of them try to explain the ideas behind the algebra. Dirichlet process methods are very important for modern Bayesian analysis and raise a number of interesting programming issues when they are to be implemented in Stata, […]

## Solutions to the Exercises: Chapter 2

This is the second of my occasional postings working through the exercises given at the end of the chapters in ‘Bayesian analysis with Stata’. Chapter 2 was perhaps the most difficult chapter to write because I wanted to cover the creation of Stata programs for the calculation of the log posterior before I had introduced […]

## Monitoring Convergence in High Dimensions continued

In my last posting I introduced a program for comparing different methods of convergence assessment in multi-dimensional MCMC analyses. Essentially the program samples from an imaginary posterior that takes the form of a user specified mixture of multivariate normal distributions. Previously, I illustrated some of the problems of assessing convergence by looking at a simulated […]

## Monitoring Convergence in High Dimensions

In Chapter 5 of ‘Bayesian Analysis with Stata’ I discussed methods for monitoring the convergence of a set of MCMC simulations. Obviously it is important to demonstrate the effectiveness of different approaches to the assessment of convergence using output from real MCMC analyses, but often real problems are difficult to judge because we do not know the exact truth […]

## Recent Comments