diff --git a/06_StatisticalInference/homework/.nojekyll b/06_StatisticalInference/homework/.nojekyll
new file mode 100644
index 000000000..e69de29bb
diff --git a/06_StatisticalInference/homework/hw1.Rmd b/06_StatisticalInference/homework/hw1.Rmd
new file mode 100644
index 000000000..7f31c63a0
--- /dev/null
+++ b/06_StatisticalInference/homework/hw1.Rmd
@@ -0,0 +1,187 @@
+---
+title : Homework 1 for Stat Inference
+subtitle : Extra problems for Stat Inference
+author : Brian Caffo
+job : Johns Hopkins Bloomberg School of Public Health
+framework : io2012
+highlighter : highlight.js
+hitheme : tomorrow
+#url:
+# lib: ../../librariesNew #Remove new if using old slidify
+# assets: ../../assets
+widgets : [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
+library(knitr)
+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)
+```
+
+## About these slides
+- These are some practice problems for Statistical Inference Quiz 1
+- They were created using slidify interactive which you will learn in
+Creating Data Products
+- Please help improve this with pull requests here
+(https://github.com/bcaffo/courses)
+
+
+--- &radio
+
+Consider influenza epidemics for two parent heterosexual families. Suppose that the probability is 15% that at least one of the parents has contracted the disease. The probability that the father has contracted influenza is 6% while that the mother contracted the disease is 5%. What is the probability that both contracted influenza expressed as a whole number percentage?
+
+1. 15%
+2. 6%
+3. 5%
+4. _2%_
+
+*** .hint
+$A = Father$, $P(A) = .06$, $B = Mother$, $P(B) = .05$
+$P(A\cup B) = .15$,
+
+*** .explanation
+$P(A\cup B) = P(A) + P(B) - 2 P(AB)$ thus
+$$.15 = .06 + .05 - 2 P(AB)$$
+```{r}
+(0.15 - .06 - .05) / 2
+```
+
+--- &radio
+
+A random variable, $X$, is uniform, a box from $0$ to $1$ of height $1$. (So that it's density is $f(x) = 1$ for $0\leq x \leq 1$.) What is it's median expressed to two decimal places?
+
+1. 1.00
+2. 0.75
+3. _0.50_
+4. 0.25
+
+*** .hint
+The median is the point so that 50% of the density lies below it.
+
+*** .explanation
+This density looks like a box. So, notice that $P(X \leq x) = width\times height = x$.
+We want $.5 = P(X\leq x) = x$.
+
+--- &radio
+
+You are playing a game with a friend where you flip a coin and if it comes up heads you give her $X$ dollars and if it comes up tails she gives you $Y$ dollars. The odds that the coin is heads in $d$. What is your expected earnings?
+
+1. _$-X \frac{d}{1 + d} + Y \frac{1}{1+d} $_
+2. $X \frac{d}{1 + d} + Y \frac{1}{1+d} $
+3. $X \frac{d}{1 + d} - Y \frac{1}{1+d} $
+4. $-X \frac{d}{1 + d} - Y \frac{1}{1+d} $
+
+*** .hint
+The probability that you win on a given round is given by $p / (1 - p) = d$ which implies
+that $p = d / (1 + d)$.
+
+*** .explanation
+You lose $X$ with probability $p = d/(1 +d)$ and you win $Y$ with probability $1-p = 1/(1 + d)$. So your answer is
+$$
+-X \frac{d}{1 + d} + Y \frac{1}{1+d}
+$$
+
+--- &radio
+A random variable takes the value -4 with probabability .2 and 1 with proabability .8. What
+is the variance of this random variable?
+
+1. 0
+2. _4_
+3. 8
+4. 16
+
+*** .hint
+This random variable has mean 0. The variance would be given by $E[X^2]$ then.
+
+*** .explanation
+$$E[X] = 0$$
+$$
+Var(X) = E[X^2] = (-4)^2 * .2 + (1)^2 * .8
+$$
+```{r}
+-4 * .2 + 1 * .8
+(-4)^2 * .2 + (1)^2 * .8
+```
+
+
+--- &radio
+If $\bar X$ and $\bar Y$ are comprised of $n$ iid random variables arising from distributions
+having means $\mu_x$ and $\mu_y$, respectively and common variance $\sigma^2$
+what is the variance $\bar X - \bar Y$?
+
+1. 0
+2. _$2\sigma^2/n$_
+3. $\mu_x$ - $\mu_y$
+4. $2\sigma^2$
+
+*** .hint
+Remember that $Var(\bar X) = Var(\bar Y) = \sigma^2 / n$.
+
+*** .explanation
+$$
+Var(\bar X - \bar Y) = Var(\bar X) + Var(\bar Y) = \sigma^2 / n + \sigma^2 / n
+$$
+
+--- &radio
+Let $X$ be a random variable having standard deviation $\sigma$. What can
+be said about $X /\sigma$?
+
+1. Nothing
+2. _It must have variance 1._
+3. It must have mean 0.
+4. It must have variance 0.
+
+*** .hint
+$Var(aX) = a^2 Var(X)$
+
+*** .explanation
+$$Var(X / \sigma) = Var(X) / \sigma^2 = 1$$
+
+
+--- &radio
+If a continuous density that never touches the horizontal axis is symmetric about zero, can we say that its associated median is zero?
+
+1. _Yes_
+2. No.
+3. It can not be determined given the information given.
+
+*** .explanation
+This is a surprisingly hard problem. The easy explanation is that 50% of the probability
+is below 0 and 50% is above so yes. However, it is predicated on the density not being
+a flat line at 0 around 0. That's why the caveat that it never touches the horizontal axis
+is important.
+
+
+--- &radio
+
+Consider the following pmf given in R
+```{r}
+p <- c(.1, .2, .3, .4)
+x <- 2 : 5
+```
+What is the variance expressed to 1 decimal place?
+
+1. _1.0_
+2. 4.0
+3. 6.0
+4. 17.0
+
+*** .hint
+The variance is $E[X^2] - E[X^2]$
+
+*** .explanation
+```{r}
+sum(x ^ 2 * p) - sum(x * p) ^ 2
+```
diff --git a/06_StatisticalInference/homework/hw1.html b/06_StatisticalInference/homework/hw1.html
new file mode 100644
index 000000000..e2e14b4a6
--- /dev/null
+++ b/06_StatisticalInference/homework/hw1.html
@@ -0,0 +1,450 @@
+
+
+
+ Homework 1 for Stat Inference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Homework 1 for Stat Inference
+
Extra problems for Stat Inference
+
Brian Caffo Johns Hopkins Bloomberg School of Public Health
+
+
+
+
+
+
+
+
+
About these slides
+
+
+
+
These are some practice problems for Statistical Inference Quiz 1
+
They were created using slidify interactive which you will learn in
+Creating Data Products
Consider influenza epidemics for two parent heterosexual families. Suppose that the probability is 15% that at least one of the parents has contracted the disease. The probability that the father has contracted influenza is 6% while that the mother contracted the disease is 5%. What is the probability that both contracted influenza expressed as a whole number percentage?
A random variable, \(X\), is uniform, a box from \(0\) to \(1\) of height \(1\). (So that it's density is \(f(x) = 1\) for \(0\leq x \leq 1\).) What is it's median expressed to two decimal places?
+
+
+
1.00
+
0.75
+
0.50
+
0.25
+
+
+
+
+
+
+
+
+
The median is the point so that 50% of the density lies below it.
+
+
+
+
This density looks like a box. So, notice that \(P(X \leq x) = width\times height = x\).
+We want \(.5 = P(X\leq x) = x\).
+
+
+
+
+
+
+
+
+
+
+
+
You are playing a game with a friend where you flip a coin and if it comes up heads you give her \(X\) dollars and if it comes up tails she gives you \(Y\) dollars. The odds that the coin is heads in \(d\). What is your expected earnings?
+
+
+
$-X \frac{d}{1 + d} + Y \frac{1}{1+d} $
+
$X \frac{d}{1 + d} + Y \frac{1}{1+d} $
+
$X \frac{d}{1 + d} - Y \frac{1}{1+d} $
+
$-X \frac{d}{1 + d} - Y \frac{1}{1+d} $
+
+
+
+
+
+
+
+
+
The probability that you win on a given round is given by \(p / (1 - p) = d\) which implies
+that \(p = d / (1 + d)\).
+
+
+
+
You lose \(X\) with probability \(p = d/(1 +d)\) and you win \(Y\) with probability \(1-p = 1/(1 + d)\). So your answer is
+\[
+-X \frac{d}{1 + d} + Y \frac{1}{1+d}
+\]
+
+
+
+
+
+
+
+
+
+
+
+
A random variable takes the value -4 with probabability .2 and 1 with proabability .8. What
+is the variance of this random variable?
+
+
+
0
+
4
+
8
+
16
+
+
+
+
+
+
+
+
+
This random variable has mean 0. The variance would be given by \(E[X^2]\) then.
If \(\bar X\) and \(\bar Y\) are comprised of \(n\) iid random variables arising from distributions
+having means \(\mu_x\) and \(\mu_y\), respectively and common variance \(\sigma^2\)
+what is the variance \(\bar X - \bar Y\)?
\[
+Var(\bar X - \bar Y) = Var(\bar X) + Var(\bar Y) = \sigma^2 / n + \sigma^2 / n
+\]
+
+
+
+
+
+
+
+
+
+
+
+
Let \(X\) be a random variable having standard deviation \(\sigma\). What can
+be said about \(X /\sigma\)?
+
+
+
Nothing
+
It must have variance 1.
+
It must have mean 0.
+
It must have variance 0.
+
+
+
+
+
+
+
+
+
\(Var(aX) = a^2 Var(X)\)
+
+
+
+
\[Var(X / \sigma) = Var(X) / \sigma^2 = 1\]
+
+
+
+
+
+
+
+
+
+
+
+
If a continuous density that never touches the horizontal axis is symmetric about zero, can we say that its associated median is zero?
+
+
+
Yes
+
No.
+
It can not be determined given the information given.
+
+
+
+
+
+
+
+
+
This is a surprisingly hard problem. The easy explanation is that 50% of the probability
+is below 0 and 50% is above so yes. However, it is predicated on the density not being
+a flat line at 0 around 0. That's why the caveat that it never touches the horizontal axis
+is important.
+
+
+
+
+
+
+
+
+
+
+
+
Consider the following pmf given in R
+
+
p <- c(.1, .2, .3, .4)
+x <- 2 : 5
+
+
+
What is the variance expressed to 1 decimal place?
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/06_StatisticalInference/homework/hw1.md b/06_StatisticalInference/homework/hw1.md
new file mode 100644
index 000000000..4a7add5f0
--- /dev/null
+++ b/06_StatisticalInference/homework/hw1.md
@@ -0,0 +1,199 @@
+---
+title : Homework 1 for Stat Inference
+subtitle : Extra problems for Stat Inference
+author : Brian Caffo
+job : Johns Hopkins Bloomberg School of Public Health
+framework : io2012
+highlighter : highlight.js
+hitheme : tomorrow
+#url:
+# lib: ../../librariesNew #Remove new if using old slidify
+# assets: ../../assets
+widgets : [mathjax, quiz, bootstrap]
+mode : selfcontained # {standalone, draft}
+---
+
+
+
+## About these slides
+- These are some practice problems for Statistical Inference Quiz 1
+- They were created using slidify interactive which you will learn in
+Creating Data Products
+- Please help improve this with pull requests here
+(https://github.com/bcaffo/courses)
+
+
+--- &radio
+
+Consider influenza epidemics for two parent heterosexual families. Suppose that the probability is 15% that at least one of the parents has contracted the disease. The probability that the father has contracted influenza is 6% while that the mother contracted the disease is 5%. What is the probability that both contracted influenza expressed as a whole number percentage?
+
+1. 15%
+2. 6%
+3. 5%
+4. _2%_
+
+*** .hint
+$A = Father$, $P(A) = .06$, $B = Mother$, $P(B) = .05$
+$P(A\cup B) = .15$,
+
+*** .explanation
+$P(A\cup B) = P(A) + P(B) - 2 P(AB)$ thus
+$$.15 = .06 + .05 - 2 P(AB)$$
+
+```r
+(0.15 - .06 - .05) / 2
+```
+
+```
+[1] 0.02
+```
+
+
+--- &radio
+
+A random variable, $X$, is uniform, a box from $0$ to $1$ of height $1$. (So that it's density is $f(x) = 1$ for $0\leq x \leq 1$.) What is it's median expressed to two decimal places?
+
+1. 1.00
+2. 0.75
+3. 0.50
+4. 0.25
+
+*** .hint
+The median is the point so that 50% of the density lies below it.
+
+*** .explanation
+This density looks like a box. So, notice that $P(X \leq x) = width\times height = x$.
+We want $.5 = P(X\leq x) = x$.
+
+--- &radio
+
+You are playing a game with a friend where you flip a coin and if it comes up heads you give her $X$ dollars and if it comes up tails she gives you $Y$ dollars. The odds that the coin is heads in $d$. What is your expected earnings?
+
+1. _$-X \frac{d}{1 + d} + Y \frac{1}{1+d} $_
+2. $X \frac{d}{1 + d} + Y \frac{1}{1+d} $
+3. $X \frac{d}{1 + d} - Y \frac{1}{1+d} $
+4. $-X \frac{d}{1 + d} - Y \frac{1}{1+d} $
+
+*** .hint
+The probability that you win on a given round is given by $p / (1 - p) = d$ which implies
+that $p = d / (1 + d)$.
+
+*** .explanation
+You lose $X$ with probability $p = d/(1 +d)$ and you win $Y$ with probability $1-p = 1/(1 + d)$. So your answer is
+$$
+-X \frac{d}{1 + d} + Y \frac{1}{1+d}
+$$
+
+--- &radio
+A random variable takes the value -4 with probabability .2 and 1 with proabability .8. What
+is the variance of this random variable?
+
+1. 0
+2. _4_
+3. 8
+4. 16
+
+*** .hint
+This random variable has mean 0. The variance would be given by $E[X^2]$ then.
+
+*** .explanation
+$$E[X] = 0$$
+$$
+Var(X) = E[X^2] = (-4)^2 * .2 + (1)^2 * .8
+$$
+
+```r
+-4 * .2 + 1 * .8
+```
+
+```
+[1] 0
+```
+
+```r
+(-4)^2 * .2 + (1)^2 * .8
+```
+
+```
+[1] 4
+```
+
+
+
+--- &radio
+If $\bar X$ and $\bar Y$ are comprised of $n$ iid random variables arising from distributions
+having means $\mu_x$ and $\mu_y$, respectively and common variance $\sigma^2$
+what is the variance $\bar X - \bar Y$?
+
+1. 0
+2. _$2\sigma^2/n$_
+3. $\mu_x$ - $\mu_y$
+4. $2\sigma^2$
+
+*** .hint
+Remember that $Var(\bar X) = Var(\bar Y) = \sigma^2 / n$.
+
+*** .explanation
+$$
+Var(\bar X - \bar Y) = Var(\bar X) + Var(\bar Y) = \sigma^2 / n + \sigma^2 / n
+$$
+
+--- &radio
+Let $X$ be a random variable having standard deviation $\sigma$. What can
+be said about $X /\sigma$?
+
+1. Nothing
+2. _It must have variance 1._
+3. It must have mean 0.
+4. It must have variance 0.
+
+*** .hint
+$Var(aX) = a^2 Var(X)$
+
+*** .explanation
+$$Var(X / \sigma) = Var(X) / \sigma^2 = 1$$
+
+
+--- &radio
+If a continuous density that never touches the horizontal axis is symmetric about zero, can we say that its associated median is zero?
+
+1. _Yes_
+2. No.
+3. It can not be determined given the information given.
+
+*** .explanation
+This is a surprisingly hard problem. The easy explanation is that 50% of the probability
+is below 0 and 50% is above so yes. However, it is predicated on the density not being
+a flat line at 0 around 0. That's why the caveat that it never touches the horizontal axis
+is important.
+
+
+--- &radio
+
+Consider the following pmf given in R
+
+```r
+p <- c(.1, .2, .3, .4)
+x <- 2 : 5
+```
+
+What is the variance expressed to 1 decimal place?
+
+1. _1.0_
+2. 4.0
+3. 6.0
+4. 17.0
+
+*** .hint
+The variance is $E[X^2] - E[X^2]$
+
+*** .explanation
+
+```r
+sum(x ^ 2 * p) - sum(x * p) ^ 2
+```
+
+```
+[1] 1
+```
+
diff --git a/06_StatisticalInference/homework/hw2.Rmd b/06_StatisticalInference/homework/hw2.Rmd
new file mode 100644
index 000000000..3a568425c
--- /dev/null
+++ b/06_StatisticalInference/homework/hw2.Rmd
@@ -0,0 +1,238 @@
+---
+title : Homework 2 for Stat Inference
+subtitle : Extra problems for Stat Inference
+author : Brian Caffo
+job : Johns Hopkins Bloomberg School of Public Health
+framework : io2012
+highlighter : highlight.js
+hitheme : tomorrow
+#url:
+# lib: ../../librariesNew #Remove new if using old slidify
+# assets: ../../assets
+widgets : [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
+library(knitr)
+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)
+```
+
+## About these slides
+- These are some practice problems for Statistical Inference Quiz 2
+- They were created using slidify interactive which you will learn in
+Creating Data Products
+- Please help improve this with pull requests here
+(https://github.com/bcaffo/courses)
+
+--- &radio
+The probability that a manuscript gets accepted to a journal is 12% (say). However,
+given that a revision is asked for, the probability that it gets accepted
+is 90%. Is it possible that the probability that a manuscript has a revision
+asked for is 20%?
+
+1. Yeah, that's totally possible.
+2. _No, it's not possible._
+3. It's not possible to answer this question.
+
+*** .hint
+$A = accepted$, $B = revision$. $P(A) = .12$, $P(A | B) = .90$. $P(B) = .20$
+
+*** .explanation
+$P(A \cap B) = P(A | B) * P(B) = .9 \times .2 = .18$ this is larger than
+$P(A) = .12$, which is not possible since $A \cap B \subset A$.
+
+
+--- &radio
+Suppose that the number of web hits to a particular site are approximately normally
+distributed with a mean of 100 hits per day and a standard deviation of 10 hits per day. What's the probability that a given day has fewer than 93 hits per day
+expressed as a percentage to the nearest percentage point?
+
+1. 76%
+2. _24%_
+3. 47%
+4. 94%
+
+*** .hint
+Let $X$ be the number of hits per day. We want $P(X \leq 93)$ given that
+$X$ is $N(100, 10^2)$.
+
+*** .explanation
+```{r}
+round(pnorm(93, mean = 100, sd = 10) * 100)
+```
+
+
+--- &radio
+Suppose 5% of housing projects have issues with asbestos. The sensitivity of a test
+for asbestos is 93% and the specificity is 88%. What is the probability that a
+housing project has no asbestos given a negative test expressed as a percentage
+to the nearest percentage point?
+
+1. 0%
+2. 5%
+3. 10%
+4. 20%
+5. 50%
+6. _100%_
+
+*** .hint
+$A = asbestos$, $T_+ = tests positive$, $T_- = tests negative$.
+$P(T_+ | A) = .93$, $P(T_- | A^c) = .88$, $P(A) = .05$.
+
+*** .explanation
+We want
+$$
+P(A^c | T_-) = \frac{P(T_- | A^c) P(A^c)}{P(T_- | A^c) P(A^c) + P(T_- | A) P(A)}
+$$
+```{r}
+(.88 * .95) / (.88 * .95 + .07 * .05)
+```
+
+
+
+--- &multitext
+Suppose that the number of web hits to a particular site are approximately normally
+distributed with a mean of 100 hits per day and a standard deviation of 10 hits per day.
+
+1. What number of web hits per day represents the number so that only
+5% of days have more hits? Express your answer to 3 decimal places.
+
+
+
+*** .hint
+Let $X$ be the number of hits per day. We want $P(X \leq 93)$ given that
+$X$ is $N(100, 10^2)$.
+
+*** .explanation
+`r round(qnorm(.95, mean = 100, sd = 10), 3)`
+```{r}
+round(qnorm(.95, mean = 100, sd = 10), 3)
+round(qnorm(.05, mean = 100, sd = 10, lower.tail = FALSE), 3)
+```
+
+
+--- &multitext
+Suppose that the number of web hits to a particular site are approximately normally
+distributed with a mean of 100 hits per day and a standard deviation of 10 hits per day. Imagine taking a random sample of 50 days.
+
+1. What number of web hits would
+be the point so that only 5% of averages of 50 days of web traffic have more hits?
+Express your answer to 3 decimal places.
+
+*** .hint
+Let $\bar X$ be the average number of hits per day for 50 randomly sampled days.
+$X$ is $N(100, 10^2 / 50)$.
+
+*** .explanation
+`r round(qnorm(.95, mean = 100, sd = 10 / sqrt(50) ), 3)`
+
+```{r}
+round(qnorm(.95, mean = 100, sd = 10 / sqrt(50) ), 3)
+round(qnorm(.05, mean = 100, sd = 10 / sqrt(50), lower.tail = FALSE), 3)
+```
+
+--- &multitext
+
+You don't believe that your friend can discern good wine from cheap. Assuming
+that you're right, in a blind test where you randomize 6 paired varieties (Merlot,
+Chianti, ...) of cheap and expensive wines
+
+1. what is the change that she gets 5 or 6 right expressed as a percentage
+to one decimal place?
+
+*** .hint
+Let $p=.5$ and $X$ be binomial
+
+*** .explanation
+
+`r round(pbinom(4, prob = .5, size = 6, lower.tail = TRUE) * 100, 1)`
+
+```{r}
+round(pbinom(4, prob = .5, size = 6, lower.tail = TRUE) * 100, 1)
+```
+
+--- &multitext
+
+Consider a uniform distribution. If we were to sample 100 draws from a
+a uniform distribution (which has mean 0.5, and variance 1/12) and take their
+mean, $\bar X$
+
+1. what is the approximate probability of getting as large as 0.51 or larger expressed to 3 decimal places?
+
+*** .hint
+Use the central limit theorem that says $\bar X \sim N(\mu, \sigma^2/n)$
+
+*** .explanation
+
+ `r round(pnorm(.51, mean = 0.5, sd = sqrt(1 / 12 / 100), lower.tail = FALSE), 3)`
+
+```{r}
+round(pnorm(.51, mean = 0.5, sd = sqrt(1 / 12 / 100), lower.tail = FALSE), 3)
+```
+
+
+--- &multitext
+
+If you roll ten standard dice, take their average, then repeat this process over and over and construct a histogram,
+
+1. what would it be centered at?
+
+
+*** .hint
+$E[X_i] = E[\bar X]$ where $\bar X = \frac{1}{n}\sum_{i=1}^n X_i$
+
+*** .explanation
+
+
+The answer will be 3.5 since the mean of the
+sampling distribution of iid draws will be the population mean that the
+individual draws were taken from.
+
+--- &multitext
+
+If you roll ten standard dice, take their average, then repeat this process over and over and construct a histogram,
+
+1. what would be its variance expressed to 3 decimal places?
+
+*** .hint
+$$Var(\bar X) = \sigma^2 /n$$
+
+*** .explanation
+The answer will be `r round( mean(1 : 6 - 3.5) ^2 / 100, 3)`
+since the variance of the sampling distribution of the mean is $\sigma^2/12$
+and the variance of a die roll is
+
+```{r}
+mean((1 : 6 - 3.5)^2)
+```
+
+--- &multitext
+The number of web hits to a site is Poisson with mean 16.5 per day.
+
+1. What is the probability of getting 20 or fewer in 2 days expressed
+as a percentage to one decimal place?
+
+*** .hint
+Let $X$ be the number of hits in 2 days then $X \sim Poisson(2\lambda)$
+
+*** .explanation
+`r round(ppois(20, lambda = 16.5 * 2) * 100, 1)`
+
+```{r}
+round(ppois(20, lambda = 16.5 * 2) * 100, 1)
+```
+
+
+
diff --git a/06_StatisticalInference/homework/hw2.html b/06_StatisticalInference/homework/hw2.html
new file mode 100644
index 000000000..5bab28043
--- /dev/null
+++ b/06_StatisticalInference/homework/hw2.html
@@ -0,0 +1,552 @@
+
+
+
+ Homework 2 for Stat Inference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Homework 2 for Stat Inference
+
Extra problems for Stat Inference
+
Brian Caffo Johns Hopkins Bloomberg School of Public Health
+
+
+
+
+
+
+
+
+
About these slides
+
+
+
+
These are some practice problems for Statistical Inference Quiz 1
+
They were created using slidify interactive which you will learn in
+Creating Data Products
The probability that a manuscript gets accepted to a journal is 12% (say). However,
+given that a revision is asked for, the probability that it gets accepted
+is 90%. Is it possible that the probability that a manuscript has a revision
+asked for is 20%?
\(P(A \cap B) = P(A | B) * P(B) = .9 \times .2 = .18\) this is larger than
+\(P(A) = .12\), which is not possible since \(A \cap B \subset A\).
+
+
+
+
+
+
+
+
+
+
+
+
Suppose that the number of web hits to a particular site are approximately normally
+distributed with a mean of 100 hits per day and a standard deviation of 10 hits per day. What's the probability that a given day has fewer than 93 hits per day
+expressed as a percentage to the nearest percentage point?
+
+
+
76%
+
24%
+
47%
+
94%
+
+
+
+
+
+
+
+
+
Let \(X\) be the number of hits per day. We want \(P(X \leq 93)\) given that
+\(X\) is \(N(100, 10^2)\).
+
+
+
+
round(pnorm(93, mean = 100, sd = 10) * 100)
+
+
+
[1] 24
+
+
+
+
+
+
+
+
+
+
+
+
+
Suppose 5% of housing projects have issues with asbestos. The sensitivity of a test
+for asbestos is 93% and the specificity is 88%. What is the probability that a
+housing project has no asbestos given a negative test expressed as a percentage
+to the nearest percentage point?
We want
+\[
+P(A^c | T_-) = \frac{P(T_- | A^c) P(A^c)}{P(T_- | A^c) P(A^c) + P(T_- | A) P(A)}
+\]
+
+
(.88 * .95) / (.88 * .95 + .07 * .05)
+
+
+
[1] 0.9958
+
+
+
+
+
+
+
+
+
+
+
+
+
Suppose that the number of web hits to a particular site are approximately normally
+distributed with a mean of 100 hits per day and a standard deviation of 10 hits per day.
+
+
+
What number of web hits per day represents the number so that only
+5% of days have more hits? Express your answer to 3 decimal places.
+
+
+
+
+
+
+
+
+
Let \(X\) be the number of hits per day. We want \(P(X \leq 93)\) given that
+\(X\) is \(N(100, 10^2)\).
Suppose that the number of web hits to a particular site are approximately normally
+distributed with a mean of 100 hits per day and a standard deviation of 10 hits per day. Imagine taking a random sample of 50 days.
+
+
+
What number of web hits would
+be the point so that only 5% of averages of 50 days of web traffic have more hits?
+Express your answer to 3 decimal places.
+
+
+
+
+
+
+
+
+
Let \(\bar X\) be the average number of hits per day for 50 randomly sampled days.
+\(X\) is \(N(100, 10^2 / 50)\).
You don't believe that your friend can discern good wine from cheap. Assuming
+that you're right, in a blind test where you randomize 6 paired varieties (Merlot,
+Chianti, ...) of cheap and expensive wines
+
+
+
what is the change that she gets 5 or 6 right expressed as a percentage
+to one decimal place?
Consider a uniform distribution. If we were to sample 100 draws from a
+a uniform distribution (which has mean 0.5, and variance 1/12) and take their
+mean, \(\bar X\)
+
+
+
what is the approximate probability of getting as large as 0.51 or larger expressed to 3 decimal places?
+
+
+
+
+
+
+
+
+
Use the central limit theorem that says \(\bar X \sim N(\mu, \sigma^2/n)\)
If you roll ten standard dice, take their average, then repeat this process over and over and construct a histogram,
+
+
+
what would it be centered at?
+
+
+
+
+
+
+
+
+
\(E[X_i] = E[\bar X]\) where \(\bar X = \frac{1}{n}\sum_{i=1}^n X_i\)
+
+
+
+
The answer will be 3.5 since the mean of the
+sampling distribution of iid draws will be the population mean that the
+individual draws were taken from.
+
+
+
+
+
+
+
+
+
+
+
+
If you roll ten standard dice, take their average, then repeat this process over and over and construct a histogram,
+
+
+
what would be its variance expressed to 3 decimal places?
+
+
+
+
+
+
+
+
+
\[Var(\bar X) = \sigma^2 /n\]
+
+
+
+
The answer will be 0
+since the variance of the sampling distribution of the mean is \(\sigma^2/12\)
+and the variance of a die roll is
+
+
mean((1 : 6 - 3.5)^2)
+
+
+
[1] 2.917
+
+
+
+
+
+
+
+
+
+
+
+
+
The number of web hits to a site is Poisson with mean 16.5 per day.
+
+
+
What is the probability of getting 20 or fewer in 2 days expressed
+as a percentage to one decimal place?
+
+
+
+
+
+
+
+
+
Let \(X\) be the number of hits in 2 days then \(X \sim Poisson(2\lambda)\)