Skip to content

Master #154

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file modified 06_StatisticalInference/.nojekyll
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion 06_StatisticalInference/01_01_Introduction/index.Rmd
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ addressing missing data.
1. The epidemiological literature is very focused on using study design to investigate public health.
2. The classical development of study design in agriculture broadly covers design and design principles.
3. The industrial quality control literature covers design thoroughly.

Empty file modified 06_StatisticalInference/01_01_Introduction/index.html
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion 06_StatisticalInference/01_01_Introduction/index.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ addressing missing data.
1. The epidemiological literature is very focused on using study design to investigate public health.
2. The classical development of study design in agriculture broadly covers design and design principles.
3. The industrial quality control literature covers design thoroughly.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion 06_StatisticalInference/01_02_Probability/index.Rmd
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,3 @@ qbeta(0.5, 2, 1)
discussed is the **population median**.
- A probability model connects the data to the population using assumptions.
- Therefore the median we're discussing is the **estimand**, the sample median will be the **estimator**

4 changes: 2 additions & 2 deletions 06_StatisticalInference/01_02_Probability/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ <h2>Example</h2>
plot(x, y, lwd = 3, frame = FALSE, type = &quot;l&quot;)
</code></pre>

<p><img src="assets/fig/unnamed-chunk-1.png" alt="plot of chunk unnamed-chunk-1"> </p>
<p><img src="assets/fig/unnamed-chunk-1.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" style="display: block; margin: auto;" /></p>

</article>
<!-- Presenter Notes -->
Expand All @@ -322,7 +322,7 @@ <h2>Example continued</h2>
<article data-timings="">
<p>What is the probability that 75% or fewer of calls get addressed?</p>

<p><img src="assets/fig/unnamed-chunk-2.png" alt="plot of chunk unnamed-chunk-2"> </p>
<p><img src="assets/fig/unnamed-chunk-2.png" title="plot of chunk unnamed-chunk-2" alt="plot of chunk unnamed-chunk-2" style="display: block; margin: auto;" /></p>

</article>
<!-- Presenter Notes -->
Expand Down
5 changes: 2 additions & 3 deletions 06_StatisticalInference/01_02_Probability/index.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ y <- c(0, 0, 2, 0, 0)
plot(x, y, lwd = 3, frame = FALSE, type = "l")
```

![plot of chunk unnamed-chunk-1](assets/fig/unnamed-chunk-1.png)
<img src="assets/fig/unnamed-chunk-1.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" style="display: block; margin: auto;" />


---
Expand All @@ -200,7 +200,7 @@ plot(x, y, lwd = 3, frame = FALSE, type = "l")

What is the probability that 75% or fewer of calls get addressed?

![plot of chunk unnamed-chunk-2](assets/fig/unnamed-chunk-2.png)
<img src="assets/fig/unnamed-chunk-2.png" title="plot of chunk unnamed-chunk-2" alt="plot of chunk unnamed-chunk-2" style="display: block; margin: auto;" />


---
Expand Down Expand Up @@ -308,4 +308,3 @@ qbeta(0.5, 2, 1)
discussed is the **population median**.
- A probability model connects the data to the population using assumptions.
- Therefore the median we're discussing is the **estimand**, the sample median will be the **estimator**

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified 06_StatisticalInference/01_03_Expectations/figure/galton.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified 06_StatisticalInference/01_03_Expectations/figure/lsm.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified 06_StatisticalInference/01_03_Expectations/index.Rmd
100644 → 100755
Empty file.
9 changes: 6 additions & 3 deletions 06_StatisticalInference/01_03_Expectations/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ <h2>Example</h2>
<article data-timings="">
<h3>Find the center of mass of the bars</h3>

<p><img src="assets/fig/unnamed-chunk-1.png" alt="plot of chunk unnamed-chunk-1"> </p>
<pre><code>## Loading required package: MASS
</code></pre>

<p><img src="assets/fig/unnamed-chunk-1.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" style="display: block; margin: auto;" /></p>

</article>
<!-- Presenter Notes -->
Expand Down Expand Up @@ -105,7 +108,7 @@ <h2>The center of mass is the empirical mean</h2>
lines(rep(meanChild, 100), seq(0, 150, length = 100), col = &quot;red&quot;, lwd = 5)
</code></pre>

<p><img src="assets/fig/lsm.png" alt="plot of chunk lsm"> </p>
<p><img src="assets/fig/lsm.png" title="plot of chunk lsm" alt="plot of chunk lsm" style="display: block; margin: auto;" /></p>

</article>
<!-- Presenter Notes -->
Expand All @@ -125,7 +128,7 @@ <h2>Example</h2>
<li>Note, if thought about geometrically, this answer is obvious; if two equal weights are spaced at 0 and 1, the center of mass will be \(.5\)</li>
</ul>

<p><img src="assets/fig/unnamed-chunk-2.png" alt="plot of chunk unnamed-chunk-2"> </p>
<p><img src="assets/fig/unnamed-chunk-2.png" title="plot of chunk unnamed-chunk-2" alt="plot of chunk unnamed-chunk-2" style="display: block; margin: auto;" /></p>

</article>
<!-- Presenter Notes -->
Expand Down
11 changes: 8 additions & 3 deletions 06_StatisticalInference/01_03_Expectations/index.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ mode : selfcontained # {standalone, draft}

## Example
### Find the center of mass of the bars
![plot of chunk unnamed-chunk-1](assets/fig/unnamed-chunk-1.png)

```
## Loading required package: MASS
```

<img src="assets/fig/unnamed-chunk-1.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" style="display: block; margin: auto;" />


---
Expand All @@ -53,7 +58,7 @@ meanChild <- mean(galton$child)
lines(rep(meanChild, 100), seq(0, 150, length = 100), col = "red", lwd = 5)
```

