# 6a.4 - Hypothesis Test for One-Sample Proportion

6a.4 - Hypothesis Test for One-Sample Proportion

## Overview

In this section, we will demonstrate how we use the sampling distribution of the sample proportion to perform the hypothesis test for one proportion.

Recall that if $np$ and $n(1-p)$ are both greater than five, then the sample proportion, $\hat{p}$, will have an approximate normal distribution with mean $p$, standard error $\sqrt{\frac{p(1-p)}{n}}$, and the estimated standard error $\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}$.

In hypothesis testing, we assume the null hypothesis is true. Remember, we set up the null hypothesis as $H_0\colon p=p_0$. This is very important! This statement says that we are assuming the unknown population proportion, $p$, is equal to the value $p_0$.

Since this is true, then we can follow the same logic above. Therefore, if $np_0$ and $n(1-p_0)$ are both greater than five, then the sampling distribution of the sample proportion will be approximately normal with mean $p_0$ and standard error $\sqrt{\frac{p_0(1-p_0)}{n}}$.

We can find probabilities associated with values of $\hat{p}$ by using:

$z^*=\dfrac{\hat{p}-p_0}{\sqrt{\dfrac{p_0(1-p_0)}{n}}}$

## Example 6-4 Referring back to a previous example, say we take a random sample of 500 Penn State students and find that 278 are from Pennsylvania. Can we conclude that the proportion is larger than 0.5?

Is 0.556(=278/500) much bigger than 0.5? What is much bigger?

This depends on the standard deviation of $\hat{p}$ under the null hypothesis.

$\hat{p}-p_0=0.556-0.5=0.056$

The standard deviation of $\hat{p}$, if the null hypothesis is true (e.g. when $p_0=0.5$) is:

$\sqrt{\dfrac{p_0(1-p_0)}{n}}=\sqrt{\dfrac{0.5(1-0.5)}{500}}=0.0224$

We can compare them by taking the ratio.

$z^*=\dfrac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}=\dfrac{0.556-0.5}{\sqrt{\frac{0.5(1-0.5)}{500}}}=2.504$

Therefore, assuming the true population proportion is 0.5, a sample proportion of 0.556 is 2.504 standard deviations above the mean.

The $z^*$ value we found in the above example is referred to as the test statistic.

Test statistic
The sample statistic one uses to either reject $H_0$ (and conclude $H_a$ ) or fail to reject $H_0$.

# 6a.4.1 - Making a Decision

6a.4.1 - Making a Decision

In the previous example for Penn State students, we found that assuming the true population proportion is 0.5, a sample proportion of 0.556 is 2.504 standard deviations above the mean, $p$.

Is it far enough away from the 0.5 to suggest that there is evidence against the null? Is there a cutoff for the number of standard deviations that we would find acceptable?

What if instead of a cutoff, we found a probability? Recall the alternative hypothesis for this example was $H_a\colon p>0.5$. So if we found, for example, the probability of a sample proportion being 0.556 or greater, then we get $P(Z>2.504)=0.0061$.

This means that, if the true proportion is 0.5, the probability we would get a sample proportion of 0.556 or greater is 0.0061. Very small! But is it small enough to say there is evidence against the null?

To determine whether the probability is small or how many standard deviations are “acceptable”, we need a preset level of significance, which is the probability of a Type I error. Recall that a Type I error is the event of rejecting the null hypothesis when that null hypothesis is true. Think of finding guilty a person who is actually innocent.

When we specify our hypotheses, we should have some idea of what size of a Type I error we can tolerate. It is denoted as $\alpha$. A conventional choice of $\alpha$ is 0.05. Values ranging from 0.01 to 0.1 are also common and the choice of $\alpha$ depends on the problem one is working on.

Once we have this preset level, we can determine whether or not there is significant evidence against the null. There are two methods to determine if we have enough evidence: the rejection region method and the p-value method.

## Rejection Region Approach

We start the hypothesis test process by determining the null and alternative hypotheses. Then we set our significance level, $\alpha$, which is the probability of making a Type I error. We can determine the appropriate cutoff called the critical value and find a range of values where we should reject, called the rejection region.

Critical values
The values that separate the rejection and non-rejection regions.
Rejection region
The set of values for the test statistic that leads to rejection of $H_0$

The graphs below show us how to find the critical values and the rejection regions for the three different alternative hypotheses and for a set significance level, $\alpha$. The rejection region is based on the alternative hypothesis.

#### Left-Tailed Test

Reject $H_0$ if the test statistics is less than or equal to the critical value ($c_\alpha$)

#### Right-Tailed Test

Reject $H_0$ if the test statistic is greater than or equal to the critical value ($c_{1-\alpha}$)

#### Two-Tailed Test

Reject $H_0$ if the absolute value of the test statistic is greater than or equal to the absolute value of the critical value ($c_{\alpha/2}$).

