---
description: 样本率/样本比例
---

# 6-3. The Sample Proportion

## 1. Sample Proportion

Often sampling is done in order to estimate the proportion of a population that has a specific characteristic, such as the proportion of all items coming off an assembly line that are defective or the proportion of all people entering a retail store who make a purchase before leaving.&#x20;

The population proportion is denoted _p_ and the sample proportion is denoted $$\hat{p}$$ . Thus if in reality 43% of people entering a store make a purchase before leaving, _p_ = 0.43; if in a sample of 200 people entering the store, 78 make a purchase, $$\hat{p}$$=78/200=0.39.&#x20;

> **The sample proportion is a random variable:** it varies from sample to sample in a way that cannot be predicted with certainty. Viewed as a random variable it will be written $$\hat{P}$$ . It has a **mean** $$μ_\hat{P}$$ and a **standard deviation** $$σ_\hat{P}$$ . Here are formulas for their values.
>
> Suppose random samples of size _n_ are drawn from a population in which the proportion with a characteristic of interest is _p_. The mean  $$μ_\hat{P}$$ and standard deviation $$σ_\hat{P}$$ of the sample proportion $$\hat{P}$$ satisfy&#x20;
>
> &#x20;                                           $$μ_\hat{P} = p$$  and  $$σ_\hat{P} = \sqrt{  \frac{pq}{n}   }$$     &#x20;
>
> where $$q=1−p$$ .

The Central Limit Theorem has an analogue for the population proportion $$\hat{P}$$. To see how, imagine that every element of the population that has the characteristic of interest is labeled with a 1, and that every element that does not is labeled with a 0. This gives a numerical population consisting entirely of zeros and ones. Clearly the proportion of the population with the special characteristic is the proportion of the numerical population that are ones; in symbols,

&#x20;                                                                    $$p=\frac{number of 1s} {N}$$&#x20;

But of course the sum of all the zeros and ones is simply the number of ones, so the mean _μ_ of the numerical population is

&#x20;                                                              $$μ=\frac{Σx}{N}=\frac{number of 1s}{N}$$&#x20;

Thus the population proportion _p_ is the same as the mean _μ_ of the corresponding population of zeros and ones. In the same way the sample proportion $$\hat{p}$$ is the same as the sample mean $$\bar{x}$$. Thus the Central Limit Theorem applies to$$\hat{P}$$. However, the condition that the sample be large is a little more complicated than just being of size at least 30.

####

## 2. The Sampling Distribution of the Sample Proportion

> For large samples, the sample proportion is approximately normally distributed,&#x20;
>
> with mean                                      $$μ_\hat{P}=p$$    &#x20;
>
> and standard deviation                  $$σ_\hat{P}= \sqrt{ \frac{pq}{n}}$$     &#x20;
>
> A sample is large if the interval $$[ p − 3 σ_\hat{P}, \space \space p + 3 σ_\hat{P}]$$ lies wholly within the interval $$[0,1]$$ .



In actual practice _**p**_**&#x20;is not known**, hence neither is $$σ_\hat{P}$$. In that case in order to check that the sample is sufficiently large we substitute the known quantity $$\hat{p}$$ for $$p$$ . This means checking that the interval

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

lies wholly within the interval $$[0,1]$$. This is illustrated in the examples.

Figure "Distribution of Sample Proportions" shows that when _p_ = 0.1 a sample of size 15 is too small but a sample of size 100 is acceptable.&#x20;

