Skip to content

Commit d7ec731

Browse files
committed
Merge commit '33a0fc9'
* commit '33a0fc9': fix typos and adjust wording in hw3, knit html with slidify
2 parents 65c2f63 + 33a0fc9 commit d7ec731

File tree

7 files changed

+59
-67
lines changed

7 files changed

+59
-67
lines changed

06_StatisticalInference/homework/hw1.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ <h2>About these slides</h2>
6363
<article data-timings="">
6464

6565
<div class="quiz quiz-single well ">
66-
<p>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?</p>
66+
<p>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 10% while that the mother contracted the disease is 9%. What is the probability that both contracted influenza expressed as a whole number percentage?</p>
6767

6868
<ol>
6969
<li>15%</li>
70-
<li>6%</li>
71-
<li>5%</li>
72-
<li><em>2%</em></li>
70+
<li>10%</li>
71+
<li>9%</li>
72+
<li><em>4%</em></li>
7373
</ol>
7474

7575
<button class="quiz-submit btn btn-primary">Submit</button>
@@ -78,18 +78,18 @@ <h2>About these slides</h2>
7878
<button class="quiz-clear btn btn-danger">Clear</button>
7979

8080
<div class="quiz-hint">
81-
<p>\(A = Father\), \(P(A) = .06\), \(B = Mother\), \(P(B) = .05\)
81+
<p>\(A = Father\), \(P(A) = .10\), \(B = Mother\), \(P(B) = .09\)
8282
\(P(A\cup B) = .15\), </p>
8383

8484
</div>
8585
<div class="quiz-explanation">
86-
<p>\(P(A\cup B) = P(A) + P(B) - 2 P(AB)\) thus
87-
\[.15 = .06 + .05 - 2 P(AB)\]</p>
86+
<p>\(P(A\cup B) = P(A) + P(B) - P(AB)\) thus
87+
\[.15 = .10 + .09 - P(AB)\]</p>
8888

89-
<pre><code class="r">(0.15 - .06 - .05) / 2
89+
<pre><code class="r">.10 + .09 - .15
9090
</code></pre>
9191

92-
<pre><code>[1] 0.02
92+
<pre><code>[1] 0.04
9393
</code></pre>
9494

9595
</div>
@@ -107,7 +107,7 @@ <h2>About these slides</h2>
107107
<ol>
108108
<li>1.00</li>
109109
<li>0.75</li>
110-
<li>0.50</li>
110+
<li><em>0.50</em></li>
111111
<li>0.25</li>
112112
</ol>
113113

06_StatisticalInference/homework/hw1.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ Creating Data Products
2525

2626
--- &radio
2727

28-
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?
28+
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 10% while that the mother contracted the disease is 9%. What is the probability that both contracted influenza expressed as a whole number percentage?
2929

3030
1. 15%
31-
2. 6%
32-
3. 5%
33-
4. _2%_
31+
2. 10%
32+
3. 9%
33+
4. _4%_
3434

3535
*** .hint
36-
$A = Father$, $P(A) = .06$, $B = Mother$, $P(B) = .05$
36+
$A = Father$, $P(A) = .10$, $B = Mother$, $P(B) = .09$
3737
$P(A\cup B) = .15$,
3838

3939
*** .explanation
40-
$P(A\cup B) = P(A) + P(B) - 2 P(AB)$ thus
41-
$$.15 = .06 + .05 - 2 P(AB)$$
40+
$P(A\cup B) = P(A) + P(B) - P(AB)$ thus
41+
$$.15 = .10 + .09 - P(AB)$$
4242

4343
```r
44-
(0.15 - .06 - .05) / 2
44+
.10 + .09 - .15
4545
```
4646

4747
```
48-
[1] 0.02
48+
[1] 0.04
4949
```
5050

5151

