One-Sample Z-test for Proportions: Comprehensive Guide

Master one-sample z-test for proportions: calculating test statistics, p-values, and making statistical decisions through these 5 detailed exercises.

One-Sample Z-test for Proportions Fundamentals
z = (p̂ - p₀)/√[p₀(1-p₀)/n]
Z-test Formula for Proportions
Key Definitions:

Sample Proportion (p̂): Number of successes divided by sample size (x/n)

Population Proportion (p₀): Hypothesized value under null hypothesis

Standard Error: √[p₀(1-p₀)/n], measures variability of sample proportion

Success-Failure Condition: np₀ ≥ 5 and n(1-p₀) ≥ 5 for normal approximation

5-Step Z-test Procedure:
  1. State hypotheses: H₀: p = p₀ vs H₁: p ≠, >, or < p₀
  2. Check conditions: Verify success-failure condition
  3. Calculate test statistic: z = (p̂ - p₀)/√[p₀(1-p₀)/n]
  4. Find p-value: Based on test type and standard normal distribution
  5. Make decision: Compare p-value to α and draw conclusion
Tip 1: Always check np₀ ≥ 5 and n(1-p₀) ≥ 5 before using z-test
Tip 2: p̂ is always the sample proportion from your data
Tip 3: p₀ comes from the null hypothesis
When to Use: Testing population proportion with large samples
Assumptions: Random sample, independent observations, normal approximation valid
Solution: Exercises 1 to 3
1 Two-Tailed Test
Exercise 1
A company claims 60% of customers are satisfied. In a survey of 200 customers, 130 were satisfied. Test the claim at α = 0.05.
Problem Setup:

Given: n = 200, x = 130, p̂ = 130/200 = 0.65, p₀ = 0.60, α = 0.05

Test Procedure:

This is a two-tailed test since we're testing if the proportion differs from 0.60

Step 1: State the hypotheses

