---
title: "Math 58B - HW6"
author: "your name here"
date: "due March 2, 2023"
output: pdf_document
---

```{r global_options, include=FALSE}
knitr::opts_chunk$set(message=FALSE, warning=FALSE, fig.height=2.5,
                      fig.width=5, 
                      fig.align = "center", cache=TRUE)
library(tidyverse)
library(infer)
library(mosaic)
```


### Assignment Summary (Goals)

* sampling
* errors
* p-values


#### Q1. Learning Community Q
Describe one thing you learned from someone in your learning community this week (it could be: content, logistical help, background material, R information, etc.)  1-3 sentences.

#### Q2. **Tattoos, Part I**^[https://askgoodquestions.blog/]

Suppose that you want to test the null hypothesis that one-third of all adults in your county have a tattoo, against a two-sided alternative.  For each of the following parts, create your own example of a sample of 100 people that satisfies the indicated property.  Do this by providing the sample numbers with a tattoo and without a tattoo.  Also report the test statistic and p-value from a one-proportion z-test.

   a. Use the normal distribution and the following information to calculate a p-value for the appropriate Z-score

> p-value = probability a N(0,1) (standard normal) will be more extreme than the Z score you calculate below.

   i. Create your own example of a sample of 100 people such that: the two-sided p-value is less than 0.001.
  ii. Create your own example of a sample of 100 people such that: the two-sided p-value is greater than 0.20.


  b. For each of i. and ii. above, explain whether you may have committed a Type 1 or a Type 2 error. (Hint:  you will **not** know whether or not you committed an error, but you **will** know the type of error you may have committed.)


#### Q3. **Tattoos, Part II**^[https://askgoodquestions.blog/]

Suppose that you want to estimate the proportion of all adults in your county who have a tattoo. For each of the following parts, create your own example to satisfy the indicated property.  Do this by specifying the sample size and the number of people in the sample with a tattoo.  Also determine the confidence interval.

   a. Create your own example such that the sample proportion with a tattoo is 0.30, and a 95% confidence interval for the population proportion includes the value 0.35.
   b. Create your own example such that the sample proportion with a tattoo is 0.30, and a 99% confidence interval for the population proportion does not include the value 0.35.


#### Q4. **Gettysburg Address**^[Inv 1.12, ISCAM]

Consider the activity done in class on the Gettysburg Address by Abraham Lincoln.  (Click on "Gettysburg": http://www.rossmanchance.com/applets/2021/sampling/OneSample.html?population=gettysburg)

   a. For any of the samples (e.g., your sample) taken in class, describe (in words) the:   
 - an observational unit
 - a variable
 - the statistic
 - the parameter

   b. After you click on "show sampling options," the applet shows histograms at the bottom. For each of the three histograms (i.e., provide three answers), what is the thing that is varying?

   c. Suppose that you select a sample of Claremont students by standing in front of the library and approaching 50 students who pass by.  Would this constitute a random sample of Claremont students?  What if you stand in front of the gym and approach 50 students who pass by?  Explain.

   d. Even though the convenience sampling (at the library) described above is not random, could it nevertheless result in a sample that is representative of the population of Claremont students?  Identify a variable for which you would not be willing to consider such a convenience sample (as described above) to be representative of the population of Claremont students.  Also identify a variable for which you would be willing to consider such a sample (as described above) to be representative of the population of Claremont students.
