12.2.81 one-proportion z-test

The number of successes and the sample size for a simple random sample from a population are given below. \(x = 8, n = 32, H_0: p=0.2, H_a:p \ne 0.2, \alpha =.05\) b. Decide whether using the​ one-proportion z-test is appropriate. c. If​ appropriate, use the​ one-proportion z-test to perform the specified hypothesis test.


(a). Determine the sample proportion. We use the formula \(\hat{p}= \frac{x}{n}\)

x = 8
n = 32
p = x/n
p
## [1] 0.25

\(\hat{p} = .25\)



(b). Decide whether using the​ one-proportion z-interval procedure is appropriate. There are two conditions for one-proportion z test:

  1. simple random sample

  2. \(np_0\) and \(n(1-p_0)\) are 5 are greater

The first condition is passed since the question specifies a simple random sample

To check the second condition we can run

p0 = .2
n*p0 >=5
## [1] TRUE
n*(1-p0) >=5
## [1] TRUE


(c).If​ appropriate, use the​ one-proportion z-test to perform the specified hypothesis test.

To compute test statistic z we use the formula \(z=\frac{\hat{p}-p_0}{\sqrt{p_0(1-p_0)/n}}\)

z = (p-p0)/sqrt(p0*(1-p0)/n)
z
## [1] 0.7071068

Round to two decimal places

round(z,2)
## [1] 0.71


Identify the critical​ value(s), if appropriate. Select the correct choice below​ and, if​ necessary, fill in the answer box to complete your answer.

Since we have \(H_a:p \ne .2\), this is a two tailed test with \(\alpha = 0.05\). So \(\alpha/2= .05/2\)

To find negative critical value, we run

round(qnorm(.05/2),2)
## [1] -1.96


Since \(-z_{\alpha/2}=-1.96< z = .71< z_{\alpha/2}=1.96\), the test statistic does not lie in rejected region. We do not have enough evidence to reject hypothesis.

Hope that helps!