Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

12 Bayesian Approaches to Testing a Poin... > 12.4 R Code - Pg. 312

312 CH A P T E R 12: Bayesian Approaches to Testing a Point ("Null") Hypothesis There may be situations that specifically demand a dichotomous decision regarding a null value. In these situations, Bayesian null-hypothesis testing may be called for, but the alternative model and alternative prior should be carefully considered. Otherwise, the estimation approach can be both more informative and easier to implement. 12.4 R CODE 12.4.1 R Code for Figure 12.5 This code is a straightforward modification of the code from Section 10.2.2. Instead of the values being either distinct or shared across groups, the µ values are either distinct or shared across groups. In principle, the values could (or, indeed, should) simultaneously be either distinct or shared, but here the values are always distinct, merely to keep the code more readable. The only other difference from the code from Section 10.2.2 is that fictitious data are generated, whereby the groups have true biases of 0.61, 0.50, 0.49, and 0.51, respectively.