Hypothesis Testing for One Proportion

Elementary Statistics

MTH-161D | Spring 2025 | University of Portland

March 19, 2025

Objectives

These slides are derived from Diez et al. (2012).

Previously… (1/2)

Population vs Sample Proportion

Previously… (2/2)

Confidence Interval for One Proportion

\[\text{point estimate} \pm z^{\star} \text{SE}\]

Case Study I

Customer Satisfaction at a Coffee Shop

Background: A local coffee shop prides itself on high customer satisfaction. The shop’s management claims that at least 85% of its customers are satisfied with their service. A market research firm is hired to assess this claim by conducting a survey.

Data Collection: The research firm randomly surveys 200 customers who visited Brew Haven in the past month. Among them, 160 reported being satisfied with the service.

Objective: Use hypothesis testing for one proportion to determine whether the claim that at least 85% of customers are satisfied is supported by the survey data.

Define Hypotheses

Let \(p\) represent the true proportion of satisfied customers.

\(\star\) This is a one-tailed test because the \(H_A\) is using the \(<\) sign.

Compute the Test Statistic

The sample proportion is \[\hat{p} = \frac{160}{200} = 0.80.\]

Test statistic formula for one proportion: \[z = \frac{\hat{p} - p_0}{SE_{p}}\]

Substituting values: \[z = \frac{0.80 - 0.85}{\sqrt{\frac{0.85(1-0.85)}{200}}} \approx -1.9803\]

\(\star\) The standard error formula \(SE_{p}\) is the Binomial standard error and here we used the null value.

Determine the P-Value

Determine the probability associated with the computed test statistic.

Using R:

pe <- 0.80 # point estimate
p_0 <- 0.85 # null value
n <- 200 # sample size
SE_p <- sqrt((p_0*(1-p_0))/(n)) # standard error
Z <- (pe-p_0)/SE_p # test statistic

# p-value
pnorm(Z,0,1) 
## [1] 0.02383519

\(\star\) The p-value is the probability \(P(Z \le -1.9803) = 0.0238\) using \(Z \sim N(0,1\), the standard normal distribution. Since this is one-tailed test, we only use the left tail probability.

Make a Conclusion

We compare the p-value to our chosen significance level of \(\alpha = 0.05\).

Conclusion:

\(\star\) Since \(0.0238 < 0.05\), we reject the null hypothesis (\(H_0\)).

What does the Significance Level Mean?

Remember that we defined \(\alpha = 0.05\) arbitrarily before we conducted the hypothesis test.

The significance value \(\alpha\) is related to the confidence level of the confidence interval of the point estimate, which is \(1-\alpha\).

\(\star\) Key Idea: The significance level \(\alpha\) is the probability of rejecting the null hypothesis when it is actually true. In other words, it is the probability of making an error.

One Proportion Confidence Interval

If we set a significance level \(\alpha = 0.05\), then the confidence level for the sample proportion is \(1-\alpha = 1 - 0.05 = 0.95\).

That is a 95% confidence interval of the sample proportion \(\hat{p} = 0.80\).

\(\star\) Key Idea: The null value of \(0.85\) is not within the 95% confidence interval. We would reject the null hypothesis at the 5% significance level.

Activity: Apply One-Proportion Test

  1. Make sure you have a copy of the W 3/19 Worksheet. This will be handed out physically and it is also digitally available on Moodle.
  2. Work on your worksheet by yourself for 10 minutes. Please read the instructions carefully. Ask questions if anything need clarifications.
  3. Get together with another student.
  4. Discuss your results.
  5. Submit your worksheet on Moodle as a .pdf file.

References

Diez, D. M., Barr, C. D., & Çetinkaya-Rundel, M. (2012). OpenIntro statistics (4th ed.). OpenIntro. https://www.openintro.org/book/os/