-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirst_drop.Rmd
49 lines (36 loc) · 1.79 KB
/
first_drop.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Drop Results
============
```{r include=FALSE}
# This chunk loads libraries that are needed below. include=FALSE means that neither the code nor the output of the code will be included in the output document.
library(RCurl)
library(ggplot2)
library(plyr)
```
```{r echo=FALSE}
# This chunk downloads the data from your google spreadsheet. Replace the URL below
# with the URL from your copy of the spreadsheet.
csv_data<-getURL("https://docs.google.com/spreadsheet/pub?key=0Avq8qkMnj5AOdHhJQ081OUNkVXlXMjFrYjRHNG41ekE&output=csv")
dropdata<-read.csv(textConnection(csv_data))
drops<-data.frame(flight_time=with(dropdata,rep(flight_time, count)))
```
This plot is a histogram of flight times. The "binwidth", or width of each bar is 0.1 seconds.
```{r fig.width=7, fig.height=4}
ggplot(drops,aes(flight_time))+geom_histogram(binwidth=0.1)
```
This plot shows a smoothed estimate of the distribution of flight time.
```{r fig.width=7, fig.height=4}
stdev<-sd(drops$flight_time)
avg<-mean(drops$flight_time)
ggplot(drops,aes(flight_time))+geom_density(fill="black")+xlim(avg-4*stdev,avg+4*stdev)
```
<!--
The formula for a 95% confidence interval around an estimated average is:
$\mu \pm 1.96 \frac{s}{\sqrt{n}}$
Where $\mu$ is a sample average, $s$ is the sample standard deviation, and $n$ is the sample size. The $s/\sqrt{n}$ part is call the [standard error of the mean](http://en.wikipedia.org/wiki/Standard_error#Standard_error_of_the_mean)
Now we can compute a confidence interval around the the average flight time.
```r
std_error<-sd(drops$flight_time)/sqrt(length(drops$flights_time))
std_error
```
In proper statistical parlance, we believe that if we conducted many trial drops like the one we just did with the same people timing the drop, 95 times out of 100, the average of the sample would be within
-->