@@ -55,7 +55,7 @@ A random variable, $X$, is uniform, a box from $0$ to $1$ of height $1$. (So tha
5555

5656
1. 1.00
5757
2. 0.75
58-
3. 0.50
58+
3. _0.50_
5959
4. 0.25
6060

6161
*** .hint

06_StatisticalInference/homework/hw2.html

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@ <h2>About these slides</h2>
4848
</hgroup>
4949
<article data-timings="">
5050
<ul>
51-
<li>These are some practice problems for Statistical Inference Quiz 1</li>
51+
<li>These are some practice problems for Statistical Inference Quiz 2</li>
5252
<li>They were created using slidify interactive which you will learn in
5353
Creating Data Products</li>
5454
<li>Please help improve this with pull requests here
55-
(<a href="https://github.com/bcaffo/courses">https://github.com/bcaffo/courses</a>)
56-
runif(1)</li>
55+
(<a href="https://github.com/bcaffo/courses">https://github.com/bcaffo/courses</a>)</li>
5756
</ul>
5857

5958
</article>
@@ -288,12 +287,12 @@ <h2>About these slides</h2>
288287

289288
</div>
290289
<div class="quiz-explanation">
291-
<p><span class="answer">89.1</span></p>
290+
<p><span class="answer">10.9</span></p>
292291

293-
<pre><code class="r">round(pbinom(4, prob = .5, size = 6, lower.tail = TRUE) * 100, 1)
292+
<pre><code class="r">round(pbinom(4, prob = .5, size = 6, lower.tail = FALSE) * 100, 1)
294293
</code></pre>
295294

296-
<pre><code>[1] 89.1
295+
<pre><code>[1] 10.9
297296
</code></pre>
298297

299298
</div>
@@ -388,9 +387,9 @@ <h2>About these slides</h2>
388387

389388
</div>
390389
<div class="quiz-explanation">
391-
<p>The answer will be <span class="answer">0</span>
392-
since the variance of the sampling distribution of the mean is \(\sigma^2/12\)
393-
and the variance of a die roll is </p>
390+
<p>The answer will be <span class="answer">0.292</span>
391+
since the variance of the sampling distribution of the mean is \(\sigma^2/10\)
392+
where \(\sigma^2\) is the variance of a single die roll, which is </p>
394393

395394
<pre><code class="r">mean((1 : 6 - 3.5)^2)
396395
</code></pre>

06_StatisticalInference/homework/hw2.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ mode : selfcontained # {standalone, draft}
1616

1717

1818
## About these slides
19-
- These are some practice problems for Statistical Inference Quiz 1
19+
- These are some practice problems for Statistical Inference Quiz 2
2020
- They were created using slidify interactive which you will learn in
2121
Creating Data Products
2222
- Please help improve this with pull requests here
2323
(https://github.com/bcaffo/courses)
24-
runif(1)
2524

2625
--- &radio
2726
The probability that a manuscript gets accepted to a journal is 12% (say). However,
@@ -182,15 +181,15 @@ Let $p=.5$ and $X$ be binomial
182181

183182
*** .explanation
184183

185-
<span class="answer">89.1</span>
184+
<span class="answer">10.9</span>
186185

187186

188187
```r
189-
round(pbinom(4, prob = .5, size = 6, lower.tail = TRUE) * 100, 1)
188+
round(pbinom(4, prob = .5, size = 6, lower.tail = FALSE) * 100, 1)
190189
```
191190

192191
```
193-
[1] 89.1
192+
[1] 10.9
194193
```
195194

196195

@@ -247,9 +246,9 @@ If you roll ten standard dice, take their average, then repeat this process over
247246
$$Var(\bar X) = \sigma^2 /n$$
248247

249248
*** .explanation
250-
The answer will be <span class="answer">0</span>
251-
since the variance of the sampling distribution of the mean is $\sigma^2/12$
252-
and the variance of a die roll is
249+
The answer will be <span class="answer">0.292</span>
250+
since the variance of the sampling distribution of the mean is $\sigma^2/10$
251+
where $\sigma^2$ is the variance of a single die roll, which is
253252

254253

255254
```r

06_StatisticalInference/homework/hw3.Rmd

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ students t confidence interval touch zero?
7070
The t interval is $\bar x t_{.95, 8}\pm s /sqrt{n}$
7171

7272
*** .explanation
73-
<span class="answer">`r round(qt(.95, df = 3) * 1 / 3, 2)`</span>
73+
<span class="answer">`r round(qt(.95, df = 8) * 1 / 3, 2)`</span>
7474

7575
We want $\bar x = t_{.95} s / sqrt{n}$
7676
```{r}
77-
round(qt(.95, df = 3) * 1 / 3, 2)
77+
round(qt(.95, df = 8) * 1 / 3, 2)
7878
```
7979

8080

@@ -83,15 +83,15 @@ An independent group Student's T interval is used over
8383
a paired T interval when:
8484

8585
1. The observations are paired between the groups.
86-
2. _The observations within the groups are natually assumed to be statistically independent_
86+
2. _The observations between the groups are natually assumed to be statistically independent_
8787
3. As long as you do it correctly, either is fine.
8888
4. More details are needed to answer this question
8989

9090
*** .hint
9191
A paired interval is for paired observations.
9292

9393
*** .explanation
94-
If the groups are independent is the correct interval.
94+
We can't pair them if the groups are independent of each other as well as independent within themselves.
9595

9696

9797
--- &multitext
@@ -132,7 +132,7 @@ C'mon. You don't need a hint
132132

133133
*** .explanation
134134
This is just an example of what happens to confidence intervals as you
135-
increas the confidence level. You want to be quite sure in your interval (i.e.
135+
increase the confidence level. You want to be quite sure in your interval (i.e.
136136
have a large confidence level) and so you would increase the interval's width
137137

138138
--- &radio
@@ -153,9 +153,9 @@ make sure the results make sense in the context of the problem.
153153
The interval was conducted subtracting 4 - 6 and was entirely above zero.
154154

155155
--- &multitext
156-
Suppose that 18 obese subjects were randomized, 9 each, to a new diet pill and a placebo. Subjects' body mass indices (BMIs) were measured at a baseline and again after having received the treatment or placebo for four weeks. The average difference from follow-up to the baseline (followup - baseline) was ???3 kg/m2 for the treated group and 1 kg/m2 for the placebo group. The corresponding standard deviations of the differences was 1.5 kg/m2 for the treatment group and 1.8 kg/m2 for the placebo group. Does the change in BMI over the four week period appear to differ between the treated and placebo groups?
156+
Suppose that 18 obese subjects were randomized, 9 each, to a new diet pill and a placebo. Subjects' body mass indices (BMIs) were measured at a baseline and again after having received the treatment or placebo for four weeks. The average difference from follow-up to the baseline (followup - baseline) was 3 kg/m2 for the treated group and 1 kg/m2 for the placebo group. The corresponding standard deviations of the differences was 1.5 kg/m2 for the treatment group and 1.8 kg/m2 for the placebo group. The study aims to answer whether the change in BMI over the four week period appear to differ between the treated and placebo groups.
157157

158-
1. Calculate the pooled variance estimate to 2 decimal places
158+
What is the pooled variance estimate? (to 2 decimal places)
159159

160160

161161
*** .hint
@@ -164,7 +164,6 @@ individual variances
164164

165165

166166
*** .explanation
167-
<span class="answer">`r round(min(confint), 1)`</span>
168167
```{r}
169168
n1 <- n2 <- 9
170169
x1 <- -3 ##treated

06_StatisticalInference/homework/hw3.html

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,14 @@ <h2>About these slides</h2>
122122

123123
</div>
124124
<div class="quiz-explanation">
125-
<p><span class="answer">0.78</span></p>
125+
<p><span class="answer">0.62</span></p>
126126

127127
<p>We want \(\bar x = t_{.95} s / sqrt{n}\)</p>
128128

129-
<pre><code class="r">round(qt(.95, df = 3) * 1 / 3, 2)
129+
<pre><code class="r">round(qt(.95, df = 8) * 1 / 3, 2)
130130
</code></pre>
131131

132-
<pre><code>[1] 0.78
132+
<pre><code>[1] 0.62
133133
</code></pre>
134134

135135
</div>
@@ -147,7 +147,7 @@ <h2>About these slides</h2>
147147

148148
<ol>
149149
<li>The observations are paired between the groups.</li>
150-
<li><em>The observations within the groups are natually assumed to be statistically independent</em></li>
150+
<li><em>The observations between the groups are natually assumed to be statistically independent</em></li>
151151
<li>As long as you do it correctly, either is fine.</li>
152152
<li>More details are needed to answer this question</li>
153153
</ol>
@@ -162,7 +162,7 @@ <h2>About these slides</h2>
162162

163163
</div>
164164
<div class="quiz-explanation">
165-
<p>If the groups are independent is the correct interval.</p>
165+
<p>We can&#39;t pair them if the groups are independent of each other as well as independent within themselves.</p>
166166

167167
</div>
168168
</div>
@@ -233,7 +233,7 @@ <h2>About these slides</h2>
233233
</div>
234234
<div class="quiz-explanation">
235235
<p>This is just an example of what happens to confidence intervals as you
236-
increas the confidence level. You want to be quite sure in your interval (i.e.
236+
increase the confidence level. You want to be quite sure in your interval (i.e.
237237
have a large confidence level) and so you would increase the interval&#39;s width</p>
238238

239239
</div>
@@ -279,11 +279,9 @@ <h2>About these slides</h2>
279279
<article data-timings="">
280280

281281
<div class="quiz-text quiz-multitext well">
282-
<p>Suppose that 18 obese subjects were randomized, 9 each, to a new diet pill and a placebo. Subjects&#39; body mass indices (BMIs) were measured at a baseline and again after having received the treatment or placebo for four weeks. The average difference from follow-up to the baseline (followup - baseline) was ???3 kg/m2 for the treated group and 1 kg/m2 for the placebo group. The corresponding standard deviations of the differences was 1.5 kg/m2 for the treatment group and 1.8 kg/m2 for the placebo group. Does the change in BMI over the four week period appear to differ between the treated and placebo groups? </p>
282+
<p>Suppose that 18 obese subjects were randomized, 9 each, to a new diet pill and a placebo. Subjects&#39; body mass indices (BMIs) were measured at a baseline and again after having received the treatment or placebo for four weeks. The average difference from follow-up to the baseline (followup - baseline) was 3 kg/m2 for the treated group and 1 kg/m2 for the placebo group. The corresponding standard deviations of the differences was 1.5 kg/m2 for the treatment group and 1.8 kg/m2 for the placebo group. The study aims to answer whether the change in BMI over the four week period appear to differ between the treated and placebo groups. </p>
283283

284-
<ol>
285-
<li>Calculate the pooled variance estimate to 2 decimal places</li>
286-
</ol>
284+
<p>What is the pooled variance estimate? (to 2 decimal places)</p>
287285

288286
<button class="quiz-submit btn btn-primary">Submit</button>
289287
<button class="quiz-toggle-hint btn btn-info">Show Hint</button>
@@ -296,9 +294,7 @@ <h2>About these slides</h2>
296294

297295
</div>
298296
<div class="quiz-explanation">
299-
<p><span class="answer">3.2</span></p>
300-
301-
<pre><code class="r">n1 &lt;- n2 &lt;- 9
297+
<pre><code class="r">n1 &lt;- n2 &lt;- 9
302298
x1 &lt;- -3 ##treated
303299
x2 &lt;- 1 ##placebo
304300
s1 &lt;- 1.5 ##treated

06_StatisticalInference/homework/hw3.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ students t confidence interval touch zero?
6464
The t interval is $\bar x t_{.95, 8}\pm s /sqrt{n}$
6565

6666
*** .explanation
67-
<span class="answer">0.78</span>
67+
<span class="answer">0.62</span>
6868

6969
We want $\bar x = t_{.95} s / sqrt{n}$
7070

7171
```r
72-
round(qt(.95, df = 3) * 1 / 3, 2)
72+
round(qt(.95, df = 8) * 1 / 3, 2)
7373
```
7474

7575
```
76-
[1] 0.78
76+
[1] 0.62
7777
```
7878

7979

@@ -83,15 +83,15 @@ An independent group Student's T interval is used over
8383
a paired T interval when:
8484

8585
1. The observations are paired between the groups.
86-
2. _The observations within the groups are natually assumed to be statistically independent_
86+
2. _The observations between the groups are natually assumed to be statistically independent_
8787
3. As long as you do it correctly, either is fine.
8888
4. More details are needed to answer this question
8989

9090
*** .hint
9191
A paired interval is for paired observations.
9292

9393
*** .explanation
94-
If the groups are independent is the correct interval.
94+
We can't pair them if the groups are independent of each other as well as independent within themselves.
9595

9696

9797
--- &multitext
@@ -134,7 +134,7 @@ C'mon. You don't need a hint
134134

135135
*** .explanation
136136
This is just an example of what happens to confidence intervals as you
137-
increas the confidence level. You want to be quite sure in your interval (i.e.
137+
increase the confidence level. You want to be quite sure in your interval (i.e.
138138
have a large confidence level) and so you would increase the interval's width
139139

140140
--- &radio
@@ -155,9 +155,9 @@ make sure the results make sense in the context of the problem.
155155
The interval was conducted subtracting 4 - 6 and was entirely above zero.
156156

157157
--- &multitext
158-
Suppose that 18 obese subjects were randomized, 9 each, to a new diet pill and a placebo. Subjects' body mass indices (BMIs) were measured at a baseline and again after having received the treatment or placebo for four weeks. The average difference from follow-up to the baseline (followup - baseline) was ???3 kg/m2 for the treated group and 1 kg/m2 for the placebo group. The corresponding standard deviations of the differences was 1.5 kg/m2 for the treatment group and 1.8 kg/m2 for the placebo group. Does the change in BMI over the four week period appear to differ between the treated and placebo groups?
158+
Suppose that 18 obese subjects were randomized, 9 each, to a new diet pill and a placebo. Subjects' body mass indices (BMIs) were measured at a baseline and again after having received the treatment or placebo for four weeks. The average difference from follow-up to the baseline (followup - baseline) was 3 kg/m2 for the treated group and 1 kg/m2 for the placebo group. The corresponding standard deviations of the differences was 1.5 kg/m2 for the treatment group and 1.8 kg/m2 for the placebo group. The study aims to answer whether the change in BMI over the four week period appear to differ between the treated and placebo groups.
159159

160-
1. Calculate the pooled variance estimate to 2 decimal places
160+
What is the pooled variance estimate? (to 2 decimal places)
161161

162162

163163
*** .hint
@@ -166,7 +166,6 @@ individual variances
166166

167167

168168
*** .explanation
169-
<span class="answer">3.2</span>
170169

171170
```r
172171
n1 <- n2 <- 9

0 commit comments

Comments
 (0)