Please make sure your final output file is a pdf document. You can submit handwritten solutions for non-programming exercises or type them using R Markdown, LaTeX or any other word processor. All programming exercises must be done in R, typed up clearly and with all code attached. Submissions should be made on gradescope: go to Assignments \(\rightarrow\) Homework 7.
Continuation of the swimming data from class. Recall the problem from class on swimming times. Download the data here: http://www2.stat.duke.edu/~pdh10/FCBS/Exercises/swim.dat. You can also create the data by manually typing it into R from the link.
The file contains data on the amount of time in seconds it takes each of 4 high school swimmers to swim 50 yards. There are 6 times for each student, taken every two weeks. That is, each swimmer has six measurements at \(W = 2, 4, 6, 8, 10, 12\) weeks. Each row corresponds to a swimmer and a higher column index indicates a later date. Assume again that the model for each swimmer is \[T_{i} = \beta_0 + \beta_1 (W_i - \bar{W}) + \epsilon_i,\] where \(T_i\) represents the swimming times and \(\epsilon_i \sim \mathcal{N}(0,\sigma^2)\).
Hoff 9.2.
You must write your own sampler for part (a). For part (b), you donโt need to write your own Gibbs sampler. Just follow our approach from class and use the packages. Be sure to compare your results to the results from part (a). You can find the data file azdiabetes.dat
mentioned in the question here: http://www2.stat.duke.edu/~pdh10/FCBS/Exercises/.
20 points.