![plot of chunk lsm](assets/fig/lsm.png)
<img src="assets/fig/lsm.png" title="plot of chunk lsm" alt="plot of chunk lsm" style="display: block; margin: auto;" />


---
Expand All @@ -66,7 +71,7 @@ lines(rep(meanChild, 100), seq(0, 150, length = 100), col = "red", lwd = 5)
$$
- Note, if thought about geometrically, this answer is obvious; if two equal weights are spaced at 0 and 1, the center of mass will be $.5$

![plot of chunk unnamed-chunk-2](assets/fig/unnamed-chunk-2.png)
<img src="assets/fig/unnamed-chunk-2.png" title="plot of chunk unnamed-chunk-2" alt="plot of chunk unnamed-chunk-2" style="display: block; margin: auto;" />

---

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified 06_StatisticalInference/01_04_Independence/index.Rmd
100644 → 100755
Empty file.
Empty file modified 06_StatisticalInference/01_04_Independence/index.html
100644 → 100755
Empty file.
Empty file modified 06_StatisticalInference/01_04_Independence/index.md
100644 → 100755
Empty file.
Empty file modified 06_StatisticalInference/01_05_ConditionalProbability/index.Rmd
100644 → 100755
Empty file.
Empty file modified 06_StatisticalInference/01_05_ConditionalProbability/index.html
100644 → 100755
Empty file.
Empty file modified 06_StatisticalInference/01_05_ConditionalProbability/index.md
100644 → 100755
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 2 additions & 17 deletions 06_StatisticalInference/02_01_CommonDistributions/index.Rmd
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,7 @@ url:
widgets : [mathjax] # {mathjax, quiz, bootstrap}
mode : selfcontained # {standalone, draft}
---
```{r setup, cache = F, echo = F, message = F, warning = F, tidy = F, results='hide'}
# make this an external chunk that can be included in any file
options(width = 100)
opts_chunk$set(message = F, error = F, warning = F, comment = NA, fig.align = 'center', dpi = 100, tidy = F, cache.path = '.cache/', fig.path = 'fig/')

options(xtable.type = 'html')
knit_hooks$set(inline = function(x) {
if(is.numeric(x)) {
round(x, getOption('digits'))
} else {
paste(as.character(x), collapse = ', ')
}
})
knit_hooks$set(plot = knitr:::hook_plot_html)
runif(1)
```


## The Bernoulli distribution

