Tutorials › Introduction to Statistics › Calculating the One-Proportion Z Statistic

Tests for Proportions · Tutorial 628 of 996

Calculating the One-Proportion Z Statistic

Calculate the one-proportion z statistic correctly and interpret whether the observed proportion lies above or below the null value.

Intermediate 8 min read

What You'll Learn

  • Convert a success count into a sample proportion.
  • Use the null proportion to calculate the null standard error.
  • Calculate the one-proportion z statistic from a count, sample size, and null value.
  • Interpret the statistic’s sign and size in context.
  • Check the conditions needed to use the one-proportion z procedure.

From a Success Count to a Test Statistic

In a one-proportion test, the data often arrive as a count: for example, 54 successes among 100 people. The count alone does not say how surprising the result is under a proposed population proportion. To make that comparison, first express the count as a sample proportion, then measure how far that proportion is from the null value in units of the standard error expected under the null hypothesis.

This tutorial focuses on calculating that standardized distance and interpreting its sign. The sign tells us whether the observed proportion is above or below the null value. It does not, by itself, determine a p-value or a test conclusion; those also depend on the alternative hypothesis and the test’s tail.

Definition: For \(x\) successes in a sample of size \(n\), the sample proportion is \(\hat{p}=x/n\). For a one-proportion z test with null hypothesis \(H_0:p=p_0\), the null standard error is \(SE_0=\sqrt{p_0(1-p_0)/n}\). The one-proportion z statistic is $$ z=\frac{\hat{p}-p_0}{\sqrt{p_0(1-p_0)/n}}. $$ It measures the difference between the observed sample proportion and the null proportion in null standard-error units.

The Model and Calculation

The setting is a binary outcome: each sampled individual either has the characteristic counted as a success or does not. The model assumes that the observations are independent and have the same population success probability \(p\). Under \(H_0:p=p_0\), the number of successes \(X\) has a binomial model with parameters \(n\) and \(p_0\), written \(X\sim\operatorname{Binomial}(n,p_0)\). The sample proportion is \(X/n\).

The z procedure uses a normal approximation to the sampling distribution of the sample proportion under the null model. A commonly used condition is that the null expected numbers of successes and failures are both at least 10:

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

The sample should also come from a suitable random sampling or random assignment process. If sampling without replacement from a finite population, the sample should be no more than 10% of that population, so that treating observations as independent is reasonable. These conditions support the model and its normal approximation; they do not guarantee that the null hypothesis is true.

Use \(p_0\), not \(\hat{p}\), in the standard error for a hypothesis test. The test asks how variable the sample proportion would be if the null value were the true population proportion. Substituting the observed proportion would instead use a different estimate of variability and would not calculate this one-proportion z statistic.

1
Identify the inputs.
Record the success count \(x\), sample size \(n\), and null proportion \(p_0\). Express \(p_0\) as a proportion, not as a percentage.
2
Find the observed proportion.
Calculate \(\hat{p}=x/n\). It must be between 0 and 1, inclusive.
3
Find the null standard error.
Calculate \(SE_0=\sqrt{p_0(1-p_0)/n}\), using the null proportion.
4
Standardize the difference.
Calculate \(z=(\hat{p}-p_0)/SE_0\), retain the sign, and report the statistic with sensible rounding.

Why the Formula Standardizes the Difference

Under the null model, each observation can be represented as an indicator that equals 1 for a success and 0 for a failure. Its expected value is \(p_0\), and its variance is \(p_0(1-p_0)\). For \(n\) independent observations, the sample proportion is their average, so its null mean is \(p_0\) and its null variance is \(p_0(1-p_0)/n\). The square root of that variance is the null standard error.

The z statistic subtracts the null mean from the observed proportion and divides by the null standard deviation. Equivalently, begin with the success count \(X\), whose null mean is \(np_0\) and whose null standard deviation is \(\sqrt{np_0(1-p_0)}\). Then:

