---
output:
html_document:
css: http://www.bradthiessen.com/batlab.css
fig_height: 4
fig_width: 5.6
highlight: pygments
theme: spacelab
---
### Lab Report #3: Binomial & Sign Tests
*****
**Date:** [Enter today's date]
**Author:** [Enter name of person typing this report here]
**Lab Partner(s):** [Enter names of other students who worked on this lab.]
```{r message=FALSE, echo=FALSE}
### IMPORTANT!!!
### If this is the first time you've attempted a lab,
### you'll need to type one command in the console below.
### Copy the command: install.packages("mosaic")
### and paste it to the right of the > prompt below.
### Press return/enter and it should quickly download
### and install all the software you need to complete
### this lab.
# You can ignore the rest of this first shaded area.
# It will load this special software.
# It will not print anything in your report
library(mosaic)
# Your lab report begins below
```
1. Simulate the 10-question quiz and estimate the probability of getting a perfect score.
```{r}
#### Exercise 1a
# Replace the XX values below to create the possible answer
# choices for each quiz question
choices <- XX
#### Exercise 1b
# Replace the XX values below to simulate at least 25,000
# students answering the 10-question quiz
quiz10 <- do(XX) * sum(sample(XX, XX, replace=XX))
#### Exercise 1c
# Replace the XX values below to create a histogram
histogram(~result,
data=quiz10,
type="count",
width=1,
col="XX", border="XX", # Pick a color scheme
xlab = "XX") # Label your x-axis
#### Exercise 1d
# Replace the XX values below to estimate the probability
# of getting a perfect score on the 10-question quiz
prop(~result XX, data=quiz10)
```
2. Estimate the probability of getting a score of at least 5 on the 10-question quiz.
```{r}
#### Exercise 2
# Replace the XX values below to estimate the probability
# of getting a score of 5 or greater.
prop(~result XX, data=quiz10)
```
3. Use `dbinom()` to calculate the probability of getting a perfect score on the 10-question quiz.
```{r}
#### Exercise 3
# The code will look like dbinom(x, size, prob)
```
4. Use `pbinom()` to calculate the probability of getting a score of at least 5 on the 10-question quiz.
```{r}
#### Exercise 4
# The code will look like 1 - pbinom(x, size, prob)
```
5. Plot the probability model for your 10-question quiz.
```{r}
#### Exercise 5
# Change the XX values in the code below
plotDist('XX',
params=list(XX),
lw=XX,
main="XX")
```
6. Use `pbinom()` to calculate the likelihood of getting 15 or more correct switches out of 16 trials.
```{r}
#### Exercise 6
# Type your code below this line
```