The rejection region is the region where, if our test statistic falls, then we have enough evidence to reject the null hypothesis. If we consider the right-tailed test, for example, the rejection region is any value greater than $c_{1-\alpha}$, where $c_{1-\alpha}$ is the critical value.

## P-Value Approach

As with the rejection region approach, the P-value approach will need the null and alternative hypotheses, the significance level, and the test statistic. Instead of finding a region, we are going to find a probability called the p-value.

P-value
The p-value (or probability value) is the probability that the test statistic equals the observed value or a more extreme value under the assumption that the null hypothesis is true.

The p-value is a probability statement based on the alternative hypothesis. The p-value is found differently for each of the alternative hypotheses.

• Left-tailed: If $H_a$ is left-tailed, then the p-value is the probability the sample data produces a value equal to or less than the observed test statistic.
• Right-tailed: If $H_a$ is right-tailed, then the p-value is the probability the sample data produces a value equal to or greater than the observed test statistic.
• Two-tailed: If $H_a$ is two-tailed, then the p-value is two times the probability the sample data produces a value equal to or greater than the absolute value of the observed test statistic.

So for one-sample proportions we have...

Left-Tailed

$P(Z \le z^*)$

Right-Tailed

$P(Z \ge z^*)$

Two-Tailed

$2$ x $P(Z \ge |z^*|)$

Once we find the p-value, we compare the p-value to our preset significance level.

• If our p-value is less than or equal to $\alpha$, then there is enough evidence to reject the null hypothesis.
• If our p-value is greater than $\alpha$, there is not enough evidence to reject the null hypothesis.

Caution! One should be aware that $\alpha$ is also called level of significance. This makes for a confusion in terminology. $\alpha$ is the preset level of significance whereas the p-value is the observed level of significance. The p-value, in fact, is a summary statistic which translates the observed test statistic's value to a probability which is easy to interpret.

Important note: We can summarize the data by reporting the p-value and let the users decide to reject $H_0$ or not to reject $H_0$ for their subjectively chosen $\alpha$ values.

This video will further explain the meaning of the p-value.

# 6a.4.2 - More on the P-Value and Rejection Region Approach

6a.4.2 - More on the P-Value and Rejection Region Approach

## Two Methods for Making a Statistical Decision

Of the two methods for making a statistical decision, the p-value approach is more commonly used and provided in published literature. However, understanding the rejection region approach can go a long way in one's understanding of the p-value method. In the video, we show how the two methods are related. Regardless of the method applied, the conclusions from the two approaches are exactly the same.

## Comparing the Two Approaches

Both approaches will ensure the same conclusion and either one will work. However, using the p-value approach has the following advantages:

• Using the rejection region approach, you need to check the table or software for the critical value every time you use a different $\alpha$ value.
• In addition to just using it to reject or not reject $H_0$ by comparing p-value to $\alpha$ value, the p-value also gives us some idea of the strength of the evidence against $H_0$.

# 6a.4.3 - Steps in Conducting a Hypothesis Test for $p$

6a.4.3 - Steps in Conducting a Hypothesis Test for $p$

## Six Steps for One-Sample Proportion Hypothesis Test

### Steps 1-3

Let's apply the general steps for hypothesis testing to the specific case of testing a one-sample proportion.

Step 1: Set up the hypotheses and check conditions.

$np_0\ge 5$ and $n(1−p_0)≥5$

One Proportion Z-test Hypotheses

Left-Tailed
$H_0\colon p=p_0$
$H_a\colon p<p_0$
Right-Tailed
$H_0\colon p=p_0$
$H_a\colon p>p_0$
Two-Tailed
$H_0\colon p=p_0$
$H_a\colon p\ne p_0$

Step 2: Decide on the level of significance $\boldsymbol{(\alpha)}$.

Step 3: Calculate the test statistic.

One Proportion Z-test: $z^*=\dfrac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}$

The first few steps (Step 1 - Step 3) are exactly the same as the rejection region or p-value approach. The next part will discuss steps 4 - 6 for both approaches.

## Rejection Region Approach

### Steps 4-6

Step 4: Find the appropriate critical values for the tests. Write down clearly the rejection region for the problem.

#### Two-Tailed Test

View the critical values and regions with an $\alpha=.05$.

Step 5: Make a decision about the null hypothesis.
Check to see if the value of the test statistic falls in the rejection region. If it does, then reject $H_0$ (and conclude $H_a$). If it does not fall in the rejection region, do not reject $H_0$.
Step 6: State an overall conclusion.

## P-Value Approach

### Steps 4-6

Step 4: Compute the appropriate p-value based on our alternative hypothesis.
Left-Tailed
$P(Z \le z^*)$
Right-Tailed
$P(Z\ge z^*)$
Two-Tailed
$2$ x $P(Z \ge |z^*|)$
Step 5: Make a decision about the null hypotheses.
If the p-value is less than the significance level, then reject the null hypothesis. If the p-value is greater than the significance level, fail to reject the null hypothesis.
Step 6: State an overall conclusion.
Note! Recall that the P-value is a probability of obtaining a value of the test statistic or a more extreme value of the test statistic assuming that the null hypothesis is true.

