---
title: "Confidence Intervals for Population Means"
author: "Evan L. Ray"
date: "November 10, 2017"
output:
  html_document: default
---

```{r setup, include=FALSE}
require(ggplot2)
require(dplyr)
require(readr)
require(mosaic)
```


## Example 1: Roller Coaster Durations

The R chunk below reads in a data set with information about 197 roller coasters in the United States.  You may treat this as a random sample that is representative of the population of all roller coasters in the United States.

```{r}
coasters <- read_csv("https://mhc-stat140-2017.github.io/data/sdm4/Coasters_2014.csv")
coasters <- filter(coasters, !is.na(Duration))
head(coasters)
str(coasters)
nrow(coasters)
```

#### (a) Make a density plot of the distribution of ride duration for these roller coasters.

SOLUTION:

```{r}
# Your code goes here

```

#### (b) Check any conditions required to calculate a confidence interval for the population mean duration of roller coaster rides.

SOLUTION:



#### (c) Calculate a 90% confidence interval for the population mean duration of roller coaster rides.  Do this using the t.test function and again using the mean, sd, and qt functions.

SOLUTION:

```{r}
# Your code goes here

```

#### (d) Interpret your confidence interval from part (c) in context.

SOLUTION:



## Example 2: Speed of Light (From SDM4 20.27)

In 1882, Michelson measured the speed of light (usually denoted as $c$ as in the equation $E = mc^2).  His values are in units of km/sec.  He reported the results of 23 trials, with a mean of 299,756.22 km/sec and a standard deviation of 107.12.

#### (a) What do we have to assume in order to use these data to make inference about the speed of light?  Can you check these assumptions using the information stated above?

SOLUTION:



#### (b) Assuming that the conditions you listed in part (a) are met, find a 95% confidence interval for the speed of light from these statistics.

SOLUTION:

```{r}

```