![Distribution of Sample Proportions](https://saylordotorg.github.io/text_introductory-statistics/section_10/1f88d2a9e0be51323bf4afea7ec3a305.jpg)

Figure "Distribution of Sample Proportions for " shows that when _p_ = 0.5 a sample of size 15 is acceptable.

![Distribution of Sample Proportions for p = 0.5 and n = 15](https://saylordotorg.github.io/text_introductory-statistics/section_10/50631caf59b26b1b3cdb66efe4c303ac.jpg)

####

**EXAMPLE 7.**  Suppose that in a population of voters in a certain region 38% are in favor of particular bond issue. Nine hundred randomly selected voters are asked if they favor the bond issue.

1. Verify that the sample proportion $$\hat{P}$$ computed from samples of size 900 meets the condition that its sampling distribution be approximately normal.
2. Find the probability that the sample proportion computed from a sample of size 900 will be within 5 percentage points of the true population proportion.

**\[ Solution ]**

1. $$μ_\hat{P} =p=0.38$$  and   $$σ_\hat{P}=\sqrt{  \frac{pq } {n} } =\sqrt{  \frac{(0.38)(0.62)}{900}} = 0.016$$  \
   &#x20; Then $$3σ_\hat{P} =3(0.01618)=0.04854≈0.05.$$  \
   so   $$[p−3σ_\hat{P},p+3σ_\hat{P}]=[0.38−0.05,0.38+0.05]=[0.33,0.43]$$ \
    which lies wholly within the interval \[0,1], so it is safe to assume that $$\hat{P}$$ is approximately normally distributed.\

2. $$P(0.33<\hat{P}<0.43)$$ \
   &#x20;$$=P(\frac{0.33−μ_\hat{P} }{ \sigma_\hat{P}}<Z<\frac{0.43−μ_\hat{P} }{ \sigma_\hat{P}})$$ \
   &#x20;$$=P(−3.09<Z<3.09)$$ \
   &#x20;$$=P(3.09)−P(−3.09)$$ \
   &#x20;$$=0.9990−0.0010=0.9980$$

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

# 2.
mu <- 0.38; 
n <- 900; sig <- sqrt(mu * (1-mu) / n)
sig
 
a <- 0.33;  b <- 0.43
norm.trans(mu, sig, a, b)

```
{% endtab %}

{% tab title="2. Probability" %}
```
> # 2.
> mu <- 0.38; 
> n <- 900; sig <- sqrt(mu * (1-mu) / n)
> sig
## [1] 0.01617955
>  
> a <- 0.33;  b <- 0.43
> norm.trans(mu, sig, a, b)
## Pr(0.33 < X < 0.43) =  0.9980006 
## Pr(-3.0903 < Z < 3.0903) =  0.9980006 
```
{% endtab %}

{% tab title="2-Plot" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LxctVslBDl6_23_fWhE%2F-LxcuTW1VMI2YtbaGbJN%2Fimage.png?alt=media\&token=e6ca9cf3-fc79-4b6a-8134-2ee257ab1eef)
{% endtab %}
{% endtabs %}



**EXAMPLE 8.**  An online retailer claims that 90% of all orders are shipped within 12 hours of being received. A consumer group placed 121 orders of different sizes and at different times of day; 102 orders were shipped within 12 hours.

1. Compute the sample proportion of items shipped within 12 hours.
2. Confirm that the sample is large enough to assume that the sample proportion is normally distributed. Use _p_ = 0.90, corresponding to the assumption that the retailer’s claim is valid.
3. Assuming the retailer’s claim is true, find the probability that a sample of size 121 would produce a sample proportion so low as was observed in this sample.
4. Based on the answer to part (3), draw a conclusion about the retailer’s claim.

**\[ Solution ]**

1. &#x20;$$\hat{p} = \frac{x}{n} =\frac{102}{121} = 0.84$$&#x20;
2. $$[p−3σ_\hat{P},p+3_\hat{P}] =[ 0.90-0.08, 0.90 +0.08] = [0.82, 0.98]$$ $$[0.82, 0.98]⊂[0,1]$$&#x20;
3. $$P(\hat{P}≤0.84)$$ $$=P(Z≤ \frac{0.84−μ_\hat{P}}{σ_\hat{P}})$$ \
   &#x20;      $$=P(Z≤\frac{0.84−0.90} {0.027})$$ \
   &#x20;      $$=P(Z≤−2.20)=0.0139$$&#x20;

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

# 1. 

# 2.
mu <- 0.90; 
n <- 121; sig <- sqrt(mu * (1-mu) / n)
sig
 
a <- 0;  b <- 0.84
norm.trans(mu, sig, a, b)
```
{% endtab %}

{% tab title="2. Probability" %}
```
> mu <- 0.90; 
> n <- 121; sig <- sqrt(mu * (1-mu) / n)
> sig
## [1] 0.02727273
>  
> a <- 0;  b <- 0.84
> norm.trans(mu, sig, a, b)
## Pr(0 < X < 0.84) =  0.01390345 
## Pr(-33 < Z < -2.2) =  0.01390345 
```
{% endtab %}

{% tab title="2-Plot" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LxctVslBDl6_23_fWhE%2F-LxcvoyKD9rA2-AuKpqC%2Fimage.png?alt=media\&token=6d712fd8-ecc3-42cd-adfb-f87b1cb7c759)
{% endtab %}
{% endtabs %}



**样本率/样本比例** sample proportion
