Please use D2L to turn in both the PDF or Word output and your R Markdown file in.

Lab Exercises

Use the following script to create your data for this lab

playoff.free.throws <- tbl_df(data.frame(
  player = c('James','Curry','Irving','Durant','Wall','Leonard','Beal','Harden','Love','Horford','Aldridge','Green','Paul','Olynyk','Parker','Favors','Jordan','Oladipo'),
  position = c('F','G','G','F','G','G','G','G','F','F','F','F','G','F','G','F','F','G'),
  FTA = c(162,114,84,103,93,102,61,115,75,29,55,67,33,30,14,23,56,6),
  FTM = c(113,103,76,92,78,95,50,101,63,22,42,46,29,22,14,11,22,6)))
playoff.free.throws <- playoff.free.throws %>% arrange(position, player)
playoff.free.throws
## # A tibble: 18 x 4
##    player   position    FTA    FTM
##    <fct>    <fct>     <dbl>  <dbl>
##  1 Aldridge F         55.0   42.0 
##  2 Durant   F        103     92.0 
##  3 Favors   F         23.0   11.0 
##  4 Green    F         67.0   46.0 
##  5 Horford  F         29.0   22.0 
##  6 James    F        162    113   
##  7 Jordan   F         56.0   22.0 
##  8 Love     F         75.0   63.0 
##  9 Olynyk   F         30.0   22.0 
## 10 Beal     G         61.0   50.0 
## 11 Curry    G        114    103   
## 12 Harden   G        115    101   
## 13 Irving   G         84.0   76.0 
## 14 Leonard  G        102     95.0 
## 15 Oladipo  G          6.00   6.00
## 16 Parker   G         14.0   14.0 
## 17 Paul     G         33.0   29.0 
## 18 Wall     G         93.0   78.0

1. (5 points)

Fit independent models using a beta prior for \(\theta\) for the players Curry, Beal, and Oladipo. Describe the sampling model and priors for these models.

2. (5 points)

Compare the posterior HDI from these models with those found using the hierarchical models. Note the HPDinterval function can be applied directly to samples from a beta distribution as HPDinterval(mcmc(data = rbeta(n = 1000, shape1 = a.star, shape2 = b.star))),

3. (5 points)

Reflect on the differences/similarities in the credible intervals and the posterior mean in each situation. If you were going to bet on the players shooting percentages for the next season, which would you prefer?