# 8-5. Large Sample Tests for a Population Proportion

Both the critical value approach and the _p_-value approach can be applied to test hypotheses about a population proportion $$p$$ .&#x20;

The **null hypothesis** will have the form $$H_0:p=p_0$$ for some specific number $$p_0$$ between 0 and 1.&#x20;

The **alternative hypothesis** will be one of the _three inequalities_ $$p<p_0, p>p_0, or \space p≠p_0$$ for the same number $$p_0$$ that appears in the null hypothesis.

The information in Section 6.3 "The Sample Proportion" in Chapter 6 "Sampling Distributions" gives the following formula for the test statistic and its distribution.&#x20;

In the formula $$p_0$$ is the numerical value of $$p$$ that appears in the two hypotheses, $$q_0=1−p_0, \hat{p}$$ is the sample proportion, and $$n$$ is the sample size. Remember that the condition that the sample be large is not that $$n$$ be at least 30 but that the interval

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LrTtGKUCyKGSfsNEYHk%2F-LrTtSMiIAC36oyK1cm7%2Fimage.png?alt=media\&token=dd6d3d8b-d353-4899-9274-d8057f4d934a)

lie wholly within the interval $$[0,1].$$&#x20;

> **Standardized Test Statistic for Large Sample Hypothesis Tests Concerning a Single Population Proportion**&#x20;
>
> &#x20;                                            $$z_o = \frac{\hat p - p_0}{ \sqrt{\frac{p_0 q_0}{n} }}$$&#x20;
>
> The test statistic has the standard normal distribution.



The distribution of the standardized test statistic and the corresponding rejection region for each form of the alternative hypothesis (left-tailed, right-tailed, or two-tailed), is shown in Figure 8.14 "Distribution of the Standardized Test Statistic and the Rejection Region".

Figure 8.14 Distribution of the Standardized Test Statistic and the Rejection Region

