Hi class,
Here is the script I played with today: Chapter11_jtf.r
I used the M1 model to simulate a couple of fake datasets.
Gelman and Hill spend a fair amount of space in their book discussing simulation, and they have some software to do it.
As random structures get more complicated, simulation becomes harder, but I think we can steal it from them. More on this later.
Jack