Tutorials › VEE Mathematical Statistics › Z Tests for One Population Proportion

VEE Mathematical Statistics · Classical Tests and Goodness of Fit · Tutorial 678 of 880

Z Tests for One Population Proportion

Use a sample proportion to test a hypothesized population proportion, while checking when the normal approximation is reliable.

Intermediate 10 min read

What You'll Learn

  • Identify the Bernoulli sampling model and state one- or two-sided hypotheses for a population proportion.
  • Calculate the z statistic using the standard error specified by the null hypothesis.
  • Check the expected success and failure counts before using a normal approximation.
  • Find and interpret a one- or two-sided p-value and make a decision at a stated significance level.
  • Recognize why substituting the observed proportion into the test standard error changes the procedure.

Testing a Population Proportion

Many statistical questions concern the fraction of a population with a particular characteristic: the proportion of applications containing an error, devices that pass inspection, or patients who experience a specified outcome. When each sampled unit has one of two outcomes, the data can be represented by a success count and a sample proportion. A one-sample z test uses that proportion to assess a claim about the population proportion.

The procedure is appropriate when the observations can be treated as independent Bernoulli trials with a common success probability, and the sample is large enough for a normal approximation under the null hypothesis. The standard error in the test statistic is calculated from the null value, not from the observed sample proportion.

Definition: Let \(p\) be the population proportion of units with the outcome designated as a success. In a sample of fixed size \(n\), let \(X\) be the number of successes and let \(\hat p=X/n\) be the sample proportion. For a test of \(H_0:p=p_0\), the one-sample proportion z statistic is
$$ Z=\frac{\hat p-p_0}{\sqrt{p_0(1-p_0)/n}}. $$
Under \(H_0\), this statistic is approximately standard normal when the null expected success and failure counts are sufficiently large.

Model, Hypotheses, and Conditions

Before calculating a test statistic, define what counts as a success and specify the hypotheses. If each sampled unit has a binary outcome, write \(X_i=1\) for a success and \(X_i=0\) otherwise, for \(i=1,\ldots,n\). The model assumes that the \(X_i\) are independent and have the same Bernoulli distribution with success probability \(p\). Then \(X=\sum_{i=1}^n X_i\) is the success count and \(\hat p=X/n\).

The null hypothesis gives the value to be tested, \(H_0:p=p_0\). The alternative hypothesis determines which departures from that value count as evidence against the null:

  • \(H_A:p>p_0\) is an upper-tailed test.
  • \(H_A:p<p_0\) is a lower-tailed test.
  • \(H_A:p\ne p_0\) is a two-sided test.

The direction must be chosen from the question of interest before examining the sample result. Choosing a one-sided alternative after seeing which way the sample proportion moved changes the test and can overstate the evidence.

For the normal approximation, a common practical check is that both expected counts under the null are at least 10:

$$ np_0\ge 10 \qquad\text{and}\qquad n(1-p_0)\ge 10. $$

These are null-based counts. They are not the observed number of successes and failures. Some references use a less stringent cutoff, such as 5; the important point is that the normal approximation should not be used automatically for a small expected count. If the conditions are poor, an exact binomial test is a natural alternative.

Why the Null-Based Standard Error Appears

Under the Bernoulli model, \(E[X_i]=p\) and \(\operatorname{Var}(X_i)=p(1-p)\). Independence gives \(E[X]=np\) and \(\operatorname{Var}(X)=np(1-p)\). Because \(\hat p=X/n\), its mean and variance are

$$ E[\hat p]=p, \qquad \operatorname{Var}(\hat p) =\operatorname{Var}\left(\frac{X}{n}\right) =\frac{np(1-p)}{n^2} =\frac{p(1-p)}{n}. $$

When the null hypothesis is true, \(p=p_0\), so the standard deviation of \(\hat p\) under the null is \(\sqrt{p_0(1-p_0)/n}\). The central limit theorem motivates treating the standardized sample proportion as approximately standard normal when the expected success and failure counts are adequate. This yields the stated z statistic.

The denominator answers a specific question: how much variation in \(\hat p\) should be expected if the null value is true? Using \(p_0\) therefore ties the standard error to the model being tested. The statistic measures how many null standard errors separate the observed proportion from the null value.

Decision Rules and P-Values

Let \(\Phi(z)\) denote the cumulative distribution function of a standard normal random variable. Once the statistic is calculated, the direction of the alternative determines the p-value:

AlternativeApproximate p-value
\(H_A:p>p_0\)\(1-\Phi(z_{\mathrm{obs}})\)
\(H_A:p<p_0\)\(\Phi(z_{\mathrm{obs}})\)
\(H_A:p\ne p_0\)\(2[1-\Phi(|z_{\mathrm{obs}}|)]\)

