You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 06_StatisticalInference/homework/hw4.Rmd
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -38,12 +38,14 @@ Creating Data Products
38
38
39
39
40
40
--- &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
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)?
47
49
48
50
*** .hint
49
51
This is the inversion of a one sided hypothesis test. It yields confidence
@@ -55,10 +57,12 @@ We want to solve
55
57
$$
56
58
\frac{\sqrt{n}(\bar{X} - \mu_0)}{s} = Z_{0.05}
57
59
$$
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.
59
61
60
62
```{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)
62
66
mu0 <- mn - z * s / sqrt(nrow(mtcars))
63
67
```
64
68
Note, it's easy to get tripped up in this problem on signs. If you get a value
Copy file name to clipboardExpand all lines: 06_StatisticalInference/homework/hw4.html
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -63,13 +63,15 @@ <h2>About these slides</h2>
63
63
<articledata-timings="">
64
64
65
65
<divclass="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
<li>what is the smallest value of \(\mu_0\) that you would reject for (to two decimal places)?</li>
74
+
<liclass = ''>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>
Copy file name to clipboardExpand all lines: 06_StatisticalInference/homework/hw4.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,12 +24,14 @@ Creating Data Products
24
24
25
25
26
26
--- &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
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)?
33
35
34
36
*** .hint
35
37
This is the inversion of a one sided hypothesis test. It yields confidence
@@ -41,11 +43,13 @@ We want to solve
41
43
$$
42
44
\frac{\sqrt{n}(\bar{X} - \mu_0)}{s} = Z_{0.05}
43
45
$$
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.
0 commit comments