Problem 5.6

The sample mean \(\bar{x}\) can be found by finding the average of the population mean from the confidence interval.

\(\frac{65 +77}{2} = 71\).

\(\bar{x} = 71\)

To find the critical \(t^*\) value, I used the qt() function to find the value of \(t^*\) with .05% in each tail. \(t^* = 1.71\)

qt(p=.05, df=24, lower.tail = F)
## [1] 1.710882

\(71 \pm 1.71\times \frac{\sigma}{\sqrt25}\)

\(\sigma = 17.5\)

Margin of Error = \(t^* \times \frac{\sigma}{\sqrt{25}}\) = 5.99

Problem 5.14

A

Since I don’t know the sample size, I can’t calculate the degrees of freedom for the \(t\) value. I used the \(z\) table instead. With a 90% CI, I split the tails in two and find the z-value with a probability of 95%. \(z = 1.65\)

Margin of Error = \(z^* \times \frac{250}{\sqrt{n}}\)

Sample size = \((\frac{1.64 \times 250}{25})^2\)

Sample size = 269

z <- 1.65
size <- ((z*250)/25)^2
size
## [1] 272.25

B

From the z-table, the z-score would be 2.57. From looking at the equation above, to keep the margin of error the same the sample size would have to be larger.

C

z <- 2.58
size <- ((z*250)/25)^2
size
## [1] 665.64

Problem 5.20

A

From the boxplots we see that the average writing scores are higher than the average reading scores.

B

Since the reading and writing scores are from the same student, the scores are dependent.

C

\(H_o = 0\) There is no difference between reading and writing scores.

\(H_a \neq 0\) There is a difference between reading and writing scores.

D

  1. The sample was random and was less than 10% of the population making it independent

  2. The distribution of the data is normal and not skewed.

E

Test statistic:

\(T = \frac{-0.545 - 0}{8.887} = -.061\)

df = 199

p-value = .476

Since the p-value is so large, there is not enough evidence to say there is a convincing difference between the average scores.

pnorm(-.061)
## [1] 0.4756796

F

We may have made a Type II error meaning that there was a difference in the average test scores that we failed to detect.

G

No, because the p-value is so large the confidence interval would have to be quite low to have a chance to reject the null hypothesis.

Problem 5.32

\(H_o = 0\) :There is no significant difference between the average MPG

\(H_a \neq 0\) :There is a significant difference between the average MPG

m_auto <- 16.12
m_man <- 19.85

sd_auto <- 3.58
sd_man <- 4.51

n <- 26
df <- 25

diff_mean <- m_man - m_auto

se <- ((4.51^2)/26) + ((3.58^2)/26)
se <- sqrt(se)

print(paste0("Point estimate is: ", diff_mean))
## [1] "Point estimate is: 3.73"
print(paste0("Standard error is: ", round(se,2)))
## [1] "Standard error is: 1.13"
#95% confidence interval
t <- 2.06

x_high <- diff_mean + (t*se)
x_low <- diff_mean - (t*se)

print(paste0("We are 95% confident that the gas mileage in the manual is between ", round(x_low,2), "% and ", round(x_high,2), "% better than an automatic car."))
## [1] "We are 95% confident that the gas mileage in the manual is between 1.4% and 6.06% better than an automatic car."
t_score <- (diff_mean - 0)/se
p <- pnorm(-t_score)*2

print(paste0("p-value is: ", round(p,5)))
## [1] "p-value is: 0.00096"
print("Since the p-value is lower than the significant value of 0.05, there is a significant differenct between the average gas milage of the automatic and manual cars.")
## [1] "Since the p-value is lower than the significant value of 0.05, there is a significant differenct between the average gas milage of the automatic and manual cars."

Problem 5.48

A

\(H_o:\) Mean is equal across all groups

\(H_a:\) At least one mean is different

B

  1. The observations are independent within and across groups

  2. The data within each group are nearly normal

  3. The variabliliy across the groups is about equal

C

\(F = \frac{MSG}{MSE}\)

\(MS_d = \frac{SS_d}{Df_d}\)

\(MS_r = \frac{SS_r}{Df_r}\)

\[ \begin{array}{ c | c | c | c | c | c } \hline & Df & Sum \ Sq & Mean \ Sq & F \ value & Pr(>F) \\ \hline degree & 4 & 2,006.16 & 501.54 & 0.0225 & 0.0682 \\ Residuals & 1167 & 267,382 & 229.12 \\ \hline Total & 1171 & 269,388.16 \end{array} \]

D

Since the p-value is larger than the F value, we reject H_a. The data didn’t provide significant evidence that the average hours worked differed between groups with different degrees.