Bayesian Statistics: An Introduction: R programs
Output from Computer programs (in R) relating to the
book
The R language is
available free. These programs should work equally well in
S-plus.
Many of them make use of the HDR routines in the file
hdr.txt.
- rocks.ans
Section 2.2 (data on age of rocks)
- chests.ans
Section 2.3
(data on chest measurements)
- fig21.ans
Section 2.7
(program to draw Figure 2.1)
- ratweight.ansSection 2.8
(data on uterine weight of rats - variance assumed known)
- ratweight_unknownvar.ans
Section 2.12
(data on uterine weight of rats - variance assumed unknown)
- wheat.ans
Section 2.13 (data on wheat with a growth hormone)
- fig31.ans
Section 3.1
(program to draw Figure 3.1)
- limericks.ans
Section 3.1 (data on limericks)
- misprints.ans
Section 3.4
(data on misprints - reference prior)
- misprints_informative.ans
Section 3.5
(data on misprints - informative prior)
- uniform.ans
Section 3.6 (data from a uniform distribution)
- firstdigit.ans
Section 3.8
(data on the first digit problem)
- accidents.ans
Section 3.9
(data illustrating the circular normal distribution)
- w.ans
Section 4.1
(data about the W aprticle)
- ratweight.ans
Section 4.3
(data on uterine weight of rats)
- pointnull.ans
Section 4.5
(point null hypotheses)
- ratdiet.ans
Section 5.1
(data about rat diet - variances assumed known)
- ratdiet_equalvars.ans
Section 5.2
(data about rat diet - variances assumed unknown but equal)
- ratdiet_unknownvars.ans
Section 5.3
(data about rat diet - variances assumed unknown)
- hay.ans
Section 5.4
(data about hay yield)
- nitrogen.ans
Section 5.5
(data about nitrogen)
- inoculum.ans
Section 5.6
(Di Raimondo's data on bacterial inoculum on mice)
- cuckoo.ans
Section 6.2
(data on cuckoo eggs)
- rain.ans
Sections 6.3 and 6.4
(data on York rainfall)
- scabindex.ans
Sections 6.5
(data on scab index for potatoes)
- fish.ans
Sections 7.3
(data on recapture of fish)
- baseball.ans
Section 8.3 and Chapter 8, Exercise 4
(baseball example)
- fig81.ans
Section 8.4
(program to draw Figure 8.1;
the same is also available in LaTeX)
- blood.ans
Sections 9.2
(hierachical normal model for blood coagulation time)
- dataaug.ans
Sections 9.2 and 9.3
(genetic linkage example on data augmentation)
- chained.ans
Section 9.4
(example on chained data augmentation due to Casella and George)
- blood.ans
Sections 9.4
(semi-conjugate prior with normal likelihood)
- coal.ans
Section 9.4
(change point analysis of coal disaster data)
- betasim.ans
Section 9.5
(simulation of beta distribution by rejection sampling)
- reject.ans
Section 9.5
(example of rejection sampling)
- bivarnorm.ans
Section 9.6
(simulation from a bivariate normal distribution)
- integral.ans
Chapter 9, Exercise 1
(crude Monte Carlo integration)
- dataaug2.ans
Chapter 9, Exercise 3
(genetic linkage example from C A B Smith)
- semicon2.ans
Chapter 9, Exercise 5
(semi-conjugate prior with normal likelihood)
- hiernor2.ans
Chapter 9, Exercise 6
(hierachical normal model)
- dataaug2.ans
Chapter 9, Exercise 8
(genetic linkage example from C A B Smith)
- chained.ans
Chapter 9, Exercise 9
- semicon2.ans
Chapter 9, Exercise 10
- rats.ans
Chapter 9, Exercise 11
(rat data)
- linkagemh.ans
Chapter 9, Exercise 12
(genetic linkage example using Metropolis-Hastings)
- logistic.ans
Chapter 9, Exercise 14
- hdr.txt
Appendix C
(R programs for HDRs and Behrens' distribution)
Auxiliary routines and data used by the program
rats.txt
Peter M. Lee
Revised 18 November 2007