Posts

Showing posts with the label Bayesian Statistics

Simple Bayesian Model (T-test) in R using either WinBUGs or JAGS.

Image
WinBUGs and JAGS (Just Another Gibbs Sampler) are convenient and effective tools for estimating bayesian models for your data. Both use an openBUGs style syntax, although they do have their differences (e.g. censored data, or matrix operations). Even more convenient is that there are packages that allow you to pass BUGs syntax, call the Gibbs sampler, and pull the MCMC chain(s) back all within R. For me, the choice of whether to use WinBUGS, or JAGS (or openBUGs for that matter) is more a question of what OS you are running. WinBUGs is a Windows application and JAGS runs on OSX. I've never attempted to run these on Linux, so if anyone knows, feel free to provide that in the comments. If you need to obtain WinBUGS or JAGS, click on the hyperlinks to download them. The data I'm using comes from the 2010 US Census Data. It contains the median age for men and women per "place". In census language, "place" typically refers to cities or towns. Some cleaning ...