H₀: p = 0.60 (company's claim is accurate)

H₁: p ≠ 0.60 (company's claim is inaccurate)

Step 2: Check conditions

np₀ = 200 × 0.60 = 120 ≥ 5 ✓

n(1-p₀) = 200 × 0.40 = 80 ≥ 5 ✓

Conditions are satisfied for normal approximation

Step 3: Calculate test statistic

z = (p̂ - p₀)/√[p₀(1-p₀)/n]

z = (0.65 - 0.60)/√[0.60 × 0.40/200]

z = 0.05/√[0.24/200] = 0.05/√0.0012 = 0.05/0.0346 = 1.44

Step 4: Find p-value

Two-tailed test: p-value = 2 × P(Z ≥ |1.44|) = 2 × P(Z ≥ 1.44)

p-value = 2 × (1 - 0.9251) = 2 × 0.0749 = 0.1498

Step 5: Make decision

Since p-value (0.1498) > α (0.05), fail to reject H₀

Conclusion:

There is insufficient evidence to reject the company's claim that 60% of customers are satisfied.

Applied Rules:

• Success-Failure Condition: np₀ ≥ 5 and n(1-p₀) ≥ 5

• Z-test Formula: z = (p̂ - p₀)/SE where SE = √[p₀(1-p₀)/n]

• Two-tailed P-value: Multiply tail probability by 2

2 Right-Tailed Test
Exercise 2
A new drug is claimed to be effective in more than 70% of cases. In a clinical trial of 150 patients, 115 responded positively. Test at α = 0.01.
Problem Setup:

Given: n = 150, x = 115, p̂ = 115/150 = 0.767, p₀ = 0.70, α = 0.01

Step 1: State the hypotheses

H₀: p ≤ 0.70 (drug is not more effective than 70%)

H₁: p > 0.70 (drug is more effective than 70%)

Step 2: Check conditions

np₀ = 150 × 0.70 = 105 ≥ 5 ✓

n(1-p₀) = 150 × 0.30 = 45 ≥ 5 ✓

Step 3: Calculate test statistic

z = (0.767 - 0.70)/√[0.70 × 0.30/150]

z = 0.067/√[0.21/150] = 0.067/√0.0014 = 0.067/0.0374 = 1.79

Step 4: Find p-value

Right-tailed test: p-value = P(Z ≥ 1.79)

p-value = 1 - 0.9633 = 0.0367

Step 5: Make decision

Since p-value (0.0367) > α (0.01), fail to reject H₀

Conclusion:

At α = 0.01, there is insufficient evidence to conclude that the drug is effective in more than 70% of cases.

Applied Rules:

• Right-tailed P-value: p-value = P(Z ≥ observed value)

• Strict Alpha: α = 0.01 requires stronger evidence

• Conservative Decision: Higher α level would reject H₀

3 Left-Tailed Test
Exercise 3
A school district claims that at most 20% of students are absent on a typical day. A random sample of 500 students showed 85 were absent. Test at α = 0.05.
Problem Setup:

Given: n = 500, x = 85, p̂ = 85/500 = 0.17, p₀ = 0.20, α = 0.05

Step 1: State the hypotheses

H₀: p ≥ 0.20 (absenteeism is at least 20%)

H₁: p < 0.20 (absenteeism is less than 20%)

Step 2: Check conditions

np₀ = 500 × 0.20 = 100 ≥ 5 ✓

n(1-p₀) = 500 × 0.80 = 400 ≥ 5 ✓

Step 3: Calculate test statistic

z = (0.17 - 0.20)/√[0.20 × 0.80/500]

z = -0.03/√[0.16/500] = -0.03/√0.00032 = -0.03/0.0179 = -1.68

Step 4: Find p-value

Left-tailed test: p-value = P(Z ≤ -1.68)

p-value = 0.0465

Step 5: Make decision

Since p-value (0.0465) ≤ α (0.05), reject H₀

Conclusion:

There is sufficient evidence to conclude that absenteeism is less than 20% on a typical day.

Applied Rules:

• Left-tailed P-value: p-value = P(Z ≤ observed value)

• Negative Z-score: Still follows standard normal distribution

• Decision Rule: Reject H₀ if p-value ≤ α

Solution: Exercises 4 to 5
4 Sample Size Effects
Exercise 4
A political poll shows 52% support for a candidate. Compare the z-statistic for sample sizes of n = 100, n = 400, and n = 1600, all testing H₀: p = 0.50 vs H₁: p ≠ 0.50. Explain the effect of sample size.
Problem Setup:

Given: p̂ = 0.52, p₀ = 0.50, n = 100, 400, 1600

Step 1: Calculate for n = 100

SE = √[0.50 × 0.50/100] = √0.0025 = 0.05

z = (0.52 - 0.50)/0.05 = 0.02/0.05 = 0.40

Step 2: Calculate for n = 400

SE = √[0.50 × 0.50/400] = √0.000625 = 0.025

z = (0.52 - 0.50)/0.025 = 0.02/0.025 = 0.80

Step 3: Calculate for n = 1600

SE = √[0.50 × 0.50/1600] = √0.00015625 = 0.0125

z = (0.52 - 0.50)/0.0125 = 0.02/0.0125 = 1.60

Step 4: Analyze sample size effect

As n increases, SE decreases by factor of √n

z-statistic increases by factor of √n

Same effect size becomes more significant with larger samples

Conclusion:

n = 100: z = 0.40 (not significant)

n = 400: z = 0.80 (not significant)

n = 1600: z = 1.60 (approaching significance)

Applied Rules:

• Standard Error: SE = √[p₀(1-p₀)/n] decreases as √n

• Power Increase: Larger samples detect smaller differences

• Practical vs Statistical: Statistical significance doesn't guarantee practical importance

5 Condition Violation
Exercise 5
In a study of a rare disease, 2 out of 15 patients responded to treatment. Test H₀: p = 0.10 vs H₁: p ≠ 0.10. Discuss why the z-test may not be appropriate and suggest alternatives.
Problem Setup:

Given: n = 15, x = 2, p̂ = 2/15 = 0.133, p₀ = 0.10

Step 1: Check success-failure condition

np₀ = 15 × 0.10 = 1.5 < 5 ✗

n(1-p₀) = 15 × 0.90 = 13.5 ≥ 5 ✓

Condition is violated!

Step 2: Calculate z-statistic anyway

SE = √[0.10 × 0.90/15] = √0.006 = 0.0775

z = (0.133 - 0.10)/0.0775 = 0.426

Step 3: Discuss problems with z-test

Normal approximation is poor when np₀ < 5

Results may be unreliable

Discrete nature of binomial distribution ignored

Step 4: Suggest alternatives

Use exact binomial test: P(X = 2) or P(X ≤ 2) or P(X ≥ 2)

Or increase sample size to meet conditions

Conclusion:

The z-test is inappropriate here due to violation of success-failure condition.

Use exact binomial test instead for reliable results.

Applied Rules:

• Condition Check: Always verify np₀ ≥ 5 and n(1-p₀) ≥ 5

• Exact Tests: Use when normal approximation fails

• Reliability: Results are only valid when assumptions are met

Comprehensive Z-test for Proportions Guide
z = (p̂ - p₀)/√[p₀(1-p₀)/n]
Z-test Formula
Standard Error
SE = √[p₀(1-p₀)/n]
Variability of sample proportion
Test Statistic
z = (p̂ - p₀)/SE
Standardized difference
Conditions
np₀ ≥ 5 and n(1-p₀) ≥ 5
Normal approximation validity
Key Proportion Test Concepts:

Population Proportion (p): True proportion in the population being studied

Sample Proportion (p̂): Observed proportion in the sample (x/n)

Sampling Distribution: Under H₀, p̂ ~ N(p₀, SE²) when conditions are met

Effect Size: |p̂ - p₀|, measures practical significance

Conditions and Assumptions:

Random Sampling: Data must come from a random sample

Independence: Observations must be independent (n ≤ 10% of population)

Normality: Success-failure condition: np₀ ≥ 5 and n(1-p₀) ≥ 5

Binary Outcomes: Each observation is a success or failure

Memory Tip: "p-hat is what you got, p-zero is what you expected"
Memory Tip: SE gets smaller as n gets larger (more precise estimates)
Memory Tip: "If it's not normal, don't use the formula" (check conditions!)
Common Mistakes: Forgetting to check conditions, using wrong p-value formula, confusing p̂ and p₀
Reporting Best Practices: Include test statistic, p-value, sample size, and effect size

Questions & Answers

Question: Why do we use p₀ (the hypothesized value) in the standard error formula instead of p̂ (the sample proportion)? Isn't p̂ our best estimate?

Answer: This is an excellent conceptual question! The reason we use p₀ in the standard error formula is fundamental to the logic of hypothesis testing:

Hypothesis Testing Logic: We assume H₀ is true and calculate how surprising our observed data would be under that assumption.

Standard Error Purpose: The standard error in the denominator represents the variability we'd expect in the sample proportion IF the null hypothesis were true.

Why Not p̂?: If we used p̂ in the standard error, we'd be using our data twice - once to estimate the parameter and again to estimate its variability. This would make the test too liberal.

Analogy: Think of it like a court trial - we assume innocence (H₀) and ask how likely it is to observe the evidence if the defendant were truly innocent. We don't use the evidence itself to assess the likelihood of the evidence!

This approach maintains the proper Type I error rate (probability of rejecting H₀ when it's true).

Question: What happens when the success-failure condition is barely met (like np₀ = 5.1)? Should we still trust the z-test?

Answer: The success-failure condition (np₀ ≥ 5 and n(1-p₀) ≥ 5) is a rule of thumb, not an absolute requirement. When values are close to 5:

When np₀ is slightly above 5: The z-test is generally acceptable, but the approximation may be less accurate. The test might be slightly conservative (less likely to reject H₀).

Consider Continuity Correction: For borderline cases, you can apply a continuity correction to improve accuracy:

Instead of z = (p̂ - p₀)/SE, use z = (|p̂ - p₀| - 1/(2n))/SE

Conservative Approach: When in doubt, use the exact binomial test, which doesn't rely on normal approximation. Modern software makes this easy.

Rule of Thumb: If np₀ or n(1-p₀) is between 5 and 10, consider the z-test results with caution. If either is below 5, definitely use the exact test.

The condition exists because the normal approximation to the binomial distribution improves as np₀ and n(1-p₀) increase.

Question: How does sample size affect the power of a z-test for proportions? Why do larger samples make it easier to get significant results?

Answer: This is a crucial concept in statistical inference! Here's how sample size affects power:

Standard Error Relationship: SE = √[p₀(1-p₀)/n], so SE decreases as √n increases

Test Statistic Effect: z = (p̂ - p₀)/SE, so as SE decreases, |z| increases

Power Increase: Larger samples make it easier to detect true differences because:

  • Sample estimates become more precise
  • Smaller differences become detectable
  • Probability of Type II error (β) decreases
  • Power (1-β) increases

Example: With p₀ = 0.50 and p̂ = 0.55:

  • n = 100: z = 1.00 (likely not significant)
  • n = 400: z = 2.00 (likely significant)
  • n = 1600: z = 4.00 (highly significant)

Important Caveat: While larger samples increase statistical significance, they don't necessarily increase practical significance. A statistically significant result in a large sample might represent a trivial difference in practice.