## Example 6-5: Penn State Students from Pennsylvania Referring back to example 6-4. Say we take a random sample of 500 Penn State students and find that 278 are from Pennsylvania. Can we conclude that the proportion is larger than 0.5 at a 5% level of significance?

Conduct the test using both the rejection region and p-value approach.

Step 1: Set up the hypotheses and check conditions.

Set up the hypotheses. Since the research hypothesis is to check whether the proportion is greater than 0.5 we set it up as a one (right)-tailed test:

$H_0\colon p=0.5$ vs $H_a\colon p>0.5$

Can we use the z-test statistic? The answer is yes since the hypothesized value $p_0$ is $0.5$ and we can check that: $np_0=500(0.5)=250 \ge 5$ and $n(1-p_0)=500(1-0.5)=250 \ge 5$

Step 2: Decide on the significance level, $\alpha$.

According to the question, $\alpha= 0.05$.

Step 3: Calculate the test statistic:

\begin{align} z^*&= \dfrac{0.556-0.5}{\sqrt{\frac{0.5(1-0.5)}{500}}}\\z^*&=2.504 \end{align}

#### Rejection Region Approach

Step 4: Find the appropriate critical values for the test using the z-table. Write down clearly the rejection region for the problem.

We can use the standard normal table to find the value of $Z_{0.05}$. From the table, $Z_{0.05}$ is found to be $1.645$ and thus the critical value is $1.645$. The rejection region for the right-tailed test is given by:

$z^*>1.645$

Step 5: Make a decision about the null hypothesis.

The test statistic or the observed Z-value is $2.504$. Since $z^*$ falls within the rejection region, we reject $H_0$.

Step 6: State an overall conclusion.

With a test statistic of $2.504$ and critical value of $1.645$ at a 5% level of significance, we have enough statistical evidence to reject the null hypothesis. We conclude that a majority of the students are from Pennsylvania.

#### P-Value Approach

Step 4: Compute the appropriate p-value based on our alternative hypothesis:
$\text{p-value}=P(Z\ge z^*)=P(Z \ge 2.504)=0.0062$

Step 5: Make a decision about the null hypothesis.

Since $\text{p-value} = 0.0062 \le 0.05$ (the $\alpha$ value), we reject the null hypothesis.

Step 6: State an overall conclusion.

With a test statistic of $2.504$ and p-value of $0.0062$, we reject the null hypothesis at a 5% level of significance. We conclude that a majority of the students are from Pennsylvania.

## Try it!

### Online Purchases

An e-commerce research company claims that 60% or more graduate students have bought merchandise online. A consumer group is suspicious of the claim and thinks that the proportion is lower than 60%. A random sample of 80 graduate students shows that only 22 students have ever done so. Is there enough evidence to show that the true proportion is lower than 60%?

Conduct the test at 10% Type I error rate and use the p-value and rejection region approaches.

Step 1: Set up the hypotheses and check conditions.

Set up the hypotheses. Since the research hypothesis is to check whether the proportion is less than 0.6 we set it up as a one (left)-tailed test:

$H_0\colon p=0.6$ vs $H_a\colon p<0.6$

Can we use the z-test statistic? The answer is yes since the hypothesized value $p_0$ is 0.6 and we can check that: $np_0=80(0.6)=48 \ge 5$ and $n(1-p_0)=80(1-0.6)=32 \ge 5$

Step 2: Decide on the significance level, $\alpha$.

According to the question, $\alpha= 0.1$.

Step 3: Calculate the test statistic:

\begin{align} z^* &=\frac{\hat{p}-p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}}\\&=\frac{.275-0.6}{\sqrt{\frac{0.6(1-0.6)}{80}}}\\&=-5.93 \end{align}

#### Rejection Region Approach

Step 4: Find the appropriate critical values for the test using the z-table. Write down clearly the rejection region for the problem.

The critical value is the value of the standard normal where 10% fall below it. Using the standard normal table, we can see that the value is -1.28.

Step 5: Make a decision about the null hypothesis.

The rejection region is any $z^*$ such that $z^*<-1.28$ . Since our test statistic, -5.93, is inside the rejection region, we reject the null hypothesis.

Step 6: State an overall conclusion.

There is enough evidence in the data provided to suggest, at 10% level of significance, that the true proportion of students who made purchases online was less than 60%.

#### P-Value Approach

Step 4: Compute the appropriate p-value based on our alternative hypothesis:
$\text{p-value}=P(Z \le -5.93) = 0.0000000003$
Step 5: Make a decision about the null hypothesis.

Since our p-value is very small and less than our significance level of 10%, we reject the null hypothesis.

Step 6: State an overall conclusion.

There is enough evidence in the data provided to suggest, at 10% level of significance, that the true proportion of students who made purchases online was less than 60%.

  Link ↥ Has Tooltip/Popover Toggleable Visibility