The p-value is the probability, assuming the null model, of obtaining a test statistic at least as extreme as the observed statistic in the direction or directions specified by the alternative. It is not the probability that the null hypothesis is true.

At significance level \(\alpha\), reject \(H_0\) when the p-value is at most \(\alpha\); otherwise, do not reject it. Equivalently, for an upper-tailed test reject when \(z_{\mathrm{obs}}\ge z_{1-\alpha}\), for a lower-tailed test reject when \(z_{\mathrm{obs}}\le -z_{1-\alpha}\), and for a two-sided test reject when \(|z_{\mathrm{obs}}|\ge z_{1-\alpha/2}\). Here \(z_q\) is the \(q\) quantile of the standard normal distribution.

Worked Example: Testing a Claimed Error Rate

A hypothetical administrator claims that 20% of submitted forms contain at least one coding error. An independent random sample of 200 forms contains 52 with an error. Test \(H_0:p=0.20\) against \(H_A:p\ne0.20\) at \(\alpha=0.05\). Assume each sampled form has a binary error/no-error outcome and the sample can be treated as independent with a common population probability.

Method and conditions. This is a one-sample z test for a proportion. Under the null, the expected error count is \(np_0=200(0.20)=40\), and the expected no-error count is \(n(1-p_0)=200(0.80)=160\). Both are at least 10, so the normal approximation condition is met.

Calculate the sample proportion.

$$ \hat p=\frac{52}{200}=0.26. $$

Calculate the null standard error and statistic.

$$ SE_0=\sqrt{\frac{0.20(0.80)}{200}} =\sqrt{\frac{0.16}{200}} =\sqrt{0.0008} \approx0.028284, $$ $$ z_{\mathrm{obs}} =\frac{0.26-0.20}{0.028284} \approx2.121. $$

Find the p-value and decide. The alternative is two-sided, so \(p\text{-value}=2[1-\Phi(2.121)]\approx2(0.01695)=0.0339\). Since \(0.0339<0.05\), reject \(H_0\). The sample provides evidence that the population error proportion differs from 20%; the test alone does not establish the size or practical importance of that difference.

Check. The statistic is positive because \(0.26>0.20\), and the two-sided p-value is twice the upper-tail probability for \(|z|=2.121\), as required.

Common mistake avoided: using \(\sqrt{\hat p(1-\hat p)/n}\) in this null test. That would use the observed proportion to estimate variation; the specified one-sample score test uses \(p_0\) in its standard error.

Worked Tests With Directional Alternatives

Worked Example: Testing Whether a Pass Rate Exceeds a Target

A hypothetical equipment lab investigates whether more than 12% of a particular batch of sensors fail a calibration check. Of 150 independently sampled sensors, 25 fail. Test \(H_0:p=0.12\) against \(H_A:p>0.12\) at \(\alpha=0.05\). Treat failure as the success outcome for this test, with independent binary observations and a common failure probability.

Check conditions. Under \(H_0\), the expected failure count is \(150(0.12)=18\), and the expected nonfailure count is \(150(0.88)=132\). Both exceed 10.

Calculate the observed proportion.

$$ \hat p=\frac{25}{150}=\frac{1}{6}\approx0.166667. $$

Calculate the null standard error and statistic.

$$ SE_0=\sqrt{\frac{0.12(0.88)}{150}} =\sqrt{0.000704} \approx0.026533, $$ $$ z_{\mathrm{obs}} =\frac{0.166667-0.12}{0.026533} \approx1.759. $$

Find the p-value and decide. This is an upper-tailed test, so the p-value is \(1-\Phi(1.759)\approx0.0393\). Since \(0.0393<0.05\), reject \(H_0\). The sample supports the claim that the failure proportion exceeds 12%.

Check. The sample proportion is greater than the null value, so the statistic is positive, consistent with evidence in the upper-tail direction. The p-value is below, but not far below, the 0.05 significance level.

Common mistake avoided: treating this as two-sided simply because a test statistic was calculated. The stated question asks whether the rate exceeds the target, so the upper-tail probability is the relevant one.

Worked Example: A Lower-Tailed Test That Does Not Reject

A hypothetical service center expects 40% of scheduled appointments to require a rescheduling call. In a random sample of 80 appointments, 25 required such a call. Test whether the population proportion is lower than 40%, using \(H_0:p=0.40\), \(H_A:p<0.40\), and \(\alpha=0.05\). Assume independent binary outcomes with a common probability.

