One-Sample Z-Tests
You should be comfortable with:
Medication dosages, IV drip rates, vital monitoring
Discounts, tax, tips, profit margins
The z-test is the simplest hypothesis test. It uses the standard normal distribution to decide whether sample data provides evidence against a null hypothesis. If you have already learned the logic of hypothesis testing — null and alternative hypotheses, p-values, significance levels, and Type I/II errors — then you are ready to put that framework into action. The z-test is the natural starting point because its reference distribution (the standard normal curve) is the one you already know from z-scores. In this lesson, you will learn two forms: the z-test for a population proportion and the z-test for a population mean when the population standard deviation is known.
Z-Test for a Population Proportion
Use this test when you are testing a claim about a population proportion — for example, whether a defect rate is 3%, whether a majority of voters favor a policy, or whether a medication’s success rate matches its label.
Conditions (all must be met):
- The sample is a simple random sample from the population of interest
- Individual observations are independent (sampling less than 10% of the population, or observations are naturally independent)
- The sample size is large enough that and , where is the null value. This ensures the sampling distribution of is approximately normal.
Test statistic:
Here is the sample proportion, is the hypothesized proportion from , and is the sample size. The denominator is the standard error calculated under the null hypothesis — this is important because we are asking “If were the true proportion, how surprising is ?”
Example 1: Defective Rate (One-Sided Right)
A manufacturer claims its defect rate is 3%. A quality inspector randomly tests 500 items and finds 22 defective, giving . Is there evidence the defect rate exceeds 3%? Test at .
Step 1: State the hypotheses.
Step 2: Choose significance level: .
Step 3: Check conditions.
- Random sample ✓
- Independence: 500 items is far less than 10% of total production ✓
- Large-sample check: ✓ and ✓
Step 4: Calculate the test statistic.
Step 5: Find the p-value. Since this is a one-sided right test:
Step 6: Make a decision. Since , we reject .
Step 7: Conclusion in context. There is statistically significant evidence at the 5% level that the manufacturer’s defect rate exceeds 3%. The observed rate of 4.4% is significantly higher than the claimed rate. The inspector should flag this batch for further review.
Example 2: Patient Satisfaction (Two-Sided)
A hospital claims an 80% patient satisfaction rate. A survey of 300 randomly selected patients finds 225 who are satisfied, giving . Test whether the satisfaction rate differs from 80% at .
Step 1: State the hypotheses.
Step 2: Choose significance level: .
Step 3: Check conditions.
- Random sample ✓
- Independence: 300 is less than 10% of all patients ✓
- Large-sample check: ✓ and ✓
Step 4: Calculate the test statistic.
Step 5: Find the p-value. Since this is a two-sided test:
Step 6: Make a decision. Since , we reject .
Step 7: Conclusion in context. There is statistically significant evidence that the patient satisfaction rate differs from the claimed 80%. At 75%, satisfaction is significantly lower. Hospital leadership should investigate root causes and develop improvement strategies.
Z-Test for a Population Mean ( Known)
Use this test when you are testing a claim about a population mean and the population standard deviation is known. This scenario is uncommon in practice — it arises mainly when a manufacturing process has a well-established historical standard deviation, or in textbook problems designed to teach the z-test framework. In most real-world situations, is unknown and you would use a t-test instead.
Conditions:
- The sample is a simple random sample
- Observations are independent
- The population distribution is normal, OR the sample size is large () so that the Central Limit Theorem applies
Test statistic:
Here is the sample mean, is the hypothesized population mean from , is the known population standard deviation, and is the sample size.
Example 3: Bottling Machine Fill Volume (One-Sided Left)
A bottling machine is designed to fill each bottle to mL. From historical calibration data, the fill standard deviation is known to be mL. A quality engineer draws a random sample of 40 bottles and measures mL. Is there evidence the machine is underfilling? Test at .
Step 1: State the hypotheses.
Step 2: Choose significance level: .
Step 3: Check conditions. Random sample ✓. Independence ✓. Sample size , so the CLT applies ✓. And is known ✓.
Step 4: Calculate the test statistic.
Step 5: Find the p-value. Since this is a one-sided left test:
Step 6: Make a decision. Since , we fail to reject at the 1% level.
Step 7: Conclusion in context. At the strict significance level, there is not sufficient evidence to conclude the machine is underfilling. However, the p-value of 0.0114 is quite close to the threshold. At the more common level, this result would be significant. The engineer may want to continue monitoring or collect a larger sample.
Important note: This example illustrates why the choice of matters. The same data leads to different decisions depending on the threshold. In high-stakes manufacturing scenarios, a stricter reduces the risk of a false alarm (Type I error) but increases the risk of missing a real problem (Type II error).
Making a Decision: The Complete Framework
Every z-test follows the same seven-step process. Here is a summary:
| Step | Action | Key Question |
|---|---|---|
| 1 | State and | What is the claim? What direction? |
| 2 | Set | How much Type I error risk is acceptable? |
| 3 | Check conditions | Random? Independent? Large enough sample? |
| 4 | Calculate the test statistic | How far is the sample result from the null value? |
| 5 | Find the p-value | How surprising is this result if is true? |
| 6 | Compare p-value to | Reject or fail to reject? |
| 7 | State conclusion in context | What does this mean for the real-world question? |
Decision rules at a glance:
- One-sided right (): p-value
- One-sided left (): p-value
- Two-sided (): p-value
Real-World Application: Nursing — Testing a Medication Compliance Rate
A nurse educator develops a new discharge instruction protocol aimed at improving medication compliance. The hospital’s historical compliance rate is 70%. After implementing the new protocol, a random sample of 150 discharged patients is followed up, and 115 are found to be compliant, giving .
Is there evidence that the new protocol improves compliance above 70%?
Check conditions: ✓ and ✓.
At , we reject . There is evidence that the new protocol increases medication compliance above the baseline 70%. The observed rate of 76.7% represents a clinically meaningful improvement — roughly 10 additional compliant patients per 150 discharged — which could reduce hospital readmissions and improve patient outcomes.
Clinical consideration: In healthcare settings, both statistical and practical significance matter. A compliance increase from 70% to 77% has real clinical impact: fewer missed doses, fewer adverse events, and lower readmission rates. The nurse educator should recommend adopting the new protocol while continuing to monitor compliance rates.
Practice Problems
Test your understanding with these problems. Click to reveal each answer.
Problem 1: A politician claims that 55% of voters support a ballot measure. A poll of 400 randomly selected voters finds 200 who support it. Is there evidence the true support is less than 55%? ()
, (one-sided left)
Since , reject .
Answer: There is statistically significant evidence that voter support is less than 55%. The sample proportion of 50% suggests the politician’s claim overestimates true support.
Problem 2: A cereal company states that its boxes weigh an average of 340 grams. The standard deviation is known to be grams from the production process. A sample of 36 boxes has grams. Test whether the mean weight differs from 340 grams at .
, (two-sided)
Since , fail to reject .
Answer: There is not sufficient evidence to conclude the mean box weight differs from 340 grams. The observed difference of 2.5 grams below the target is within the range of normal sampling variation.
Problem 3: A website claims a 12% click-through rate on its ads. An advertiser runs 800 ad impressions and observes 78 clicks. Is the click-through rate less than 12%? ()
, (one-sided left)
Check: ✓, ✓
Since , reject .
Answer: There is statistically significant evidence that the click-through rate is less than 12%. The observed rate of 9.75% suggests the website’s claim overstates the actual ad performance.
Problem 4: A factory produces steel rods whose lengths should average 25.0 cm, with known cm. A random sample of 50 rods yields cm. Test whether the mean length exceeds 25.0 cm at .
, (one-sided right)
Since , reject .
Answer: There is statistically significant evidence that the mean rod length exceeds 25.0 cm. The average of 25.08 cm is significantly above the target, suggesting the machine may need recalibration.
Problem 5: A school district claims 65% of its students read at grade level. A random sample of 250 students finds 150 reading at grade level. Is there evidence the proportion differs from 65%? ()
, (two-sided)
Check: ✓, ✓
Since , reject .
Answer: At the 10% significance level, there is evidence that the proportion of students reading at grade level differs from 65%. The sample proportion of 60% is significantly below the claimed rate. Note: at , this result would not be significant (0.0976 > 0.05), which highlights the importance of choosing before collecting data.
Key Takeaways
- The z-test for a proportion tests claims about a population proportion using the test statistic
- The z-test for a mean (when is known) uses the test statistic
- Both tests require random sampling, independence, and sufficient sample size for the normal approximation to hold
- The z-test for a mean with known is rare in practice — the one-sample t-test is far more common
- The p-value measures how surprising the sample result would be if were true — small p-values provide evidence against
- Always check conditions before performing any test. Violating assumptions can lead to misleading results.
- State conclusions in context — a statistical decision (“reject ”) must be translated into a meaningful real-world statement
- The choice of can change the decision. Always set before looking at the data.
Return to Statistics for more topics in this section.
Next Up in Statistics
All Statistics topicsLast updated: March 29, 2026