What Is a Proportion Test (One- and Two-Sample z-Test for Proportions)?
A proportion test is a statistical hypothesis test used to determine whether the observed proportion (percentage) in a sample differs significantly from a known or hypothesized population proportion—or whether two independent sample proportions differ from each other. It is the go-to tool for quality engineers working with defect rates, pass/fail data, or any binary outcome.
---
What It Is
In quality management, we often deal with counts: how many units failed, how many customers complained, how many parts were nonconforming. A proportion test answers questions like:
The test compares the observed sample proportion (p̂) against a reference value (p₀) or against another sample proportion, while accounting for sampling variability.
---
How It Works: Formula and Steps
### One-Sample Proportion Test (z-test)
Hypotheses:
Test statistic:
\[
z = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1 - p_0)}{n}}}
\]
Where:
Decision rule:
Compare the computed z-value to the critical value from the standard normal distribution. For a 95% confidence level (α = 0.05, two-tailed), the critical value is z = 1.96. Reject H₀ if |z| > 1.96.
### Two-Sample Proportion Test
Hypotheses:
Test statistic:
\[
z = \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}(1 - \hat{p})\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}
\]
Where p̂ = (x₁ + x₂) / (n₁ + n₂) is the pooled proportion.
Assumptions:
---
A Worked Illustrative Example
Example data (illustrative only):
A factory claims its defect rate is at most 4% (p₀ = 0.04). A quality audit inspects n = 400 units and finds x = 24 defects, giving p̂ = 24/400 = 0.06.
Step 1 – Hypotheses:
H₀: p = 0.04 vs. H₁: p > 0.04 (one-tailed test)
Step 2 – Compute z:
\[
z = \frac{0.06 - 0.04}{\sqrt{\frac{0.04 \times 0.96}{400}}} = \frac{0.02}{\sqrt{0.000096}} = \frac{0.02}{0.0098} \approx 2.04
\]
Step 3 – Compare to critical value:
For a one-tailed test at α = 0.05, the critical z is 1.645. Since 2.04 > 1.645, we reject H₀.
Conclusion: There is statistically significant evidence that the true defect rate exceeds the claimed 4%. (Note: this is illustrative data, not real factory results.)
---
Common Pitfalls
---
Try It Yourself
Manual calculation is fine for a single test, but in daily quality work you will run many comparisons. Use the free, no-sign-up proportion test calculator at https://www.6sq.com/tools/proportion_test/ to get instant z-values and p-values—just enter your sample counts and hypothesized proportion.
---
What It Is
In quality management, we often deal with counts: how many units failed, how many customers complained, how many parts were nonconforming. A proportion test answers questions like:
- Is our current defect rate significantly lower than the historical 5% target
- Did Process A produce a significantly different yield than Process B
The test compares the observed sample proportion (p̂) against a reference value (p₀) or against another sample proportion, while accounting for sampling variability.
---
How It Works: Formula and Steps
### One-Sample Proportion Test (z-test)
Hypotheses:
- Null hypothesis (H₀): p = p₀ (the true proportion equals the hypothesized value)
- Alternative hypothesis (H₁): p ≠ p₀, p > p₀, or p < p₀ (two-tailed or one-tailed)
Test statistic:
\[
z = \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1 - p_0)}{n}}}
\]
Where:
- p̂ = x / n (sample proportion, with x = number of successes)
- p₀ = hypothesized population proportion
- n = sample size
Decision rule:
Compare the computed z-value to the critical value from the standard normal distribution. For a 95% confidence level (α = 0.05, two-tailed), the critical value is z = 1.96. Reject H₀ if |z| > 1.96.
### Two-Sample Proportion Test
Hypotheses:
- H₀: p₁ = p₂
- H₁: p₁ ≠ p₂ (or one-tailed)
Test statistic:
\[
z = \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}(1 - \hat{p})\left(\frac{1}{n_1} + \frac{1}{n_2}\right)}}
\]
Where p̂ = (x₁ + x₂) / (n₁ + n₂) is the pooled proportion.
Assumptions:
- Random, independent samples
- Sample size large enough so that np ≥ 5 and n(1−p) ≥ 5 (normal approximation holds)
---
A Worked Illustrative Example
Example data (illustrative only):
A factory claims its defect rate is at most 4% (p₀ = 0.04). A quality audit inspects n = 400 units and finds x = 24 defects, giving p̂ = 24/400 = 0.06.
Step 1 – Hypotheses:
H₀: p = 0.04 vs. H₁: p > 0.04 (one-tailed test)
Step 2 – Compute z:
\[
z = \frac{0.06 - 0.04}{\sqrt{\frac{0.04 \times 0.96}{400}}} = \frac{0.02}{\sqrt{0.000096}} = \frac{0.02}{0.0098} \approx 2.04
\]
Step 3 – Compare to critical value:
For a one-tailed test at α = 0.05, the critical z is 1.645. Since 2.04 > 1.645, we reject H₀.
Conclusion: There is statistically significant evidence that the true defect rate exceeds the claimed 4%. (Note: this is illustrative data, not real factory results.)
---
Common Pitfalls
- Small sample sizes: The normal approximation fails when np or n(1−p) is below 5. Use an exact binomial test instead.
- Ignoring the direction of the test: A one-tailed test requires a different critical value than a two-tailed test.
- Using the sample proportion in the denominator: For the one-sample test, always use the hypothesized p₀ in the standard error, not p̂.
- Confusing statistical significance with practical importance: A large sample can make a tiny difference "significant" even when it is not meaningful for the business.
---
Try It Yourself
Manual calculation is fine for a single test, but in daily quality work you will run many comparisons. Use the free, no-sign-up proportion test calculator at https://www.6sq.com/tools/proportion_test/ to get instant z-values and p-values—just enter your sample counts and hypothesized proportion.
No related results found
Invited:
6SQ Tools
0 replies