Check conditions. The null expected counts are \(80(0.40)=32\) appointments requiring a call and \(80(0.60)=48\) not requiring one. Both are at least 10.

Calculate the sample proportion and null standard error.

$$ \hat p=\frac{25}{80}=0.3125, \qquad SE_0=\sqrt{\frac{0.40(0.60)}{80}} =\sqrt{0.003} \approx0.054772. $$

Calculate the statistic.

$$ z_{\mathrm{obs}} =\frac{0.3125-0.40}{0.054772} =\frac{-0.0875}{0.054772} \approx-1.597. $$

Find the p-value and decide. For a lower-tailed test, the p-value is \(\Phi(-1.597)\approx0.0551\). Since \(0.0551>0.05\), do not reject \(H_0\). The sample does not provide sufficient evidence at the 5% level that the proportion is lower than 40%.

Check. The test statistic is negative because the observed proportion is below 0.40. The one-sided p-value is just above 0.05, so the decision is not to reject at that level. This is not proof that the true proportion equals 0.40.

Common mistake avoided: doubling the lower-tail probability. A doubled tail probability would be appropriate for a two-sided alternative, but the stated alternative is lower-tailed.

Assumptions and Common Exam Traps

A z calculation is not a substitute for checking the sampling model. The procedure can be unreliable when observations are dependent, when the sample is not representative of the population of interest, or when the expected count of either outcome under the null is small. For example, repeatedly sampling the same unit does not create independent Bernoulli observations. A large sample size by itself also does not guarantee a good approximation if \(p_0\) is very close to 0 or 1.

The null-based standard error is a frequent source of errors. For a one-sample test of \(p=p_0\), use \(\sqrt{p_0(1-p_0)/n}\). Replacing \(p_0\) with \(\hat p\) gives a different standard error and does not implement this score test. Also keep the count and proportion distinct: if \(x\) successes are observed, the statistic uses \(x/n\), not \(x\).

  • Wrong tail: the alternative determines the tail. A positive statistic does not by itself justify an upper-tailed test.
  • Wrong condition check: verify \(np_0\) and \(n(1-p_0)\), not just the observed counts.
  • Overstating a conclusion: “do not reject” means the evidence is insufficient at the chosen level; it does not mean the null has been proved.
  • Misreading the p-value: it is calculated assuming \(H_0\), and is not the probability that the observed result occurred by chance in some general sense.

One-proportion z tests are useful when a binary outcome is measured on one population and the question concerns a single hypothesized rate. The central decisions are to specify the alternative in advance, verify the null approximation conditions, use the null-based standard error, and report the conclusion in the context of the population proportion. This material is aligned with the SOA VEE Mathematical Statistics syllabus.

Check Your Understanding

For each problem, identify the appropriate tail, check the null expected counts, and use the one-sample proportion z test when its normal approximation condition is met. Give probabilities to four decimal places.

  1. A hypothetical archive expects 30% of scanned records to need manual correction. In a random sample of 100 records, 38 need correction. Test \(H_0:p=0.30\) against \(H_A:p\ne0.30\) at \(\alpha=0.05\). (Answer: \(np_0=30\), \(n(1-p_0)=70\); \(z\approx1.7457\), two-sided p-value \(\approx0.0809\); do not reject.)
  2. A hypothetical greenhouse tests whether more than 8% of seedlings fail a quality screen. In 250 independently selected seedlings, 28 fail. Test at \(\alpha=0.05\). (Answer: null expected counts \(20\) and \(230\); \(z\approx1.8640\), upper-tail p-value \(\approx0.0311\); reject.)
  3. A hypothetical clinic tests whether fewer than half of a population completes a follow-up survey. Of 64 sampled individuals, 24 complete it. Test \(H_0:p=0.50\) against \(H_A:p<0.50\) at \(\alpha=0.05\). (Answer: null expected counts \(32\) and \(32\); \(z=-2.0000\), lower-tail p-value \(0.0228\); reject.)
  4. A hypothetical technician tests whether more than 4% of a device type fails during a check. In a sample of 100 devices, 9 fail. Before computing a normal-approximation test, assess the null count condition. (Answer: expected counts are \(4\) failures and \(96\) nonfailures; the success-count condition fails, so the one-sample normal approximation is not recommended.)
  5. A hypothetical review team tests whether a document defect rate differs from 25%. Among 120 independently selected documents, 40 have the defect. Test at \(\alpha=0.05\). (Answer: null expected counts \(30\) and \(90\); \(z\approx2.1082\), two-sided p-value \(\approx0.0350\); reject.)
Clinical Biostats