To ensure reproducibility and uniformity, please leave the random seed set to the value below:
set.seed(123456)
library(ggplot2)
library(boot) l
ibrary(MCMCpack)
Please use R.
Environmental scientists are studying air quality data collected in New York during 1973. They are particularly interested in the average ozone levels during the measurement period and want to quantify the uncertainty of their estimates using bootstrap techniques. Use the airquality dataset (data(airquality)).
1. Inspect the structure of the dataset and summarize the Ozone variable.
2. Calculate the 95% confidence interval for the mean Ozone level using the bootstrap method. Use 1000 bootstrap samples.
3. Use the boot package to calculate the 95% confidence interval for the mean Ozone level. Compare this with the confidence interval you calculated manually.