---
title: "Lab 8"
author: "Name here"
output: html_document
---

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
```{r setup, include=FALSE}
library(dplyr)
```

```{r}
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
```

### 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?
