WARNING: DON'T save these files by right-clicking in Explorer; instead, open the file and do "File-Save As", *OR* (better yet) open the file and copy-paste it into a .txt file to ensure proper decoding of carriage returns!!!
From within R, source the stacks_BRugs.txt file. This should call OpenBUGS 21 times (once for each data point), and ultimately obtain a plot of the two diagnostics.
This example is based on work by Dr. Haijun Ma, and follows the residual analysis portion (pp.33-38) of my intermediate Bayesian data analysis short course slides, which in turn follow Chapter 6 (pp. 204-206) of the Carlin and Louis book, Bayes and Empirical Bayes Methods for Data Analysis, published by Chapman and Hall/CRC Press.
From within R, source the Power.BRugs file. This file generates the data (which is all fake here, since this is a design problem) and the initial values as well.
This example follows the clinical trial design portion (pp.39-44) of my intermediate Bayesian data analysis short course slides, which are in turn based on a Bayesian class project paper written by Joe Koopmeiners. The "classic" reference in this area is:
This material is all located on a separate website created by Brian Hobbs, current PhD student in the Division of Biostatistics at the University of Minnesota. The work is based on Section 3 of a paper by Hobbs and Carlin, submitted to the Journal of Biopharmaceutical Statistics.
This material is also located on Brian Hobbs' website, and described in Section 4 of the Hobbs and Carlin paper.