if ( .Platform$OS.type != "windows" ) {
windows <- function( ... ) X11( ... )
}
This tip was suggested by George Kachergis. Thanks George!
See additional graphics info at this more recent blog entry.

Though risking hyperbole, I would describe this book as revolutionary, at least in the context of psychology. It is, to my knowledge, the first book of its kind in this field to provide a general introduction to exclusively Bayesian statistical methods. In addition, it does so almost entirely by way of Monte Carlo simulation methods. While reasonable minds may disagree, it is arguable that both the general Bayesian framework advocated here, and the heavy use of Monte Carlo simulations, are destined to be the future of all data analysis, whether in psychology or elsewhere. If this is so, then Doing Bayesian Data Analysis might be something of a harbinger, rousing psychology to the new realitites of data-analysis in the 21st century. ...I think the reviewer has a remarkably clear view of the intellectual landscape, of where psychology (and science generally) is going, and of where the book attempts to situate itself. Thank you, Mark, for such a perceptive review. Now may everyone else see as clearly as you!
Doing Bayesian Data Analysis introduces psychology to new ways of thinking and new ways of talking about and presenting data-analysis. Anyone serious about data analysis in psychology ought to read this book. At the very least, it will serve as a welcome new perspective on the field. More probably, or so it seems to me, the ideas and methods presented here will eventually be seen as the foundations for new approaches to statistics that will becomes commonplace in the near future.
x = rnorm( 10000 , 2.15 , 1 )
The usual plotPost would produce a histogram, like this: histinfo = plotPost( x , breaks=30 , col="skyblue" , compVal= 0 , ROPE=c(-0.1,0.1) ) But the new plotPost has a showCurve option: histinfo = plotPost( x , showCurve=T , col="skyblue" , compVal= 0 , ROPE=c(-0.1,0.1) )
Notice that the "breaks" argument was removed from the command when using showCurve=T, because "breaks" only applies to histograms. Why use one form or the other? A histogram reminds the viewer that the plot represents a sample of points, not a known mathematical function (even though there is a mathematical function underlying the sample). This was the motivation for using histograms in the book. Also, the curve uses a kernel density estimation technique that blurs the distribution, so the curve will tend to be not quite peaked enough and a little too wide in its tails. On the other hand, the curve might be easier to view and more aesthetically pleasing. Ultimately the choice is yours. Now you have the choice!I have reviewed a number of statistics texts for academic journals over the years, and have authored published reviews of some six books specifically devoted to Bayesian analysis. I consider John Kruschke's "Doing Bayesian Data Analysis" to be the best text available for learning this branch of statistics.Thank you, Joe!
Learning how to craft meaningful statistical tests and models based on Bayesian methods is not an easy task. Nor is it an easy task to write a comprehensive basic text on the subject -- one that actually guides the reader through the various Bayesian concepts and mathematical operations so that they have a solid working ability to develop their own Bayesian-based analyses.
There are now quite a few texts to choose from in this area, and some are quite good. But Kruschke's text, in my opinion, is the most useful one available. It is very well written, the concepts unique to the Bayesian approach are clearly presented, and there is an excellent instructors manual for professors who have adopted the book for their classes. Kruschke uses R and WinBUGS for showing examples of the methods he describes, and provides all of the code so that the reader can adapt the methods for their own projects.
"Doing Bayesian Data Analysis" is not just an excellent text for the classroom, but also -- and I think foremost -- it is just the text one would want to work through in order to learn how to employ Bayesian methods for oneself.
"All said and done, the criticisms I have raised here are relatively minor. This is the best introductory textbook on Bayesian MCMC techniques I have read, and the most suitable for psychology students. It fills a gap I described in my recent review of six other introductory Bayesian method texts (Smithson, 2010). I look forward to using it in my own teaching, and I recommend it to anyone wishing to introduce graduate or advanced undergraduate students to the emerging Bayesian revolution."