3.2 Inference for Proportions
In earlier chapters, we used simulation-based methods to draw conclusions about population proportions. In the randomization tests and bootstrap confidence intervals chapters, we built randomization distributions and bootstrap confidence intervals; in the normal approximation chapter, we learned that the normal distribution provides a mathematical model for these sampling distributions when certain conditions are met. In this chapter, we bring everything together for proportions. We develop normal-based confidence intervals and hypothesis tests for a single proportion and for the difference between two proportions. Throughout, we compare these formula-based results to the simulation-based results from earlier chapters, reinforcing the idea that these are two routes to the same destination.
Key Concepts
- Find the mean and standard error for a distribution of sample proportions and difference in sample proportions
- Identify when a normal distribution is an appropriate model for a distribution of sample proportions
- Recognize when a two-sample \(z\)-interval for proportions is the appropriate statistical inference procedure
- State the conditions for the one-sample \(z\)-test for a single proportion and two-sample \(z\)-test for a difference in population proportions
- Use a normal distribution, when appropriate, to compute a confidence interval for a population proportion and difference in proportions between two populations
- Use a normal distribution, when appropriate, to test a hypothesis about a population proportion and for the difference in population proportions
The sampling distribution of the sample proportion
For categorical data, the goal is often to learn about a population proportion from a sample proportion. We can use the CLT to conduct inference about sample proportions if we have a large enough sample size.
To ensure that the sampling distribution of \(\widehat{p}\) is not too skewed for the normal approximation to work well, the success-failure condition requires that
- \(np \ge 10\) and
- \(n (1 - p) \ge 10\).
If a sample size is large enough, the CLT says that the distribution of all sample proportions (\(\widehat{p}\)) will follow a normal distribution that is centered at the population proportion (\(p\)). We can state these conditions precisely:
- Independence. The observations are independent (e.g., from a simple random sample)
- Success-failure condition. We expect to see at least 10 successes and 10 failures: \(np\geq10\) and \(n(1-p)\geq10\).
We previously discussed estimating the standard error of a statistic using a bootstrap distribution in Unit 2. When we use the CLT, we can estimate the standard error for a sample proportion by
\[ SE_{\widehat{p}} = \sqrt{ \frac{ p (1 - p) }{ n } } \]
where \(p\) is the population proportion, and \(n\) is the sample size.
Class Example 3.2.1: Use the CLT to estimate the standard error
For each of the following, find \(SE(\widehat{p})\).
- Samples of size \(n = 100\) from a population with \(p = 0.5\)
- Samples of size \(n = 200\) from a population with \(p = 0.5\)
- Samples of size \(n = 500\) from a population with \(p = 0.5\)
- What relationship did you notice from the answers from parts a) - c)?
So when the conditions are met, the sampling distribution is approximately
\[\hat{p} \sim N\!\left(p,\ \sqrt{\frac{p(1-p)}{n}}\right).\]
Class Example 3.2.2: Describe the sampling distribution
For each of the following questions, identify if you can use the CLT. If so, fully describe the distribution. If not, identify the smallest sample size you need in order to use the CLT.
- Samples of size \(n = 10\) from a population with \(p = 0.4\).
\(\widehat{p} \sim N(\)_______________ , _______________\()\) or Smallest \(n\): _______________
- Samples of size \(n = 100\) from a population with \(p = 0.6\).
\(\widehat{p} \sim N(\)_______________ , _______________\()\) or Smallest \(n\): _______________
- Samples of size \(n = 40\) from a population with \(p = 0.9\).
\(\widehat{p} \sim N(\)_______________ , _______________\()\) or Smallest \(n\): _______________
Class Example 3.2.3: Distributional Shape
For each of the scenarios in Example 3.2.2, go to the Sampling Distribution Lab in StatLens to generate the Sampling Distribution for the Proportion using 3000 samples. What distributional shape is exhibited in each case? Do the cases that satisfy the “large sample” requirements look normal as the CLT suggest they shoul
- Distributional shape:
- Distributional shape:
- Distributional shape:
Since we rarely know the true \(p\):
- For confidence intervals, use \(\hat{p}\) as the best guess: \(SE = \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\)
- For hypothesis tests, use \(p_0\) (the value from \(H_0\)): \(SE = \sqrt{\frac{p_0(1-p_0)}{n}}\)
Confidence intervals for a single proportion
We can only use the CLT for confidence intervals if
-\(n \widehat{p} \ge 10\)and -\(n (1 - \widehat{p}) \ge 10\)
In the previous chapter, we defined the general confidence interval formula using the normal distribution: \[\text{point estimate} \pm z^* \times SE.\]
Provided that the success-failure condition holds, we can substitute the point estimate with \(\widehat{p}\), our best guess at \(p\), and \(SE = \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\), the spread of the sampling statistic. A confidence interval for a population proportion \(p\) can be constructed using
\[\hat{p} \pm z^* \times \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}\]
where \(z^*\) is the critical value for the desired confidence level (e.g., \(z^* = 1.96\) for 95%). Recall from the previous chapter, we stated common \(z^*\) values:
| Confidence | \(z^*\) |
|---|---|
| 90% | 1.645 |
| 95% | 1.960 |
| 99% | 2.575 |
We can also use technology, like StatLens or jamovi, or a table to get other \(z^*\) values.
Class Example 3.2.4: Finding\(z^*\)
Find the \(z^*\) values for the following confidence intervals.
- 92%:
- 85%:
- 80%:
Class Example 3.2.5: Left-handed desks
A university would like to estimate the proportion of its students that are left-handed to purchase new desks for a building renovation. They take a random sample of 300 students and find that 32 people in the sample are left-handed.
- Using the CLT find a 95% confidence interval for the proportion of students that are left-handed.
- Provide an interpretation for your interval in a).
- The Vice Chancellor for facilities decides that 15% of the desks they order should be left-handed. Use the confidence interval in a) to argue whether or not this will be an adequate proportion of left-handed desks.
Class Example 3.2.6: Adopting a child in the US revisited
A survey of 1000 randomly selected American adults conducted in January 2013 stated that “44% say its too hard to adopt a child in the US.”
- Using the CLT find a 99% confidence interval for the proportion of American adults who think it is too difficult to adopt.
- Provide an interpretation for your interval in a).
- Use the confidence interval in a) to argue whether or not a majority of American adults believe that it is too difficult to adopt.
- How would this confidence interval change if the 44% figure was based on a sample size of 2000 adults instead of 1000?
Determining Sample Size for Estimating a Proportion
In the confidence interval for the population proportion, we have a margin of error of \[ ME = z^* \sqrt{\frac{p(1-p)}{n}}.\]
If we solve this expression for \(n\), we obtain \[n = \left(\frac{z^*}{ME}\right)^2\widehat{p}(1-\widehat{p}).\]
Unfortunately, we are trying to determine the sample size which means that we likely haven’t taken a sample yet. This means we don’t have a value for \(\widehat{p}\). There are two options for replacing this value in the equation for \(n\) above.
- If we have some idea of what the proportion might be perhaps from taking a preliminary small sample, we can use this value in place of \(\widehat{p}\).
- If we are not willing to make a reasonable guess, we use a value of 0.5. This is the conservative approach as it will make \(n\) the largest it can be with all other values fixed.
Often times the formula for \(n\) will not produce a whole number. In these cases, we always round up to the next whole number.
Class Example 3.2.7: Sample size determination 1
Consider the previous example on adopting a child. Using the 44% figure from the initial poll, how large of a sample size is needed to estimate the proportion of adults that say it is too hard to adopt a child in the US to within \(\pm 2\)% with 99% confidence.
Class Example 3.2.8: Sample size determination 2
A company produces plastic bottles. Because millions of bottles are produced each day, they are unable to check every bottle for defects. Instead, they check a sample of bottles each day to estimate the population proportion of defectives. If no preliminary sample is taken, how large a sample of bottles is needed to obtain a 95% confidence interval that estimates the population proportion within \(\pm 4\)%?
Hypothesis test for a single proportion
Recall that provided the sample size is large enough, then according to the CLT,
\[ \widehat{p} \sim N\left(p, \sqrt{ \frac{ p (1 - p) }{ n } }\right). \]
We can use this fact to conduct a hypothesis test. In general, if the distribution is normal, then we can comput a \(p\)-value using a standard normal curve and a standardized test statisics of the form
\[ x = \frac{\text{Sample Statistic} - \text{Null Value}}{SE}.\]
As with the hypothesis tests we discussed in Unit 2, there are a specific set of steps to conduct a hypothesis test using the CLT.
Step 1: Check conditions for the test
We can only use the CLT for a hypothesis test if
- \(n p_0 \ge 10\) and
- \(n (1 - p_0) \ge 10\)
Check whether both \(n p_0 \ge 10\) and \(n (1 - p_0) \ge 10\) are true.
Step 2: State the hypotheses
For a single proportion, the null hypothesis always has the form
\[ H_0{:} \hspace{.5em} p = p_0 \]
where \(p_0\) is a number that represents the proportion claimed or status quo value. The alternative hypothesis has one of the following three forms:
\[ \begin{aligned} H_A{:} & \hspace{.5em} p < p_0\\ H_A{:} & \hspace{.5em} p > p_0\\ H_A{:} & \hspace{.5em} p\neq p_0 \end{aligned} \]
Step 3: Calculate the test statistic
To conduct the hypothesis test using the CLT, we use a standardized test statistic of
\[ z = \frac{ \widehat{p} - p_0 }{\sqrt{ \frac{p_0 (1 - p_0) }{ n }}} \]
which follows a \(N(0, 1)\) distribution.
Step 4: Find the \(p\)-value
To find the \(p\)-value, you must use technology to find what proportion of the standard normal distribution is more extreme than the test statistic (in the direction of the alternative hypothesis). If your alternative is two-sided, then you multiply the one-sided \(p\)-value by 2.
Step 5: State your decision and interpret in the context of the hypotheses
As with the randomization hypothesis test, you make your decision based upon the \(p\)-value from step 3.
- If \(p\)-value \(< \alpha\)
- Decision: reject \(H_0\),
- Interpretation: We have discernible evidence to suggest that the alternative hypothesis is correct.
- If \(p\)-value \(\ge \alpha\)
- Decision: fail to reject \(H_0\)
- Interpretation: We do not have discernible evidence to suggest that the alternative hypothesis is correct.
You should always write your interpretation in the context of the original hypothesis.
How to draw a sketch to illustrate the \(p\)-value
Class Example 3.2.9: Infected Trees
A ponderosa pine forest in Colorado has a pine beetle infestation. The beetles bore into a tree and carry a fungus that ultimately kills the tree. The forest can be treated and not eliminated if the proportion of infested trees in the forest is less than 20%. In a random sample of 180 trees, it was found that 26 trees were infested. Based on this data and a 5% level of significance, should the forest be treated?
- Define the relevant parameter(s) and state the null and alternative hypotheses. Be sure to check any relevant conditions.
- What is the test statistic?
- Find the \(p\)-value, and give a sketch to illustrate your \(p\)-value.
- State your decision and interpret your findings in the context of the study
Class Example 3.2.10: Cereal example from Unit 2 revisited
Recall the motivating example in Unit 2 where researchers were interested in whether children showed a preference for the cereal box that had cartoons on it. In the sample of 80 children, 52 chose the box with cartoons. Conduct a hypothesis test at the 5% level (include all steps) to determine if children prefer cereal with cartoon marketing.
Class Example 3.2.11: Plato’s Republic: Syllable Patterns
Prose rhythm is characterized as the occurrence of five-syllable sequences in long passages of text. This characterization may be used to assess the similarity among passages of text and sometimes the identity of authors. Syllables are often categorized as long or short. On analyzing Plato’s Republic, researchers found that 26.1% of the five-syllable sequences contained two short and three long syllables (Wishart and Leach, Computer Studies of the Humanities and Verbal Behavior, Vol.3, pp. 90-99). Suppose that Greek archaeologists have found an ancient manuscript dating back to Plato’s time (about 427-347 B.C.E.). A random sample of 317 five-syllable sequences from the newly discovered manuscript showed that 61 contained two short and three long syllables. Do the data indicate that the population proportion of this type of five-syllable sequence is different from the text of Plato’s Republic? You may either use a 95% confidence interval or hypothesis test (use \(\alpha = 0.05\)) to support your conclusion.
Class Activity: Taste test and Vulcan Salute group activity
Difference of two proportions
Consider two samples of sizes \(n_1\) and \(n_2\) that come from populations with proportions \(p_1\) and \(p_2\), respectively. It is a property of sample proportions that the distribution of all differences in sample proportions (\(\widehat{p}_1\)and \(\widehat{p}_2\)) will be centered at the true population difference in proportions (\(p_1 - p_2\)). When the samples are independent of each other, the standard error of \(\widehat{p}_1 - \widehat{p}_2\) is \[ SE_{\widehat{p}_1 - \widehat{p}_2} = \sqrt{ \frac{ p_1(1-p_1)}{n_1} + \frac{ p_2(1-p_2)}{ n_2}}. \]
Using statistical notation, the sampling distribution of \(\widehat{p}_1 - \widehat{p}_2\) for “large” samples can be summarized as \[ \widehat{p}_{1} - \widehat{p}_{2} \sim N \left(p_{1} - p_{2},\sqrt{\frac{ p_1(1-p_1)}{n_1} + \frac{ p_2(1-p_2)}{ n_2}}\right) \]
As with single proportions, the population proportions (\(p_1\) and \(p_2\)) are rarely ever known (which is why we are estimating them in the first place!), so they are estimated by the corresponding sample proportions \(\widehat{p}_1\) and \(\widehat{p}_2\). According to the Central Limit Theorem, when the sample sizes are large enough the sampling distribution of \(\widehat{p}_1 - \widehat{p}_2\) follows a normal distribution.
Class Example 3.2.12: Proportion of Elderly, Florida and Texas
From the 2010 US Census, we learn that 17.6% of the residents of Florida are 65 years old or older while 10.5% of the residents of Texas are 65 years old or older. If independent, random samples of 300 Florida residents and 200 Texas residents are selected and the difference in the proportion of elderly residents (\(p_{FL} - p_{TX}\)) is calculated:
- Describe the shape of the sampling distribution of differences in sample proportions.
- What is the mean of the distribution of differences in sample proportions.
- Find the standard error of the distribution of differences in sample proportions.
In order to be able to use the standard normal distribution to construct a CI for a difference in proportions, the following conditions must be satisfied.
- The two samples must be randomly selected.
- The two samples must be independent of each other.
- The success-failure condition must be met separately for each group; \(n_1\widehat{p}_1 \ge 10\), \(n_1(1-\widehat{p}_1) \ge 10\), \(n_2\widehat{p}_2 \ge 10\), and \(n_2(1-\widehat{p}_2) \ge 10\) is a good guideline to follow.
Confidence intervals for a difference in proportions
Provided that the conditions are met, the difference between two unknown population proportions can be estimated with a confidence interval as
\[ ( \widehat{p}_1 - \widehat{p}_2) \pm z^* \sqrt{ \frac{ \widehat{p}_1 (1 - \widehat{p} _1) }{ n_1 } + \frac{ \widehat{p}_2 (1 - \widehat{p} _2) }{ n_2 }} \]
where \(z^*\) is the appropriate critical value for the desired level of confidence from a \(N(0, 1)\) distribution.
Class Example 3.2.13: Mobile Connections to Libraries
In a random sample of 2,252 Americans age 16 and older, 11% of the 1,059 men and 16% of the 1,193 women said they have accessed library services via a mobile device.
- What must be assumed in order to construct a confidence interval for the difference in proportions?
- Find and interpret a 95% confidence interval for the difference in proportions accessing libraries via mobile devices, between men and women.
- Does your interval in (b) suggest that there is a difference in the proportions of men and women accessing libraries via mobile devices? Which population has a higher proportion?
Class Example 3.2.14: Seat belt use
We are interested in comparing the proportions of high school and college students in Wisconsin who always wear seat belts. In a random sample of 712 high school students, 615 say they always use seat belts. In a random sample of 641 college students, 578 always use seat belts. Compute a 95% confidence interval for the difference in the population proportions of high school and college students in WI who report always wearing their seat belt. Does this interval suggest that the population proportion is higher for either group?
Hypothesis test for a difference in proportions
Two unknown population proportions can be compared using a hypothesis test by following the steps below.
Step 1: Check the conditions
- The two samples must be randomly selected,
- The two samples must be independent of each other,
- The success-failure condition for each group; \(n_1\widehat{p}_1 \ge 10\), \(n_1(1-\widehat{p}_1) \ge 10\), \(n_2\widehat{p}_2 \ge 10\), and \(n_2(1-\widehat{p}_2) \ge 10\).
Step 2: State the hypotheses
\(H_0: p_1 - p_2 = 0\) is equivalent to writing \(H_0: p_1 = p_2\).
For a difference in averages, the null hypothesis always has the form
\[ H_0{:} \hspace{.5em} p_1 - p_2 = 0 \]
The alternative hypothesis has one of the following three forms:
\[ \begin{aligned} H_A{:} & \hspace{.5em} p_1 - p_2 < 0\\ H_A{:} & \hspace{.5em} p_1 - p_2 > 0\\ H_A{:} & \hspace{.5em} p_1 - p_2 \neq 0 \end{aligned} \]
Step 3: Calculate the test statistic
To conduct the hypothesis test, a standardized test statistic of
\[ z_0 = \frac{ \widehat{p}_1 - \widehat{p}_2 }{ \sqrt{ \frac{ \widehat{p} (1 - \widehat{p} ) } { n_1 } + \frac{ \widehat{p} (1 - \widehat{p} ) }{ n_2 }}} \]
where
\[ \widehat{p}=\frac{x_1 + x_2}{n_1 + n_2}. \]
\(\widehat{p}\) represents the overall proportion of successes under the presumption that \(H_0\) is true. Since \(p_1 - p_2 = 0\) implies that \(p_1=p_2\), then the two independent random samples could be seen as coming from one sample of size \(n_1+n_2\). Furthermore, \(x_1\) and \(x_2\) denote the observed number of successes in samples 1 and 2, respectively. The sampling distribution of this test statistic is a standard normal distribution for large samples.
Step 4: Find the \(p\)-value
To determine the \(p\)-value, we find what proportion of the standard normal distribution is more extreme than the test statistic (in the direction of the alternative hypothesis). If your alternative is two-sided, then you multiply the one-sided \(p\)-value by 2.
Step 5: State your conclusion and interpret in the context of the hypotheses
As with the randomization hypothesis test, you make your decision based on the \(P\)-value from step 4.
- If \(p\)-value \(< \alpha\)
- Conclusion: reject \(H_0\),
- Interpretation: There is discernible evidence to suggest that . . . (the alternative hypothesis is true).
- If \(p\)-value \(\ge \alpha\)
- Conclusion: fail to reject \(H_0\)
- Interpretation: There is not discernible evidence to suggest that . . . (the alternative hypothesis is true).
Always write the interpretation in the context of the original hypothesis.
Class Example 3.2.15: Accuracy of Lie Detectors
Participants in a study to evaluate the accuracy of lie detectors were divided into two groups, with one group reading true material and the other group reading false material, while connected to a lie detector. The two way table indicates whether the participants were lying or telling the truth and also whether the lie detector indicated they were lying or not. We are interested in determining if there is a difference in the proportion of times the lie detector says the person is lying, depending on whether the person is lying or telling the truth.
| Detector says lying | Detector says not | Total | |
|---|---|---|---|
| Person lying | 31 | 17 | 48 |
| Person not lying | 27 | 21 | 48 |
| Total | 58 | 38 | 96 |
- Are the conditions met for the two-sample test for proportions? Verify your answer.
- Find the three sample proportions for the proportion of times the lie detector says the person is lying (the proportion for the lying people, the proportion for the truthful people, and the pooled proportion)
- Test to see if there is a difference in the proportion of times the lie detector says the person is lying, depending on whether the person is lying or telling the truth. Use a 5% level of significance and show all details of the test.
Class Example 3.2.16: Tagging Penguins
A study was conducted to see if tagging penguins with metal tags harms them. In the study, 100 penguins were randomly assigned to receive a metal tag or (as a control group) an electronic tag. One of the variables studied is survival rate ten years after the penguins were tagged. The scientists observed that 20% of the 50 metal tagged penguins survived while 36% of the 50 electronically tagged penguins survived.
- Are the conditions met for using the normal distribution? Verify your answer.
- Define the two population proportions \(p_1\) and \(p_2\).
- Test at \(\alpha = 0.05\) to see if the survival rate is lower for all metal tagged penguins than for all electronically tagged penguins. Do metal tags appear to reduce survival rate in penguins?
Class Activity: Orange Candies group activity
Summary
This chapter developed normal-based inference methods for proportions:
- Success-failure condition. The normal approximation for \(\hat{p}\) requires at least 10 expected successes and 10 expected failures. For confidence intervals, check with \(\hat{p}\); for hypothesis tests, check with \(p_0\).
- CI for one proportion: \(\hat{p} \pm z^* \times \sqrt{\hat{p}(1-\hat{p})/n}\). Use \(\hat{p}\) in the SE.
- Hypothesis test for one proportion: \(Z = \frac{\hat{p} - p_0}{\sqrt{p_0(1-p_0)/n}}\). Use \(p_0\) in the SE.
- CI for difference of proportions: \((\hat{p}_1 - \hat{p}_2) \pm z^* \times SE\), where \(SE\) uses separate sample proportions.
- Hypothesis test for difference of proportions: \(Z = \frac{\hat{p}_1 - \hat{p}_2}{SE}\), where \(SE\) uses \(SE_{\widehat{p}_1 - \widehat{p}_2}\).
- Confidence level is controlled by \(z^*\): higher confidence means wider intervals.