$$ \frac{x-np_0}{\sqrt{np_0(1-p_0)}} = \frac{n(\hat{p}-p_0)}{\sqrt{np_0(1-p_0)}} = \frac{\hat{p}-p_0}{\sqrt{p_0(1-p_0)/n}}. $$

The second equality follows by dividing the numerator and denominator by \(n\), and using \(\hat{p}=x/n\). Thus the count-based and proportion-based formulas give the same statistic. The standardization explains the units: \(z=1\) means the observed sample proportion is one null standard error above \(p_0\), while \(z=-1\) means it is one null standard error below \(p_0\).

Worked Calculations

Worked Example: A Proportion Slightly Above the Null Value

Suppose, hypothetically, that 54 of 100 randomly sampled customers choose a new checkout option. A company’s null claim is that the population proportion choosing it is \(p_0=0.50\). Calculate the z statistic and interpret its sign.

The outcomes are binary, and the sample is stipulated to be random. The null expected counts are \(np_0=100(0.50)=50\) successes and \(n(1-p_0)=100(0.50)=50\) failures, both at least 10. Assuming the sampled customers are independent (or that sampling without replacement involved no more than 10% of the relevant population), the stated conditions support the z calculation.

First calculate the observed proportion:

$$ \hat{p}=\frac{x}{n}=\frac{54}{100}=0.54. $$

Next calculate the null standard error:

$$ SE_0=\sqrt{\frac{0.50(1-0.50)}{100}} =\sqrt{\frac{0.25}{100}} =\sqrt{0.0025} =0.05. $$

Then calculate the statistic:

$$ z=\frac{0.54-0.50}{0.05} =\frac{0.04}{0.05} =0.80. $$

The sample proportion choosing the option is 0.04, or 4 percentage points, above the null proportion. Its value is 0.80 null standard errors above \(p_0=0.50\). This calculation describes the direction and standardized distance; it does not alone establish whether the result is statistically significant.

Worked Example: A Proportion Below the Null Value

In a hypothetical audit, 42 of 80 reviewed forms meet a specified standard. Consider the null value \(p_0=0.60\) for the population proportion of forms meeting that standard. Find and interpret the z statistic.

The audit outcome is binary, and suppose the 80 forms were selected at random from a sufficiently large population, with independent observations. Under the null, the expected success count is \(80(0.60)=48\), and the expected failure count is \(80(0.40)=32\). Both exceed 10, so the expected-count condition is met.

The observed proportion is:

$$ \hat{p}=\frac{42}{80}=0.525. $$

The null standard error is:

$$ SE_0=\sqrt{\frac{0.60(1-0.60)}{80}} =\sqrt{\frac{0.24}{80}} =\sqrt{0.003} \approx 0.05477. $$

Therefore:

$$ z=\frac{0.525-0.60}{0.05477} =\frac{-0.075}{0.05477} \approx -1.369. $$

The negative sign indicates that the observed proportion, 0.525, is below the null value, 0.60. The difference is about 1.369 null standard errors below that value. It would be incorrect to say that the statistic shows the proportion is “1.369 percentage points” lower: the observed difference is 7.5 percentage points, while 1.369 is a standardized distance.

Worked Example: Converting a Percentage Null Value

Suppose, hypothetically, that 186 out of 240 randomly selected packages arrive by a promised date. A delivery service’s benchmark is 75%. Calculate the one-proportion z statistic relative to that benchmark.

The outcome is whether a package arrives on time, and \(x=186\), \(n=240\). Convert the benchmark to a proportion: \(p_0=75/100=0.75\). Suppose the sample is random and observations are independent, with the 10% condition satisfied if sampling without replacement. The expected null counts are \(240(0.75)=180\) on-time packages and \(240(0.25)=60\) late packages; both are at least 10.

The sample proportion and null standard error are:

