Through school8.dat give weekly hours spent on homework for students sampled from eight different schools. Obtain posterior distributions for the


through school8.dat give weekly hours spent on homework for students sampled from eight different schools. Obtain posterior distributions for the true means for the eight different schools using a hierarchical normal model with the following prior parameters (cf. Section 8.4 in lecture notes): μ0 =7,γ02 =5,τ02 =10,η0 =2,σ02 =15,ν0 =2. (a) Run a Gibbs sampling algorithm to approximate the posterior distribution of {θ,σ2,μ,τ2}. Assess the convergence of the Markov chain, and find the effective sample size for {σ2,μ,τ2}. Run the chain long enough so that the effective sample sizes are all above 1,000. (b) Compute posterior means and 95% confidence regions for {σ2,μ,τ2}. Also, compare the posterior densities to the prior densities, and discuss what was learned from the data. (c) Plot the posterior density of R = τ2 , and compare it to a plot of the prior density of R. σ2+τ2 Describe the evidence for between-school variation.


Leave a Reply

Your email address will not be published.