---
title: 'Stat 439: Homework 1'
subtitle: 'Due Thur 1/27/22 by 5pm in D2L'
output:
  pdf_document: default
  html_document: default
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
```
## Instructions

You are strongly encouraged to use R Markdown to complete your Homework assignments, starting with this file as a template. Your homework submission in D2L should be a single pdf file.

## Part I: Setup

1. If you haven't already, download and install R and RStudio. See my [Statistical Computing](https://staceyhancock.github.io/computing/) page for download instructions and additional resources.
2. Make at least one post in our D2L Discussion boards. If you don't have any questions to post, post something that may be of interest to the class, or just write a note introducing yourself!
3. Create a folder titled STAT408 on the computer you plan to use for this course to store files, data sets and code from this class. (Also consider a system that will back up your files online --- such as Microsoft One Drive, dropbox, or Google drive.)
4. Answer the following questions to help me get to know you and better tailor the course to your background and goals:
    a. When do you anticipate graduating?
    b. What do you hope to do after graduating from MSU?
    c. Which statistics courses (at MSU or elsewhere) have you taken?
    d. Why are you taking this class?
    e. What do you hope to get out of this class?
    f. On a scale of 1 to 5, where 1 = very poor and 5 = very strong, rate your ability in R.
    g. On a scale of 1 to 5, where 1 = no enjoyment and 5 = very enjoyable, rate your enjoyment of coding in R.
    h. On a scale of 1 to 5, where 1 = very poor and 5 = very strong, rate your ability of creating and publishing R Markdown files.
    
## Part II: Book Exercises

Agresti Exercises 1.3, 1.4, 1.6

## Part III

### 1.
For each of the following scenarios, (i) define the random variable in words, (ii) identify whether the random variable is binomial, negative binomial, or multinomial, and (iii) specify its parameters (either as a numerical value or as a description).

a. A board game includes a spinner that has half of the circle shaded blue, 1/3 shaded red, and 1/6 shaded yellow. A player spins the spinner 10 times and counts how many times the spinner landed on blue, how many times it landed on red, and how many times it landed on yellow.
b. A board game includes a spinner that has half of the circle shaded blue, 1/3 shaded red, and 1/6 shaded yellow. A player continues to spin the spinner until the spinner lands on yellow.
c. A [Gallup news article](https://news.gallup.com/poll/276929/fewer-continue-vaccines-important.aspx) states that, "a recent Gallup survey finds 84% of Americans saying it is extremely or very important that parents vaccinate their children." Hint: Find the sample size in the "Survey Methods" box at the bottom of the article. 

### 2.
In a test for extrasensory perception (ESP), the participant repeatedly guesses the suit of a card randomly sampled with replacement from an ordinary deck of cards. There are four suits, all equally likely. The participant guesses 100 times, and $X =$ number of correct guesses.

a. Explain why $X$ is a binomial random variable, and specify $n$ and $\pi$, assuming that the participant is just guessing.
b. Find the mean and standard deviation for $X$ _if the participant is just guessing_.
c. Suppose that the participant guesses correctly 33 times.
Find the approximate probability of guessing this well or
better by chance. 
d. Suppose that the participant guesses correctly 50 times.
Find the approximate probability of guessing this well or
better by chance. In that circumstance, would you be
convinced that the participant was doing something
other than just guessing? Explain.
e. Again, suppose that the participant guesses correctly 50 times. Calculate an approximate 95\% confidence interval for the
true probability the participant guesses correctly. Does this
interval support your conclusion in part (d)? Explain.