$$ \hat{p}=\frac{186}{240}=0.775, \qquad SE_0=\sqrt{\frac{0.75(1-0.75)}{240}} =\sqrt{\frac{0.1875}{240}} =\sqrt{0.00078125} \approx 0.02795. $$

Substitute into the z formula:

$$ z=\frac{0.775-0.75}{0.02795} =\frac{0.025}{0.02795} \approx 0.8944. $$

The observed on-time proportion is 2.5 percentage points above the 75% benchmark, corresponding to about 0.8944 null standard errors above the null value. The benchmark must be entered as 0.75, not 75; using 75 would make the formula invalid and produce a meaningless result.

Reading the Sign and Size

The numerator \(\hat{p}-p_0\) determines the sign because the standard error is positive whenever \(0<p_0<1\). If \(\hat{p}>p_0\), then \(z>0\); if \(\hat{p}<p_0\), then \(z<0\); and if \(\hat{p}=p_0\), then \(z=0\). The sign therefore describes which side of the null value the observed proportion falls on.

The absolute value \(|z|\) describes how far the observed proportion lies from \(p_0\) in null standard-error units. For example, \(|z|=2\) means a distance of two null standard errors, not a difference of two percentage points. The same difference in proportions can produce different z statistics for different sample sizes, because the null standard error changes with \(n\).

Whether a positive or negative result is relevant to a particular claim depends on the alternative hypothesis. A positive statistic is in the direction of larger proportions; a negative statistic is in the direction of smaller proportions. Choosing the appropriate tail and evaluating evidence are separate steps, so do not infer a p-value or reject-or-fail-to-reject decision from the sign alone.

Common Mistakes

  • Using \(\hat{p}\) in the test standard error. A learner might calculate \(\sqrt{\hat{p}(1-\hat{p})/n}\) because the observed proportion seems like the best estimate. For this one-proportion test statistic, use the null standard error \(\sqrt{p_0(1-p_0)/n}\), because the reference model assumes \(p=p_0\).
  • Entering a percent as though it were a proportion. A 60% null value is \(p_0=0.60\), not 60. The formula requires a value between 0 and 1.
  • Reversing the subtraction. The numerator is \(\hat{p}-p_0\), not \(p_0-\hat{p}\). Reversing it changes the sign and reverses the direction described by the statistic.
  • Confusing z units with percentage points. A z statistic is a number of standard errors, not a difference in proportions. State both the actual difference, if useful, and the standardized distance.
  • Skipping the conditions. A numerical answer can be calculated even when the normal approximation is not justified. Check the sampling/independence conditions and both null expected counts before relying on a z procedure.
  • Treating the sign as a conclusion. A positive z does not automatically mean evidence for a claim, and a negative z does not automatically mean evidence against it. Interpret the sign relative to the null value; the alternative hypothesis determines which direction matters.
Key takeaway: From \(x\) successes in \(n\) observations, calculate \(\hat{p}=x/n\), calculate the null standard error using \(p_0\), and divide \(\hat{p}-p_0\) by that standard error. The sign gives the direction of the observed difference; the magnitude gives its size in null standard-error units.

Check Your Understanding

For each question, keep the observed proportion, null standard error, and z statistic distinct.

  1. A hypothetical sample has 36 successes in 60 trials, and \(H_0:p=0.50\). What is \(\hat{p}\), and is the resulting z statistic positive, negative, or zero?
  2. For \(x=72\), \(n=120\), and \(p_0=0.60\), calculate \(SE_0\) and \(z\). Interpret the sign in context if a success represents a device passing inspection.
  3. A null benchmark is reported as 35%. What value of \(p_0\) should be entered in the formula, and why is 35 incorrect?
  4. What does \(z=-1.5\) say about the observed sample proportion relative to the null value? What does it not tell you by itself?
  5. For \(n=50\) and \(p_0=0.10\), check the null expected-success and expected-failure condition. Is the usual normal-approximation condition satisfied?