Tests for Proportions
One-sample and two-sample z-tests
Hypothesis Tests for Proportions
One-Sample z-Test for Proportion
Test: Does sample provide evidence that population proportion differs from claimed value?
Hypotheses:
- H₀: p = p₀
- Hₐ: p ≠ p₀ (or p > p₀ or p < p₀)
Conditions:
- Random sample
- np₀ ≥ 10 and n(1-p₀) ≥ 10 (use p₀, not p̂!)
- n < 10% of population
Test Statistic
Note: Use p₀ (null value) in SE, not p̂
Under H₀: z follows standard normal distribution
P-Value Calculation
Two-sided (Hₐ: p ≠ p₀): P-value = 2 × P(Z ≥ |z|)
Right-sided (Hₐ: p > p₀): P-value = P(Z ≥ z)
Left-sided (Hₐ: p < p₀): P-value = P(Z ≤ z)
Calculator: normalcdf
Example 1: Two-Sided Test
Claim: Coin is fair. Flip 100 times, get 58 heads. Test at α = 0.05.
STATE:
- Parameter: p = true proportion of heads
- H₀: p = 0.5
- Hₐ: p ≠ 0.5
- α = 0.05
PLAN:
- One-sample z-test for proportion
- Random: Assume ✓
- Normal: 100(0.5) = 50 ≥ 10, 100(0.5) = 50 ≥ 10 ✓
- Independent: 100 < all possible flips ✓
DO:
P-value = 2 × P(Z ≥ 1.6) = 2(0.0548) ≈ 0.1096
CONCLUDE: P-value = 0.1096 > 0.05, fail to reject H₀. Insufficient evidence coin is unfair.
Example 2: One-Sided Test
Company claims > 80% customer satisfaction. Survey 200, find 168 satisfied.
STATE:
- p = true proportion satisfied
- H₀: p = 0.8
- Hₐ: p > 0.8
- α = 0.05
PLAN:
- One-sample z-test for proportion
- Conditions: ✓ (check all three)
DO:
P-value = P(Z ≥ 1.41) ≈ 0.079
CONCLUDE: P-value = 0.079 > 0.05, fail to reject H₀. Insufficient evidence satisfaction exceeds 80%.
Two-Sample z-Test for Proportions
Compare two proportions:
Hypotheses:
- H₀: p₁ = p₂ (or p₁ - p₂ = 0)
- Hₐ: p₁ ≠ p₂ (or p₁ > p₂ or p₁ < p₂)
Test Statistic:
Where pooled proportion:
Key: Pool data under assumption p₁ = p₂ (H₀)
Conditions for Two-Sample Test
Both samples:
- Random/independent
- n₁p̂c ≥ 10, n₁(1-p̂c) ≥ 10
- n₂p̂c ≥ 10, n₂(1-p̂c) ≥ 10
- n₁ < 10%N₁, n₂ < 10%N₂
Example 3: Two-Sample Test
Treatment vs Placebo:
- Treatment: 45/100 improved
- Placebo: 30/100 improved
STATE:
- p₁ = proportion improved with treatment
- p₂ = proportion improved with placebo
- H₀: p₁ = p₂
- Hₐ: p₁ > p₂
- α = 0.05
PLAN:
- Two-sample z-test
- Conditions: ✓
DO:
P-value = P(Z ≥ 2.19) ≈ 0.014
CONCLUDE: P-value = 0.014 < 0.05, reject H₀. Sufficient evidence treatment proportion exceeds placebo.
Calculator Commands (TI-83/84)
One-sample: STAT → TESTS → 5:1-PropZTest
- p₀, x, n, direction
- Calculate
Two-sample: STAT → TESTS → 6:2-PropZTest
- x₁, n₁, x₂, n₂, direction
- Calculate
Common Mistakes
❌ Using p̂ instead of p₀ in SE for one-sample
❌ Not pooling for two-sample test
❌ Checking conditions with p̂ instead of p₀
❌ Wrong P-value for one-sided vs two-sided
❌ Forgetting to check conditions
When to Use
One-sample: Comparing proportion to claimed value
Two-sample: Comparing two independent groups
Paired: If data paired, analyze differences (not proportions)
Quick Reference
One-sample:
- Test statistic:
- Use p₀ in SE
Two-sample:
- Test statistic uses pooled p̂c
- Pool assuming H₀: p₁ = p₂ is true
Conditions: Random, normal (np ≥ 10, n(1-p) ≥ 10), independent
Remember: For proportions, use z-test (not t). Check conditions with null hypothesis values!
📚 Practice Problems
1Problem 1easy
❓ Question:
A company claims 30% of customers prefer their new product. In a random sample of 200 customers, 48 prefer it. Test at α = 0.05 if the true proportion is less than 30%.
💡 Show Solution
Step 1: Set up hypotheses Claim: p = 0.30 Suspect: p < 0.30
H₀: p = 0.30 Hₐ: p < 0.30 (one-tailed, left)
Step 2: Check conditions n = 200, p₀ = 0.30
RANDOM: Random sample ✓ NORMAL: np₀ = 200(0.30) = 60 ≥ 10 ✓ n(1-p₀) = 200(0.70) = 140 ≥ 10 ✓ INDEPENDENT: 200 ≤ 0.10N (assume) ✓
Can use z-test!
Step 3: Calculate sample proportion p̂ = 48/200 = 0.24
Step 4: Calculate test statistic z = (p̂ - p₀)/√(p₀(1-p₀)/n) = (0.24 - 0.30)/√(0.30(0.70)/200) = -0.06/√(0.21/200) = -0.06/√0.00105 = -0.06/0.0324 ≈ -1.85
Step 5: Find p-value (one-tailed) Left-tailed test (Hₐ: p < 0.30)
From z-table: P(Z < -1.85) = 0.0322
p-value = 0.0322
Step 6: Make decision p-value = 0.0322 α = 0.05
Is 0.0322 < 0.05? YES
REJECT H₀
Step 7: State conclusion At the α = 0.05 significance level, there is sufficient evidence to conclude that the true proportion who prefer the new product is less than 30%.
The sample data (24%) provides convincing evidence that preference is lower than the company's claim.
Step 8: Interpret in context Evidence suggests:
- Fewer than 30% prefer new product
- Company's claim may be overstated
- Sample result (24%) is significantly lower
- Not just due to random chance
Answer: H₀: p = 0.30, Hₐ: p < 0.30 Test statistic: z = -1.85 P-value: 0.032 Decision: Reject H₀ at α = 0.05 Conclusion: Sufficient evidence that true proportion is less than 30%
2Problem 2easy
❓ Question:
In 2020, 45% of voters supported a candidate. In 2024, a poll of 400 voters shows 200 support the candidate. Test if support has changed from 45%.
💡 Show Solution
Step 1: Set up hypotheses Previous: p = 0.45 Question: Has it changed?
H₀: p = 0.45 (support unchanged) Hₐ: p ≠ 0.45 (support has changed)
TWO-TAILED test!
Step 2: Check conditions n = 400, p₀ = 0.45
RANDOM: Assume random sample ✓ NORMAL: np₀ = 400(0.45) = 180 ≥ 10 ✓ n(1-p₀) = 400(0.55) = 220 ≥ 10 ✓ INDEPENDENT: 400 ≤ 0.10N ✓
Step 3: Calculate sample proportion p̂ = 200/400 = 0.50
Step 4: Calculate standard error SE = √(p₀(1-p₀)/n) = √(0.45(0.55)/400) = √(0.2475/400) = √0.00061875 ≈ 0.0249
Step 5: Calculate test statistic z = (p̂ - p₀)/SE = (0.50 - 0.45)/0.0249 = 0.05/0.0249 ≈ 2.01
Step 6: Find p-value (two-tailed!) Right tail: P(Z > 2.01) ≈ 0.0222 Left tail: P(Z < -2.01) ≈ 0.0222
Two-tailed p-value: p-value = 2 × 0.0222 = 0.0444
Step 7: Make decision p-value = 0.0444 α = 0.05
Is 0.0444 < 0.05? YES (barely!)
REJECT H₀
Step 8: State conclusion At the α = 0.05 significance level, there is sufficient evidence that support has changed from 45%. The current support appears to be different from 2020 levels.
Step 9: Additional interpretation Current support: 50% Previous support: 45% Change: +5 percentage points
This increase is statistically significant:
- Not just random variation
- Real change in support
- Though p-value (0.044) is close to α (0.05)
- Borderline significance
Answer: H₀: p = 0.45, Hₐ: p ≠ 0.45 Test statistic: z = 2.01 P-value: 0.044 (two-tailed) Decision: Reject H₀ at α = 0.05 Conclusion: Support has changed significantly from 45% (appears higher at 50%)
3Problem 3medium
❓ Question:
A quality control manager wants to test if the defect rate is greater than 2%. She samples 500 items and finds 15 defects. Conduct the test at α = 0.01.
💡 Show Solution
Step 1: Set up hypotheses Claim: p = 0.02 (2% defect rate) Concern: p > 0.02 (higher than acceptable)
H₀: p = 0.02 Hₐ: p > 0.02 (one-tailed, right)
Step 2: Check conditions n = 500, p₀ = 0.02
RANDOM: Assume random sample ✓ NORMAL: np₀ = 500(0.02) = 10 ≥ 10 ✓ (exactly!) n(1-p₀) = 500(0.98) = 490 ≥ 10 ✓ INDEPENDENT: 500 ≤ 0.10N ✓
Conditions met (barely for np₀)
Step 3: Calculate sample proportion p̂ = 15/500 = 0.03 (3%)
Step 4: Calculate SE SE = √(p₀(1-p₀)/n) = √(0.02(0.98)/500) = √(0.0196/500) = √0.0000392 ≈ 0.00626
Step 5: Calculate test statistic z = (p̂ - p₀)/SE = (0.03 - 0.02)/0.00626 = 0.01/0.00626 ≈ 1.60
Step 6: Find p-value Right-tailed test (Hₐ: p > 0.02)
P(Z > 1.60) ≈ 0.0548
p-value = 0.0548
Step 7: Make decision p-value = 0.0548 α = 0.01
Is 0.0548 < 0.01? NO
FAIL TO REJECT H₀
Step 8: State conclusion At the α = 0.01 significance level, there is insufficient evidence to conclude that the defect rate exceeds 2%.
The observed 3% defect rate could reasonably occur by chance if the true rate is 2%.
Step 9: Context and interpretation Observed: 3% defects Standard: 2% defects Difference: 1 percentage point
This difference is:
- Not statistically significant at α = 0.01
- p = 0.055 > 0.01
- Could be random variation
- Not enough evidence for concern
Step 10: Additional notes If α = 0.05 instead:
- 0.0548 > 0.05 (still fail to reject, barely!)
- Borderline case
- Might warrant further monitoring
Conservative conclusion:
- Insufficient evidence of problem
- But keep monitoring
- Sample evidence suggestive but not conclusive
Answer: H₀: p = 0.02, Hₐ: p > 0.02 Test statistic: z = 1.60 P-value: 0.055 Decision: Fail to reject H₀ at α = 0.01 Conclusion: Insufficient evidence that defect rate exceeds 2%
4Problem 4medium
❓ Question:
A researcher finds p̂ = 0.58 from n = 100. She wants to test H₀: p = 0.50 vs Hₐ: p > 0.50. Check the conditions and determine if a z-test is appropriate.
💡 Show Solution
Step 1: List the conditions for z-test For one-sample z-test for proportion:
- RANDOM: Random sample
- NORMAL: np₀ ≥ 10 AND n(1-p₀) ≥ 10
- INDEPENDENT: n ≤ 0.10N
Step 2: Check RANDOM condition Statement: Need random sample
Given: "researcher finds" - not stated Assume: Random sample ✓
Note: Should be explicitly stated!
Step 3: Check NORMAL condition Use p₀ = 0.50 (from H₀, not p̂!)
np₀ = 100(0.50) = 50 ≥ 10 ✓ n(1-p₀) = 100(0.50) = 50 ≥ 10 ✓
Both satisfied! Sampling distribution approximately normal
Step 4: Check INDEPENDENT condition Need: n ≤ 0.10N
n = 100 Need: 100 ≤ 0.10N N ≥ 1000
If population has at least 1000: Independent ✓
Assumption: Reasonable for most populations
Step 5: Common mistake to avoid DON'T use p̂ to check normal condition! USE p₀ (from null hypothesis)
WRONG: np̂ = 100(0.58) = 58 RIGHT: np₀ = 100(0.50) = 50
Why? Because we're testing under assumption H₀ is true!
Step 6: Is z-test appropriate? YES, if: ✓ Sample is random ✓ np₀ = 50 ≥ 10 ✓ n(1-p₀) = 50 ≥ 10 ✓ Population reasonably large (N ≥ 1000)
All conditions met! Can proceed with z-test
Step 7: Additional consideration Sample size n = 100:
- Moderate sample size
- Sufficient for normal approximation
- SE will be reasonably small
SE = √(p₀(1-p₀)/n) = √(0.50(0.50)/100) = √0.0025 = 0.05
Step 8: Conduct the test (since appropriate) z = (p̂ - p₀)/SE = (0.58 - 0.50)/0.05 = 0.08/0.05 = 1.60
p-value = P(Z > 1.60) ≈ 0.0548
Step 9: When z-test might NOT be appropriate Fails if: ✗ np₀ < 10 (too few successes expected) ✗ n(1-p₀) < 10 (too few failures expected) ✗ Not random sample ✗ Sample from small population without replacement
Example of failure: n = 15, p₀ = 0.10 np₀ = 1.5 < 10 ✗ Cannot use z-test!
Step 10: Summary of condition checking Given information: n = 100 ✓ p̂ = 0.58 p₀ = 0.50
Conditions: Random: Assumed ✓ Normal: 50 ≥ 10 and 50 ≥ 10 ✓ Independent: Assumed N ≥ 1000 ✓
Conclusion: Z-test IS appropriate
Answer: YES, z-test is appropriate.
CONDITIONS CHECK:
- Random: Assume random sample ✓
- Normal: np₀ = 100(0.50) = 50 ≥ 10 ✓ n(1-p₀) = 100(0.50) = 50 ≥ 10 ✓
- Independent: Assume N ≥ 1000 so n ≤ 0.10N ✓
All conditions satisfied. Can use z-test for proportion.
Key: Use p₀ (not p̂) when checking normal condition!
5Problem 5hard
❓ Question:
A coin is flipped 100 times, resulting in 60 heads. Test at α = 0.05 if the coin is biased. Then, determine how many heads would be needed for the result to be significant.
💡 Show Solution
PART 1: Test with 60 heads
Step 1: Set up hypotheses H₀: p = 0.50 (coin is fair) Hₐ: p ≠ 0.50 (coin is biased)
Two-tailed test!
Step 2: Check conditions n = 100, p₀ = 0.50
Random: Assume random flips ✓ Normal: np₀ = 50 ≥ 10 ✓ n(1-p₀) = 50 ≥ 10 ✓ Independent: Flips independent ✓
Step 3: Calculate p̂ = 60/100 = 0.60
SE = √(0.50(0.50)/100) = √0.0025 = 0.05
z = (0.60 - 0.50)/0.05 = 0.10/0.05 = 2.00
Step 4: Find p-value P(Z > 2.00) = 0.0228 Two-tailed: p = 2(0.0228) = 0.0456
Step 5: Decision p = 0.0456 < 0.05 REJECT H₀
Conclusion: Coin appears biased!
PART 2: How many heads needed?
Step 6: Find critical values For α = 0.05, two-tailed: α/2 = 0.025 in each tail
z* = ±1.96
Step 7: Set up inequality Reject H₀ if: |z| ≥ 1.96
|(p̂ - 0.50)/0.05| ≥ 1.96
Step 8: Solve for p̂ (upper tail) (p̂ - 0.50)/0.05 ≥ 1.96 p̂ - 0.50 ≥ 0.098 p̂ ≥ 0.598
Step 9: Convert to number of heads p̂ = x/100 ≥ 0.598 x ≥ 59.8 x ≥ 60 (since x must be integer)
Step 10: Check lower tail (p̂ - 0.50)/0.05 ≤ -1.96 p̂ - 0.50 ≤ -0.098 p̂ ≤ 0.402
x/100 ≤ 0.402 x ≤ 40.2 x ≤ 40
Step 11: Rejection regions Reject H₀ if: x ≥ 60 heads (too many) OR x ≤ 40 heads (too few)
Fail to reject if: 41 ≤ x ≤ 59 (consistent with fair coin)
Step 12: Verify with 60 x = 60 is exactly at boundary p̂ = 0.60 z = 2.00 p-value = 0.0456 < 0.05 ✓
Just barely significant!
Step 13: Verify with 59 x = 59 p̂ = 0.59 z = (0.59 - 0.50)/0.05 = 1.80 p-value = 2(0.0359) = 0.0718 > 0.05 Not significant ✓
Step 14: Interpretation For 100 flips, α = 0.05:
Significantly too many heads: ≥ 60 Significantly too few heads: ≤ 40 Consistent with fair coin: 41-59
Pretty wide range! Only extreme results reject fairness
Step 15: Connection to confidence interval 95% CI for fair coin: p̂ ± 1.96(SE) 0.50 ± 1.96(0.05) 0.50 ± 0.098 (0.402, 0.598) (40.2, 59.8) heads
Values outside this = significant!
Answer: PART 1: With 60 heads: z = 2.00, p-value = 0.046 Reject H₀ at α = 0.05 Coin appears biased (barely significant)
PART 2: Need for significance: ≥ 60 heads (too many) OR ≤ 40 heads (too few) Range 41-59 is consistent with fair coin
60 heads is the minimum to show bias on the high side at α = 0.05 level.
Practice with Flashcards
Review key concepts with our flashcard system
Browse All Topics
Explore other calculus topics