Skip to content

Commit abf411d

Browse files
committed
Reworded hw4
1 parent bd3ba1e commit abf411d

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

06_StatisticalInference/homework/hw4.Rmd

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@ Creating Data Products
3838

3939

4040
--- &multitext
41-
Load the data set `mtcars` in the `datasets` R package. You want
42-
to test whether the MPG is $\mu_0$ or smaller using a one sided
41+
Load the data set `mtcars` in the `datasets` R package. Assume that the data set mtcars is a random sample. Compute the mean MPG, $\bar x,$ of this sample.
42+
43+
You want
44+
to test whether the true MPG is $\mu_0$ or smaller using a one sided
4345
5% level test. ($H_0 : \mu = \mu_0$ versus $H_a : \mu < \mu_0$).
4446
Using that data set and a Z test:
4547

46-
1. what is the smallest value of $\mu_0$ that you would reject for (to two decimal places)?
48+
1. . Based on the mean MPG of the sample $\bar x,$ and by using a Z test: what is the smallest value of $\mu_0$ that you would reject for (to two decimal places)?
4749

4850
*** .hint
4951
This is the inversion of a one sided hypothesis test. It yields confidence
@@ -55,10 +57,12 @@ We want to solve
5557
$$
5658
\frac{\sqrt{n}(\bar{X} - \mu_0)}{s} = Z_{0.05}
5759
$$
58-
Or $$\mu_0 = \bar{X} - Z_{0.05} s / \sqrt{n} = \bar{X} + Z_{0.95} s / \sqrt{n}$$. Note that the quantile is negative.
60+
Or $$\mu_0 = \bar{X} - Z_{0.05} s / \sqrt{n} = \bar{X} + Z_{0.95} s / \sqrt{n}$$ Note that the quantile is negative.
5961

6062
```{r}
61-
mn <- mean(mtcars$mpg); s <- sd(mtcars$mpg); z <- qnorm(.05)
63+
mn <- mean(mtcars$mpg)
64+
s <- sd(mtcars$mpg)
65+
z <- qnorm(.05)
6266
mu0 <- mn - z * s / sqrt(nrow(mtcars))
6367
```
6468
Note, it's easy to get tripped up in this problem on signs. If you get a value

06_StatisticalInference/homework/hw4.html

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

6565
<div class="quiz-text quiz-multitext well">
66-
<p>Load the data set <code>mtcars</code> in the <code>datasets</code> R package. You want
67-
to test whether the MPG is \(\mu_0\) or smaller using a one sided
66+
<p>Load the data set <code>mtcars</code> in the <code>datasets</code> R package. Assume that the data set mtcars is a random sample. Compute the mean MPG, \(\bar x,\) of this sample.</p>
67+
68+
<p>You want
69+
to test whether the true MPG is \(\mu_0\) or smaller using a one sided
6870
5% level test. (\(H_0 : \mu = \mu_0\) versus \(H_a : \mu < \mu_0\)).
6971
Using that data set and a Z test:</p>
7072

7173
<ol>
72-
<li>what is the smallest value of \(\mu_0\) that you would reject for (to two decimal places)?</li>
74+
<li class = ''>Based on the mean MPG of the sample \(\bar x,\) and by using a Z test: what is the smallest value of \(\mu_0\) that you would reject for (to two decimal places)?</li>
7375
</ol>
7476

7577
<button class="quiz-submit btn btn-primary">Submit</button>
@@ -88,9 +90,11 @@ <h2>About these slides</h2>
8890
\[
8991
\frac{\sqrt{n}(\bar{X} - \mu_0)}{s} = Z_{0.05}
9092
\]
91-
Or \[\mu_0 = \bar{X} - Z_{0.05} s / \sqrt{n} = \bar{X} + Z_{0.95} s / \sqrt{n}\]. Note that the quantile is negative.</p>
93+
Or \[\mu_0 = \bar{X} - Z_{0.05} s / \sqrt{n} = \bar{X} + Z_{0.95} s / \sqrt{n}\] Note that the quantile is negative.</p>
9294

93-
<pre><code class="r">mn &lt;- mean(mtcars$mpg); s &lt;- sd(mtcars$mpg); z &lt;- qnorm(.05)
95+
<pre><code class="r">mn &lt;- mean(mtcars$mpg)
96+
s &lt;- sd(mtcars$mpg)
97+
z &lt;- qnorm(.05)
9498
mu0 &lt;- mn - z * s / sqrt(nrow(mtcars))
9599
</code></pre>
96100

06_StatisticalInference/homework/hw4.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ Creating Data Products
2424

2525

2626
--- &multitext
27-
Load the data set `mtcars` in the `datasets` R package. You want
28-
to test whether the MPG is $\mu_0$ or smaller using a one sided
27+
Load the data set `mtcars` in the `datasets` R package. Assume that the data set mtcars is a random sample. Compute the mean MPG, $\bar x,$ of this sample.
28+
29+
You want
30+
to test whether the true MPG is $\mu_0$ or smaller using a one sided
2931
5% level test. ($H_0 : \mu = \mu_0$ versus $H_a : \mu < \mu_0$).
3032
Using that data set and a Z test:
3133

32-
1. what is the smallest value of $\mu_0$ that you would reject for (to two decimal places)?
34+
1. . Based on the mean MPG of the sample $\bar x,$ and by using a Z test: what is the smallest value of $\mu_0$ that you would reject for (to two decimal places)?
3335

3436
*** .hint
3537
This is the inversion of a one sided hypothesis test. It yields confidence
@@ -41,11 +43,13 @@ We want to solve
4143
$$
4244
\frac{\sqrt{n}(\bar{X} - \mu_0)}{s} = Z_{0.05}
4345
$$
44-
Or $$\mu_0 = \bar{X} - Z_{0.05} s / \sqrt{n} = \bar{X} + Z_{0.95} s / \sqrt{n}$$. Note that the quantile is negative.
46+
Or $$\mu_0 = \bar{X} - Z_{0.05} s / \sqrt{n} = \bar{X} + Z_{0.95} s / \sqrt{n}$$ Note that the quantile is negative.
4547

4648

4749
```r
48-
mn <- mean(mtcars$mpg); s <- sd(mtcars$mpg); z <- qnorm(.05)
50+
mn <- mean(mtcars$mpg)
51+
s <- sd(mtcars$mpg)
52+
z <- qnorm(.05)
4953
mu0 <- mn - z * s / sqrt(nrow(mtcars))
5054
```
5155

0 commit comments

Comments
 (0)