12.1.17 random sample confidence interval
A poll found that 59% of a random sample of 1058 adults said that they believe in ghosts.
(a). Determine the margin of error for a 99% confidence interval. (Round to three decimal places as needed.)
First, we need to get the data from the question. \(\hat{p} = .59\)
= 1058
n = .56 p
Since confidence level is .99, \(\alpha = 1 - .99 = .01\). So \(\alpha/2=.01/2\)
We can find \(z_{\alpha/2}\) by using qnorm()
= .01
alpha = abs(qnorm(alpha/2)) zalpha2
We can find the margin of error for a 99% confidence interval by using the formular \(E=z_{\alpha/2}.\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\)
= zalpha2 * sqrt(p*(1-p)/n)
E E
## [1] 0.03930924
Round to three decimal places
round(E, 3)
## [1] 0.039

(b). Without doing any calculations, indicate whether the margin of error is larger or smaller for a 90% confidence interval.
If we change the confidence level from 99% to 90%, our \(z_{\alpha/2}\) will become smaller since alpha increases. From the formular, we can see that margin of error E will decrease.

Hope that helps!