Homework #04: Bass Mercury

due March 04 11:59 PM

Goals

Setup

Mercury in Local Bass

Mercury, is a naturally occurring element that can have toxic effects on the nervous, digestive and immune systems of humans (see WHO for more details).

In local rivers (and other bodies of water), microbes transform mercury into the highly toxic methyl mercury. Fish accumulate methyl mercury (since they are unable to excrete it) in their tissue over the course of their life.

Bass from the Waccamaw and Lumber Rivers were caught, weighed, and measured. In addition, a filet from each fish caught was sent to the lab so that the tissue concentration of mercury could be determined for each fish. Each fish caught corresponds to a single row of the data frame.

A code book is provided below (copied from here).

The data come from Craig Stowe, Nicholas School of the Environment circa 1990s

Beginning

We will work with the tidyverse and tidymodels package. Optionally, you might choose to use viridis color palettes.

library(tidyverse)
library(tidymodels)
library(viridis)
mercury_bass = read_csv("data/mercury.csv")
mercury_bass
## # A tibble: 171 × 5
##    river station length weight mercury
##    <dbl>   <dbl>  <dbl>  <dbl>   <dbl>
##  1     0       0   47     1616    1.6 
##  2     0       0   48.7   1862    1.5 
##  3     0       0   55.7   2855    1.7 
##  4     0       0   45.2   1199    0.73
##  5     0       0   44.7   1320    0.56
##  6     0       0   43.8   1225    0.51
##  7     0       0   38.5    870    0.48
##  8     0       0   45.8   1455    0.95
##  9     0       0   44     1220    1.4 
## 10     0       0   40.4   1033    0.5 
## # … with 161 more rows

Exercises

Exercise 1

The Environmental Protection Agency (EPA) recommends children and pregnant/breastfeeding women avoid eating fish with mercury ppm greater than 0.46 ppm due to adverse neuro-developmental effects that result from mercury exposure.

We are concerned that the average mercury level in local bass may be too high for this subset of the population to eat.

Let \(\mu\) be the mean mercury (ppm) found in a local bass fish. State the null and alternative hypothesis in words and mathematical notation.

Exercise 2

Next, we want to simulate data under the null hypothesis, i.e. assuming the null hypothesis is true.

Hint: the null is a statement about the true population mean of mercury ppm.

set.seed(2)

# null_dist <- mercury_bass %>%
# specify(response = ____) %>%
# hypothesize(null = "____", __ = ____) %>%
# generate(reps = __, type = "bootstrap") %>%
# calculate(stat = "____")

Exercise 3

Exercise 4

Calculate a 95% bootstrap confidence interval for the mean mercury (ppm) in North Carolina bass. Use set.seed(4).

Exercise 5

Does the average mercury content differ significantly between bass caught in Waccamaw and bass caught in Lumber river?

Let \(\mu_W\) be the mean mercury in Waccamaw bass and \(\mu_L\) be the mean mercury in Lumber bass.

Exercise 6

Construct the null distribution to exercise 5 using set.seed(6).

Exercise 7

Exercise 8

Your turn

Come up with 1 additional question you could answer with this data set via hypothesis testing.

Submission

Knit to PDF to create a PDF document. Stage and commit all remaining changes, and push your work to GitHub. Make sure all files are updated on your GitHub repo. Only upload your PDF document to Gradescope. Before you submit the uploaded document, mark where each answer is to the exercises. If any answer spans multiple pages, then mark all corresponding pages. Associate the “Overall” section with the first page.

Reminder:

Rubric