Expand Down Expand Up @@ -189,7 +174,7 @@ plot(pvals, dbinom(7, 8, pvals) / dbinom(7, 8, 7/8) ,
- Standard normal RVs are often labeled $Z$

---
```{r, fig.height=4.5, fig.width=4.5}
```{r, fig.height=5, fig.width=5, fig.align='center', results='hide'}
zvals <- seq(-3, 3, length = 1000)
plot(zvals, dnorm(zvals),
type = "l", lwd = 3, frame = FALSE, xlab = "z", ylab = "Density")
Expand Down
55 changes: 16 additions & 39 deletions 06_StatisticalInference/02_01_CommonDistributions/index.html
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h2>Plotting all possible likelihoods for a small n</h2>

<slide class="" id="slide-4" style="background:;">
<article data-timings="">
<div class="rimage center"><img src="fig/unnamed-chunk-1.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" class="plot" /></div>
<p><img src="assets/fig/unnamed-chunk-1.png" alt="plot of chunk unnamed-chunk-1"> </p>

</article>
<!-- Presenter Notes -->
Expand Down Expand Up @@ -215,16 +215,16 @@ <h2>Example</h2>
\]</li>
</ul>

<pre><code class="r">choose(8, 7) * .5 ^ 8 + choose(8, 8) * .5 ^ 8
<pre><code class="r">choose(8, 7) * 0.5^8 + choose(8, 8) * 0.5^8
</code></pre>

<pre><code>[1] 0.03516
<pre><code>## [1] 0.03516
</code></pre>

<pre><code class="r">pbinom(6, size = 8, prob = .5, lower.tail = FALSE)
<pre><code class="r">pbinom(6, size = 8, prob = 0.5, lower.tail = FALSE)
</code></pre>

<pre><code>[1] 0.03516
<pre><code>## [1] 0.03516
</code></pre>

</article>
Expand All @@ -233,11 +233,11 @@ <h2>Example</h2>

<slide class="" id="slide-9" style="background:;">
<article data-timings="">
<pre><code class="r">plot(pvals, dbinom(7, 8, pvals) / dbinom(7, 8, 7/8) ,
lwd = 3, frame = FALSE, type = &quot;l&quot;, xlab = &quot;p&quot;, ylab = &quot;likelihood&quot;)
<pre><code class="r">plot(pvals, dbinom(7, 8, pvals)/dbinom(7, 8, 7/8), lwd = 3, frame = FALSE, type = &quot;l&quot;,
xlab = &quot;p&quot;, ylab = &quot;likelihood&quot;)
</code></pre>

<div class="rimage center"><img src="fig/unnamed-chunk-3.png" title="plot of chunk unnamed-chunk-3" alt="plot of chunk unnamed-chunk-3" class="plot" /></div>
<p><img src="assets/fig/unnamed-chunk-3.png" alt="plot of chunk unnamed-chunk-3"> </p>

</article>
<!-- Presenter Notes -->
Expand Down Expand Up @@ -267,34 +267,11 @@ <h2>The normal distribution</h2>
<slide class="" id="slide-11" style="background:;">
<article data-timings="">
<pre><code class="r">zvals &lt;- seq(-3, 3, length = 1000)
plot(zvals, dnorm(zvals),
type = &quot;l&quot;, lwd = 3, frame = FALSE, xlab = &quot;z&quot;, ylab = &quot;Density&quot;)
sapply(-3 : 3, function(k) abline(v = k))
plot(zvals, dnorm(zvals), type = &quot;l&quot;, lwd = 3, frame = FALSE, xlab = &quot;z&quot;, ylab = &quot;Density&quot;)
sapply(-3:3, function(k) abline(v = k))
</code></pre>

<div class="rimage center"><img src="fig/unnamed-chunk-4.png" title="plot of chunk unnamed-chunk-4" alt="plot of chunk unnamed-chunk-4" class="plot" /></div>

<pre><code>[[1]]
NULL

[[2]]
NULL

[[3]]
NULL

[[4]]
NULL

[[5]]
NULL

[[6]]
NULL

[[7]]
NULL
</code></pre>
<p><img src="assets/fig/unnamed-chunk-4.png" title="plot of chunk unnamed-chunk-4" alt="plot of chunk unnamed-chunk-4" style="display: block; margin: auto;" /></p>

</article>
<!-- Presenter Notes -->
Expand Down Expand Up @@ -538,7 +515,7 @@ <h2>Example</h2>
<pre><code class="r">ppois(3, lambda = 2.5 * 4)
</code></pre>

<pre><code>[1] 0.01034
<pre><code>## [1] 0.01034
</code></pre>

</article>
Expand All @@ -554,16 +531,16 @@ <h2>Example, Poisson approximation to the binomial</h2>

