Skip to main content
Statistics LibreTexts

6.1: Inference for a single proportion

  • Page ID
    56941
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    We encountered inference methods for a single proportion in Chapter [ch_foundations_for_inf], exploring point estimates, confidence intervals, and hypothesis tests. In this section, we’ll do a review of these topics and also how to choose an appropriate sample size when collecting data for single proportion contexts.

    Identifying when the sample proportion is nearly normal

    A sample proportion \(\hat{p}\) can be modeled using a normal distribution when the sample observations are independent and the sample size is sufficiently large.

    Sampling distribution of \(\pmb{\hat{\MakeLowercase{p}}}\) The sampling distribution for \(\hat{p}\) based on a sample of size \(n\) from a population with a true proportion \(p\) is nearly normal when:

    1. The sample’s observations are independent, e.g. are from a simple random sample.
    2. We expected to see at least 10 successes and 10 failures in the sample, i.e. \(np\geq10\) and \(n(1-p)\geq10\). This is called the .

    When these conditions are met, then the sampling distribution of \(\hat{p}\) is nearly normal with mean \(p\) and standard error \(SE = \sqrt{\frac{\ p(1-p)\ }{n}}\).

    Typically we don’t know the true proportion \(p\), so we substitute some value to check conditions and estimate the standard error. For confidence intervals, the sample proportion \(\hat{p}\) is used to check the success-failure condition and compute the standard error. For hypothesis tests, typically the null value – that is, the proportion claimed in the null hypothesis – is used in place of \(p\).

    Confidence intervals for a proportion

    A confidence interval provides a range of plausible values for the parameter \(p\), and when \(\hat{p}\) can be modeled using a normal distribution, the confidence interval for \(p\) takes the form

    \[\begin{aligned} \hat{p} \pm z^{\star} \times SE\end{aligned}\]

    A simple random sample of 826 payday loan borrowers was surveyed to better understand their interests around regulation and costs. 70% of the responses supported new regulations on payday lenders. Is it reasonable to model \(\hat{p} = 0.70{}\) using a normal distribution? The data are a random sample, so the observations are independent and representative of the population of interest.

    We also must check the success-failure condition, which we do using \(\hat{p}\) in place of \(p\) when computing a confidence interval:

    \[\begin{aligned} \text{Support: } n p & \approx 826{} \times 0.70{} = 578 &\text{Not: } n (1 - p) & \approx 826{} \times (1 - 0.70{}) = 248 \end{aligned}\]

    Since both values are at least 10, we can use the normal distribution to model \(\hat{p}\).

    [seOfPropOfPDBorrowersSupportReg] Estimate the standard error of \(\hat{p} = 0.70{}\). Because \(p\) is unknown and the standard error is for a confidence interval, use \(\hat{p}\) in place of \(p\) in the formula.

    Construct a 95% confidence interval for \(p\), the proportion of payday borrowers who support increased regulation for payday lenders. Using the point estimate 0.70, \(z^{\star} = 1.96\) for a 95% confidence interval, and the standard error \(SE = 0.016{}\) from Guided Practice [seOfPropOfPDBorrowersSupportReg], the confidence interval is

    \[\begin{aligned} \text{point estimate} \ \pm\ z^{\star} \times SE \quad\to\quad 0.70{} \ \pm\ 1.96 \times 0.016{} \quad\to\quad (0.669{}, 0.731{}) \end{aligned}\]

    We are 95% confident that the true proportion of payday borrowers who supported regulation at the time of the poll was between 0.669 and 0.731.

    For additional one-proportion confidence interval examples, see Section [confidenceIntervals].

    Hypothesis testing for a proportion

    One possible regulation for payday lenders is that they would be required to do a credit check and evaluate debt payments against the borrower’s finances. We would like to know: would borrowers support this form of regulation?

    [paydayCC_hypotheses_gp] Set up hypotheses to evaluate whether borrowers have a majority support or majority opposition for this type of regulation.

    To apply the normal distribution framework in the context of a hypothesis test for a proportion, the independence and success-failure conditions must be satisfied. In a hypothesis test, the success-failure condition is checked using the null proportion: we verify \(np_0\) and \(n(1-p_0)\) are at least 10, where \(p_0\) is the null value.

    [paydayCC_conditions_gp] Do payday loan borrowers support a regulation that would require lenders to pull their credit report and evaluate their debt payments? From a random sample of 826 borrowers, 51% said they would support such a regulation. Is it reasonable to model \(\hat{p} = 0.51{}\) using a normal distribution for a hypothesis test here?

    Using the hypotheses and data from Guided Practice [paydayCC_hypotheses_gp] and [paydayCC_conditions_gp], evaluate whether the poll provides convincing evidence that a majority of payday loan borrowers support a new regulation that would require lenders to pull credit reports and evaluate debt payments. With hypotheses already set up and conditions checked, we can move onto calculations. The standard error in the context of a one-proportion hypothesis test is computed using the null value, \(p_0\):

    \[\begin{aligned} SE = \sqrt{\frac{p_0 (1 - p_0)}{n}} = \sqrt{\frac{0.5 (1 - 0.5)}{826{}}} = 0.017{} \end{aligned}\]

    A picture of the normal model is shown below with the p-value represented by the shaded region.

    Based on the normal model, the test statistic can be computed as the Z-score of the point estimate:

    \[\begin{aligned} Z = \frac{\text{point estimate} - \text{null value}}{SE} = \frac{0.51{} - 0.50}{0.017{}} = 0.59{} \end{aligned}\]

    The single tail area is 0.2776, and the p-value, represented by both tail areas together, is 0.5552. Because the p-value is larger than 0.05, we do not reject \(H_0\). The poll does not provide convincing evidence that a majority of payday loan borrowers support or oppose regulations around credit checks and evaluation of debt payments.

    For additional one-proportion hypothesis test examples, see Section [hypothesisTesting].

    When one or more conditions aren’t met

    We’ve spent a lot of time discussing conditions for when \(\hat{p}\) can be reasonably modeled by a normal distribution. What happens when the success-failure condition fails? What about when the independence condition fails? In either case, the general ideas of confidence intervals and hypothesis tests remain the same, but the strategy or technique used to generate the interval or p-value change.

    When the success-failure condition isn’t met for a hypothesis test, we can simulate the null distribution of \(\hat{p}\) using the null value, \(p_0\). The simulation concept is similar to the ideas used in the malaria case study presented in Section [caseStudyMalariaVaccine], and an online section outlines this strategy:

    For a confidence interval when the success-failure condition isn’t met, we can use what’s called the . The details are beyond the scope of this book. However, there are many internet resources covering this topic.

    The independence condition is a more nuanced requirement. When it isn’t met, it is important to understand how and why it isn’t met. For example, if we took a cluster sample (see Section [section_obs_data_sampling]), suitable statistical methods are available but would be beyond the scope of even most second or third courses in statistics. On the other hand, we’d be stretched to find any method that we could confidently apply to correct the inherent biases of data from a convenience sample.

    While this book is scoped to well-constrained statistical problems, do remember that this is just the first book in what is a large library of statistical methods that are suitable for a very wide range of data and contexts.

    Choosing a sample size when estimating a proportion

    When collecting data, we choose a sample size suitable for the purpose of the study. Often times this means choosing a sample size large enough that the – which is the part we add and subtract from the point estimate in a confidence interval – is sufficiently small that the sample is useful. For example, our task might be to find a sample size \(n\) so that the sample proportion is within \(\pm 0.04\) of the actual proportion in a 95% confidence interval.

    A university newspaper is conducting a survey to determine what fraction of students support a $200 per year increase in fees to pay for a new football stadium. How big of a sample is required to ensure the margin of error is smaller than 0.04 using a 95% confidence level? The margin of error for a sample proportion is

    \[\begin{aligned} z^{\star} \sqrt{\frac{p (1 - p)}{n}} \end{aligned}\]

    Our goal is to find the smallest sample size \(n\) so that this margin of error is smaller than \(0.04\). For a 95% confidence level, the value \(z^{\star}\) corresponds to 1.96:

    \[\begin{aligned} 1.96\times \sqrt{\frac{p(1-p)}{n}} \ < \ 0.04 \end{aligned}\]

    There are two unknowns in the equation: \(p\) and \(n\). If we have an estimate of \(p\), perhaps from a prior survey, we could enter in that value and solve for \(n\). If we have no such estimate, we must use some other value for \(p\). It turns out that the margin of error is largest when \(p\) is 0.5, so we typically use this worst case value if no estimate of the proportion is available:

    \[\begin{aligned} 1.96\times \sqrt{\frac{0.5(1-0.5)}{n}} &\ < \ 0.04 \\ 1.96^2\times \frac{0.5(1-0.5)}{n} &\ < \ 0.04^2 \\ 1.96^2\times \frac{0.5(1-0.5)}{0.04^2} &\ < \ n \\ 600.25 &\ < \ n \end{aligned}\]

    We would need over 600.25 participants, which means we need 601 participants or more, to ensure the sample proportion is within 0.04 of the true proportion with 95% confidence.

    When an estimate of the proportion is available, we use it in place of the worst case proportion value, 0.5.

    [tire_failure_rate_3_samp_size_calc] A manager is about to oversee the mass production of a new tire model in her factory, and she would like to estimate what proportion of these tires will be rejected through quality control. The quality control team has monitored the last three tire models produced by the factory, failing 1.7% of tires in the first model, 6.2% of the second model, and 1.3% of the third model. The manager would like to examine enough tires to estimate the failure rate of the new tire model to within about 1% with a 90% confidence level. There are three different failure rates to choose from. Perform the sample size computation for each separately, and identify three sample sizes to consider.

    The sample sizes vary widely in Guided Practice [tire_failure_rate_3_samp_size_calc]. Which of the three would you suggest using? What would influence your choice? We could examine which of the old models is most like the new model, then choose the corresponding sample size. Or if two of the previous estimates are based on small samples while the other is based on a larger sample, we might consider the value corresponding to the larger sample. There are also other reasonable approaches.

    Also observe that the success-failure condition would need to be checked in the final sample. For instance, if we sampled \(n = 1584\) tires and found a failure rate of 0.5%, the normal approximation would not be reasonable, and we would require more advanced statistical methods for creating the confidence interval.

    Suppose we want to continually track the support of payday borrowers for regulation on lenders, where we would conduct a new poll every month. Running such frequent polls is expensive, so we decide a wider margin of error of 5% for each individual survey would be acceptable. Based on the original sample of borrowers where 70% supported some form of regulation, how big should our monthly sample be for a margin of error of 0.05 with 95% confidence?


    This page titled 6.1: Inference for a single proportion is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by David Diez, Christopher Barr, & Mine Çetinkaya-Rundel via source content that was edited to the style and standards of the LibreTexts platform.