![](https://saylordotorg.github.io/text_introductory-statistics/section_12/01fe19537789cf83979f79f172b522c5.jpg)



**EXAMPLE 12.** A soft drink maker claims that a majority of adults prefer its leading beverage over that of its main competitor’s. To test this claim 500 randomly selected people were given the two beverages in random order to taste. Among them, 270 preferred the soft drink maker’s brand, 211 preferred the competitor’s brand, and 19 could not make up their minds. Determine whether there is sufficient evidence, at the 5% level of significance, to support the soft drink maker’s claim against the default that the population is evenly split in its preference.

**\[ Solution ]**

We must check that the sample is sufficiently large to validly perform the test. Since&#x20;

&#x20;                         $$\hat{p} = \frac {270}{500} = 0.54,$$&#x20;

&#x20;                          $$\sqrt{  \frac{ \hat{p} (1-\hat{p})   }{n} } = \sqrt{ \frac { (0.54)(0.46) }{ 500}} ≈ 0.02$$&#x20;

hence,&#x20;

&#x20;                        $$[ \hat {p} - 3 \sqrt{  \frac{ \hat{p} (1-\hat{p})   }{n} },  \hat{p} + \sqrt{  \frac{ \hat{p} (1-\hat{p})   }{n} }]$$&#x20;

&#x20;                         $$= [0.54 - 3 (0.02), 0.54 + 3 (0.02)]$$&#x20;

&#x20;                         $$= [0.48, 0.60]  ⊂[0,1]$$&#x20;

so the sample is sufficiently large.

*   **Step 1**. The relevant test is\
    &#x20;            $$H_0:p=0.50 vs. Ha:p>0.50, @ α=0.05$$&#x20;

    &#x20;              where _p_ denotes the proportion of all adults who prefer the company’s beverage over that of its competitor’s beverage.
*   **Step 2**. The test statistic is\
    &#x20;              $$z_o= (\hat{p}−p_0) / \sqrt{ \frac {p_0 q_0} {n} }$$&#x20;

    &#x20;              and has the standard normal distribution.
*   **Step 3.** The value of the test statistic is\
    &#x20;               $$z_o= \frac {(\hat{p}−p_0)} { \sqrt{ \frac {p_0 q_0} {n} } }= \frac {(0.54 - 0.50) } { \sqrt { \frac {(0.5) (0.5)}{500}}} = 1.789$$


* **Step 4.** Since the symbol in $$H_a$$ is “ $$>$$ ” this is a **right-tailed test**, \
  &#x20;             so there is a single critical value, $$z_α=z_{0.05}.$$  \
  &#x20;             Reading from the last line in Figure 12.3 "Critical Values of " its value is 1.645. \
  &#x20;            The rejection region is $$[1.645,∞).$$&#x20;
* **Step 5.** the test statistic **falls in the rejection region**. The decision is **to reject** $$H_0$$ .&#x20;
*   In the context of the problem our **conclusion** is:

    _The data provide sufficient evidence, at the 5% level of significance, to conclude that a majority of adults prefer the company’s beverage to that of their competitor’s._

Figure 8.15 Rejection Region and Test Statistic for Note 8.47 "Example 12"

![](https://saylordotorg.github.io/text_introductory-statistics/section_12/e667418a241c22871b5d19c2938793f4.jpg)

{% tabs %}
{% tab title="R Source" %}
```
n <- 500                  # number of samples
xb <- 270
p0 <- 0.5
alpha <- 0.05             # 

# in case of right-tail test
pb <- xb / n               # sample proportion
se <- sqrt(p*(1-p)/n)     # std of sample proportion

z_c <- qnorm(1-alpha); z_c
z_o <- (pb - p0)/se; z_o

if (z_o >= z_c)  cat("Reject Ho.\n") else 
                 cat ("Can not reject Ho.\n")

```
{% endtab %}

{% tab title="Result" %}
```
> z_c <- qnorm(1-alpha); z_c
## [1] 1.644854
> z_o <- (pb - p0)/se; z_o
## [1] 1.809325
> 
> if (z_o >= z_c)  cat("Reject Ho.\n") else 
+                  cat ("Can not reject Ho.\n")
## Reject Ho.
```
{% endtab %}
{% endtabs %}



**EXAMPLE 13.**  Globally the long-term proportion of newborns who are male is 51.46%. A researcher believes that the proportion of boys at birth changes under severe economic conditions. To test this belief randomly selected birth records of 5,000 babies born during a period of economic recession were examined. It was found in the sample that 52.55% of the newborns were boys. Determine whether there is sufficient evidence, at the 10% level of significance, to support the researcher’s belief.

**\[ Solution ]**

&#x20;                       $$\sqrt{  \frac{ \hat{p} (1-\hat{p})   }{n} } = \sqrt{ \frac { (0.5255)(0.4745) }{ 5000}} ≈ 0.01$$&#x20;

hence,&#x20;

&#x20;                        $$[ \hat {p} - 3 \sqrt{  \frac{ \hat{p} (1-\hat{p})   }{n} },  \hat{p} + \sqrt{  \frac{ \hat{p} (1-\hat{p})   }{n} }]$$&#x20;

&#x20;                         $$= [0.5225 - 3 (0.01), 0.5225 + 3 (0.01)]$$&#x20;

&#x20;                         $$= [0.4925, 0.5555]  ⊂[0,1]$$&#x20;

* Step 1. the **hypothesis** test is\
  &#x20;             $$H0:p=0.5146 vs. Ha:p=≠0.5146, @ α=0.10$$&#x20;
*   Step 2. The **test statistic** is\
    &#x20;              $$z_o= \frac {(\hat{p}−p_0)} { \sqrt{ \frac {p_0 q_0} {n} } }$$             &#x20;

    &#x20;              and has the standard normal distribution.
* Step 3. The **value of the test statistic** is\
  &#x20;               $$z_o= \frac {(\hat{p}−p_0)} { \sqrt{ \frac {p_0 q_0} {n} } } =  \frac {(0.5255− 0.5146)} { \sqrt{ \frac {(0.5146)(0.4854)} {5000} } } ≈ 1.542$$&#x20;
* Step 4. Since the symbol in $$H_a$$ is “ $$≠$$ ” this is a **two-tailed test**, \
  &#x20;             so there are a pair of critical values, \
  &#x20;            $$±z_{α∕2}=±z_{0.05}=±1.645.$$ \
  &#x20;             The **rejection region** is $$(−∞,−1.645]∪[1.645,∞).$$&#x20;
* Step 5. the test statistic does not fall in the rejection region. \
  &#x20;             The decision is **not to reject** $$H_0$$ .&#x20;
*   In the context of the problem our **conclusion** is:

    _The data do not provide sufficient evidence, at the 10% level of significance, to conclude that the proportion of newborns who are male differs from the historic proportion in times of economic recession._

Figure 8.16 Rejection Region and Test Statistic for Note 8.48 "Example 13"

![](https://saylordotorg.github.io/text_introductory-statistics/section_12/22cd2e9cac5d9dac6cd8ee19078f74cb.jpg)



{% tabs %}
{% tab title="R Source" %}
```
n <- 5000                  # number of samples
xb <- 2625
p0 <- 0.5146
alpha <- 0.10              # 

# in case of two-tail test
pb <- xb / n               # sample proportion
se <- sqrt(p*(1-p)/n)     # std of sample proportion

z_c <- qnorm(1-alpha/2); z_c
z_o <- (pb - p0)/se; z_o

if (z_o <= -z_c || z_o >= z_c ) cat("Reject Ho.\n") else 
                                cat ("Can not reject Ho.\n")
```
{% endtab %}

{% tab title="Result" %}
```
> z_c <- qnorm(1-alpha/2); z_c
## [1] 1.644854
> z_o <- (pb - p0)/se; z_o
## [1] 1.487613
> 
> if (z_o <= -z_c || z_o >= z_c ) cat("Reject Ho.\n") else 
+                                 cat ("Can not reject Ho.\n")
## Can not reject Ho.
```
{% endtab %}
{% endtabs %}



**EXAMPLE 14.** Perform the test of Note 8.47 "Example 12" using the _**p**_**-value approach**.

**\[ Solution ]**

We already know that the sample size is sufficiently large to validly perform the test.

* Steps 1–3 of the five-step procedure described in Section 8.3.2 "The " have already been done in Note 8.47 "Example 12" so we will not repeat them here, but only say that we know that the test is **right-tailed** and that **value of the test statistic** is $$Z = 1.789.$$&#x20;
* Step 4. Since the test is right-tailed the _**p**_**-value** is the area under the standard normal curve cut off by the observed test statistic, _z_ = 1.789, and therefore the _p_-value is $$(1−0.9633)=0.0367.$$&#x20;
* Step 5. Since the _p_-value is **less than** $$α=0.05$$ , \
  &#x20;             the decision is **to reject** $$H_0$$ .

Figure 8.17 _P_-Value for Note 8.49 "Example 14"

![](https://saylordotorg.github.io/text_introductory-statistics/section_12/53ce189932428f408b5b4f0cfa1b7a28.jpg)



* Using **Rstat** Package : `bntest2.plot()`

{% tabs %}
{% tab title="R Source" %}
```
library(Rstat)

bntest2.plot(x=270, n=500, p0=0.5, alp=0.05, side="up")
```
{% endtab %}

{% tab title="Result" %}
```
> bntest2.plot(x=270, n=500, p0=0.5, alp=0.05, side="up")
## Exact Binomial Test:     x/n = 0.54      P-v = P(X ≥ 270) = 0.0405 
## Normal approximation:    Z0 = 1.7889     P-v = P(Z > Z0) = 0.0368 
## Continuity correction:   Z0 = 1.7441     P-v = P(Z > Z0) = 0.0406 
```
{% endtab %}

{% tab title="Plot" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LxswNsqt6Ft0Mm95Uq4%2F-LxsyTZnRyTrGkX5hFfa%2Fimage.png?alt=media\&token=80deccbe-9ee1-44de-83e4-0cf87a496bae)

**\[Decision Rule]**

* p-value=0.0368 => if p-value is less than alpha(=0.05), **reject Ho**. Otherwise, Can not reject Ho.
{% endtab %}
{% endtabs %}



**EXAMPLE 15.** Perform the test of Note 8.48 "Example 13" using the _p_-value approach.

**\[ Solution ]**

We already know that the sample size is sufficiently large to validly perform the test.

* Steps 1–3 of the five-step procedure described in Section 8.3.2 "The " have already been done in Note 8.48 "Example 13". They tell us that the test is two-tailed and that value of the test statistic is $$z = 1.542.$$&#x20;
*   Step 4. Since the test is two-tailed the _p_-value is the double of the area under the standard normal curve cut off by the observed test statistic, $$z = 1.542.$$

    &#x20;By Figure 12.2 "Cumulative Normal Probability" that area is $$(1−0.9382)=0.0618$$ as illustrated in Figure 8.18, hence \
    &#x20;              the _p_-value is $$2×0.0618=0.1236.$$&#x20;
* Step 5. Since the _p_-value is **greater than** $$α=0.10$$ \
  &#x20;             the decision is **not to reject** $$H_0$$ .

Figure 8.18 _P_-Value for Note 8.50 "Example 15"

![](https://saylordotorg.github.io/text_introductory-statistics/section_12/65a0c37cb34d23ad1f8d640e3442bf18.jpg)

* Using **Rstat** Package : `bntest2.plot()`

{% tabs %}
{% tab title="R Source" %}
```
library(Rstat)

bntest2.plot(x=2625, n=5000, p0=0.5146, alp=0.10, side="two")
```
{% endtab %}

{% tab title="Result" %}
```
> bntest2.plot(x=2625, n=5000, p0=0.5146, alp=0.10, side="two")
## Exact Binomial Test:     x/n = 0.525     P-v = Σ[f(y) ≤ f(2625)] = 0.145 
## Normal approximation:    Z0 = 1.4714     P-v = 2×P(Z > |Z0|) = 0.1412 
## Continuity correction:   Z0 = 1.4573     P-v = 2×P(Z > |Z0|) = 0.145 
```
{% endtab %}

{% tab title="Plot" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-Lxt1HuyW_iqN0KBRVub%2F-Lxt2Wk1B-jNtpiYndXB%2Fimage.png?alt=media\&token=989b9dc9-e509-417b-b869-393300af98ff)

**\[Decision Rule]**

* p-value=0.1412 => if p-value is less than alpha(=0.10), reject Ho. Otherwise, **Can not reject Ho**.
{% endtab %}
{% endtabs %}