<p>What&#39;s the probability of 2 or fewer successes?</p>

<pre><code class="r">pbinom(2, size = 500, prob = .01)
<pre><code class="r">pbinom(2, size = 500, prob = 0.01)
</code></pre>

<pre><code>[1] 0.1234
<pre><code>## [1] 0.1234
</code></pre>

<pre><code class="r">ppois(2, lambda=500 * .01)
<pre><code class="r">ppois(2, lambda = 500 * 0.01)
</code></pre>

<pre><code>[1] 0.1247
<pre><code>## [1] 0.1247
</code></pre>

</article>
Expand Down
57 changes: 16 additions & 41 deletions 06_StatisticalInference/02_01_CommonDistributions/index.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ mode : selfcontained # {standalone, draft}
---



## The Bernoulli distribution

- The **Bernoulli distribution** arises as the result of a binary outcome
Expand Down Expand Up @@ -55,7 +54,7 @@ title(paste("Likelihoods for n = ", n))
```

---
<div class="rimage center"><img src="fig/unnamed-chunk-1.png" title="plot of chunk unnamed-chunk-1" alt="plot of chunk unnamed-chunk-1" class="plot" /></div>
![plot of chunk unnamed-chunk-1](assets/fig/unnamed-chunk-1.png)


---
Expand Down Expand Up @@ -139,30 +138,30 @@ $$\left(
$$

```r
choose(8, 7) * .5 ^ 8 + choose(8, 8) * .5 ^ 8
choose(8, 7) * 0.5^8 + choose(8, 8) * 0.5^8
```

```
[1] 0.03516
## [1] 0.03516
```

```r
pbinom(6, size = 8, prob = .5, lower.tail = FALSE)
pbinom(6, size = 8, prob = 0.5, lower.tail = FALSE)
```

```
[1] 0.03516
## [1] 0.03516
```


---

```r
plot(pvals, dbinom(7, 8, pvals) / dbinom(7, 8, 7/8) ,
lwd = 3, frame = FALSE, type = "l", xlab = "p", ylab = "likelihood")
plot(pvals, dbinom(7, 8, pvals)/dbinom(7, 8, 7/8), lwd = 3, frame = FALSE, type = "l",
xlab = "p", ylab = "likelihood")
```

<div class="rimage center"><img src="fig/unnamed-chunk-3.png" title="plot of chunk unnamed-chunk-3" alt="plot of chunk unnamed-chunk-3" class="plot" /></div>
![plot of chunk unnamed-chunk-3](assets/fig/unnamed-chunk-3.png)


---
Expand All @@ -183,35 +182,11 @@ plot(pvals, dbinom(7, 8, pvals) / dbinom(7, 8, 7/8) ,

```r
zvals <- seq(-3, 3, length = 1000)
plot(zvals, dnorm(zvals),
type = "l", lwd = 3, frame = FALSE, xlab = "z", ylab = "Density")
sapply(-3 : 3, function(k) abline(v = k))
plot(zvals, dnorm(zvals), type = "l", lwd = 3, frame = FALSE, xlab = "z", ylab = "Density")
sapply(-3:3, function(k) abline(v = k))
```

<div class="rimage center"><img src="fig/unnamed-chunk-4.png" title="plot of chunk unnamed-chunk-4" alt="plot of chunk unnamed-chunk-4" class="plot" /></div>

```
[[1]]
NULL

[[2]]
NULL

[[3]]
NULL

[[4]]
NULL

[[5]]
NULL

[[6]]
NULL

[[7]]
NULL
```
<img src="assets/fig/unnamed-chunk-4.png" title="plot of chunk unnamed-chunk-4" alt="plot of chunk unnamed-chunk-4" style="display: block; margin: auto;" />


---
Expand Down Expand Up @@ -352,7 +327,7 @@ ppois(3, lambda = 2.5 * 4)
```

```
[1] 0.01034
## [1] 0.01034
```


Expand All @@ -365,19 +340,19 @@ What's the probability of 2 or fewer successes?


```r
pbinom(2, size = 500, prob = .01)
pbinom(2, size = 500, prob = 0.01)
```

```
[1] 0.1234
## [1] 0.1234
```

```r
ppois(2, lambda=500 * .01)
ppois(2, lambda = 500 * 0.01)
```

```
[1] 0.1247
## [1] 0.1247
```


Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading