## Exercise 1

Before it closed, Ron Swanson was a frequent patron of Charles Mulligan’s Steakhouse in Indianapolis, Indiana. Ron enjoyed the experience so much, during each visit he took a picture with his steak. Ron also weighed each steak he consumed. He has a record of eating six “22 ounce” Charles Mulligan’s porterhouse steaks. Ron found that these six steaks weighed

$22.4 \text{ oz}, \ 20.8 \text{ oz}, \ 21.6 \text{ oz}, \ 20.2 \text{ oz}, \ 21.4 \text{ oz}, \ 22.0 \text{ oz}$

Suppose that “22 ounce” Charles Mulligan’s porterhouse steaks follow a $$N(\mu, \sigma^2)$$ distribution and that Ron’s six steaks were a random sample.

Recall that

$\bar{x} = 21.4 \quad \text{and} \quad s^2 = 0.64.$ (a) Calculate the test statistic for testing $$H_0: \ \mu = 22$$, where $$\mu$$ is the true weight of a “22 ounce” Charles Mulligan’s porterhouse. Report your answer rounded to three decimal places.

Solution:

• $$\bar{x} = 21.4$$
• $$\mu_0 = 22$$
• $$n = 6$$
• $$s = 0.8$$

$t = \frac{\bar{x} - \mu_0}{s / \sqrt{n}} = \frac{21.4 - 22}{0.8 / \sqrt{6}} = \boxed{-1.837}$

(b) Calculate the p-value for the test $$H_0: \ \mu = 22$$ versus $$H_1: \ \mu < 22$$. Report your decision when $$\alpha = 0.05$$.

Some useful code:

• Excel: T.DIST(x, df, 1) gives the area to the left of x.
• Excel: TDIST(x, df, 1) gives the area to the right of x. (An older command. Only accepts positive values for x.)
• R: pt(x, df) gives the area to the left of x.

Solution:

This is a one-sided test, with a less-than alternative, so

$\text{p-value} = P(T_{5} < -1.837) = \boxed{0.06282}$

$\text{p-value} = 0.06282 > \alpha = 0.05$

$\boxed{\text{Fail to reject } H_0.}$

pt(q = -1.837, df = 5)
##  0.06281569

(c) Calculate the test statistic for testing $$H_0: \ \sigma \leq 0.50$$, where $$\sigma$$ is the true standard deviation of the weight of a “22 ounce” Charles Mulligan’s porterhouse.

Solution:

• $$\sigma_0 = 0.50$$
• $$n = 6$$
• $$s = 0.8$$

$X^2 = \frac{(n - 1)s^2}{\sigma^2} = \frac{(6 - 1)0.8^2}{0.50^2} = \boxed{12.8}$

(d) Calculate the p-value for the test $$H_0: \ \sigma \leq 0.50$$ versus $$H_1: \ \sigma > 0.50$$. Report your decision when $$\alpha = 0.01$$.

Some useful code:

• Excel: CHISQ.DIST(x, df, 1) gives the area to the left of x.
• Excel: CHIDIST(x, df, 1) gives the area to the right of x. (An older command.)
• R: pchisq(x, df) gives the area to the left of x.

Solution:

This is a one-sided test, with a greater-than alternative, so

$\text{p-value} = P(\chi_{5}^{2} > 12.8) = \boxed{\bf 0.02533}$

$\text{p-value} = 0.02533 > \alpha = 0.01$

$\boxed{\bf \text{Fail to reject } H_0.}$

pchisq(12.8, df = 5, lower.tail = FALSE)
##  0.02532684

(e) Suppose the true value of $$\sigma$$ is indeed 0.50. Was your decision in part (d) correct? If not, what Type of error was made? Justify your answer.

Solution:

If $$\sigma = 0.50$$, then $$H_0$$ is true. By failing to reject, we have made the $$\boxed{\text{correct}}$$ decision. Had we rejected, we would have made an error, in particular, a $$\text{Type I Error.}$$

## Exercise 2

Last year, ballots in Champaign-Urbana contained the following question to assess public opinion on an issue:

“Should the State of Illinois legalize and regulate the sale and use of marijuana in a similar fashion as the State of Colorado?”

Suppose that we would like to understand Champaign-Urbana’s 2017 opinion on marijuana legalization. To satisfy our curiosity, we obtain a random sample of 120 Champaign-Urbanians and find that 87 support marijuana legalization.

(a) Calculate the $$z$$ test statistic for the test $$H_0: \ p = 0.70$$ versus $$H_1: \ p > 0.70$$ where $$p$$ is the true proportion of Champaign-Urbanians that support marijuana legalization. Report your answer rounded to two decimal places.

Solution:

• $$x = 87$$
• $$n = 120$$

$\hat{p} = \frac{x}{n} = \frac{87}{120} = 0.725$

$z = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}} = \frac{0.725 - 0.70}{\sqrt{\frac{0.70 \cdot 0.30}{120}}} \approx \boxed{0.60}$

(0.725 - 0.70) / sqrt(0.70 * 0.30 / 120)
##  0.5976143

(b) Calculate the (approximate, using $$z$$) p-value for the test $$H_0: \ p = 0.70$$ versus $$H_1: \ p > 0.70$$.

Solution:

This is a one-sided test, with a greater-than alternative, so

$\text{p-value} = P(Z > 0.60) = P(Z < -0.60) = \boxed{0.2743}$

z = (0.725 - 0.70) / sqrt(0.70 * 0.30 / 120)
pnorm(q = z, mean = 0, sd = 1, lower.tail = FALSE) # some rounding differences
##  0.2750487

(c) Calculate the exact p-value for the test $$H_0: \ p = 0.70$$ versus $$H_1: \ p > 0.70$$. That is, calculate the probability of seeing as many supporters as observed, or more, assuming the null hypothesis is true.

Some useful code:

• Excel: BINOM.DIST(x, n, p, 1) gives the probability of less than or equal to x.
• R: pbinom(x, n, p) gives the probability of less than or equal to x.

Solution:

Here,

$X \sim \text{binom}(n = 120, p = 0.70).$

Then,

$\text{p-value} = P(X \geq 87) = 1 - P(X \leq 86) = \boxed{0.3129}$

1 - pbinom(q = 86, size = 120, prob = 0.70)
##  0.3128955
pbinom(q = 86, size = 120, prob = 0.70, lower.tail = FALSE)
##  0.3128955

# Exercise 3

Last year, ballots in Champaign-Urbana contained the following question to assess public opinion on an issue:

“Should the State of Illinois legalize and regulate the sale and use of marijuana in a similar fashion as the State of Colorado?”

Suppose we obtain a random sample of 80 Champaign voters, of which 55 support marijuana legalization. We also obtain a random sample of 100 Urbana voters, of which 75 support marijuana legalization. Let $$p_C$$ be the true proportion of Champaign voters who support marijuana legalization and let $$p_U$$ be the true proportion of Urbana voters who support marijuana legalization.

(a) Calculate a 99% confidence interval for $$p_U - p_C$$.

Solution:

• $$x_C = 55$$
• $$n_C = 80$$
• $$x_U = 75$$
• $$n_U = 100$$
• $$z_{\alpha/2} = z_{0.005} = 2.576$$

$\hat{p}_C = \frac{x_C}{n_C} = \frac{55}{80} = 0.6875$

$\hat{p}_U = \frac{x_U}{n_U} = \frac{75}{100} = 0.75$

$(\hat{p}_U - \hat{p}_C) \pm z_{\alpha/2} \sqrt{\frac{\hat{p}_C(1 - \hat{p}_C)}{n_C} + \frac{\hat{p}_U(1 - \hat{p}_U)}{n_U}}$

$(0.75 - 0.6875) \pm 2.576 \sqrt{\frac{0.6875(1 - 0.6875)}{80} + \frac{(0.75)(1 - 0.75)}{100}}$

$\boxed{\bf 0.0625 \pm 0.1740}$

(b) Calculate the p-value for the test $$H_0: \ p_U = p_C$$ versus $$H_1: \ p_U \neq p_C$$.

Solution:

We first need to calculate the pooled proportion estimate under the null hypothesis.

$\hat{p} = \frac{x_C + x_U}{n_C + n_U} = \frac{55 + 75}{80 + 100} = \frac{13}{18}$

We then calculate the test statistic.

$z = \frac{(\hat{p}_U - \hat{p}_C) - 0}{\sqrt{\hat{p}(1 - \hat{p})(\frac{1}{n_C} + \frac{1}{n_U})}} = \frac{(0.75 - 0.6875) - 0}{\sqrt{(\frac{13}{18})(1 - \frac{13}{18})(\frac{1}{80} + \frac{1}{100})}} = 0.9303$

Since this is a two-sided test, we have,

$\text{p-value } = 2 \cdot P[Z > 0.9303] = 2 \cdot P[Z < -0.9303] = 2 \cdot 0.1761 = \boxed{\bf 0.3522 .}$