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!