01 / 21

Proportion
Tests

Master one-sample and two-sample hypothesis tests for proportions: when to use them, how to compute the z-statistic, and how to interpret p-values in biostatistics contexts.

Biostatistics

What Is a Proportion?

A proportion is the fraction of a population or sample that has a particular characteristic. We denote the population proportion as \( p \) and the sample proportion as \( \hat{p} \).

\( p \)
The true population proportion: the value we want to learn about but usually cannot observe directly.
\( \hat{p} \)
The sample proportion: computed as \( \hat{p} = \frac{x}{n} \) where \( x \) is the count of successes and \( n \) is the sample size.

Why Test Proportions?

In biostatistics, we constantly ask questions about rates and percentages. Proportion tests give us a formal framework to decide whether observed differences are real or just sampling noise.

Drug Efficacy
Is the cure rate higher than the known 30% baseline?
Disease Prevalence
Does the infection rate differ between two regions?
Vaccination
Is the proportion of vaccinated individuals meeting the 90% target?

Sampling Distribution of \( \hat{p} \)

Under repeated sampling, \( \hat{p} \) follows an approximately normal distribution when the sample size is large enough. This is the foundation for our z-tests.

\(p\)
\( \text{Mean} = p \)
low high SE

One-Sample Z-Test for a Proportion

We use the one-sample proportion test to determine whether a sample proportion \( \hat{p} \) differs significantly from a hypothesized value \( p_0 \).

Two-Sample Z-Test for Proportions

When comparing proportions from two independent groups, we test whether the difference \( \hat{p}_1 - \hat{p}_2 \) is significantly different from zero.

One-Sample vs Two-Sample

One-Sample Two-Sample
Question Does \( p \) equal a known value \( p_0 \)? Do \( p_1 \) and \( p_2 \) differ?
SE denominator uses \( p_0 \) (hypothesized) \( \hat{p} \) (pooled)
Number of samples 1 group 2 independent groups
Typical scenario Compare to a standard Compare treatment vs control

Conditions to Check

Before running a proportion z-test, verify these three conditions are met:

1
Random sampling: the data must come from a random sample or randomized experiment.
2
Independence: observations must be independent. For sampling without replacement, verify \( n \leq 10\% \) of the population (the 10% condition).
3
Large sample (Normal approx.): For a one-sample test, check \( np_0 \geq 10 \) and \( n(1 - p_0) \geq 10 \). For a two-sample test, check that successes and failures are at least 10 in both groups: \( n_1\hat{p}_1 \geq 10 \), \( n_1(1-\hat{p}_1) \geq 10 \), \( n_2\hat{p}_2 \geq 10 \), and \( n_2(1-\hat{p}_2) \geq 10 \).

Step-by-Step Procedure

1
State hypotheses: write \( H_0 \) and \( H_a \) in terms of \( p \) (or \( p_1 - p_2 \)).
2
Check conditions: randomness, independence, and the large-sample normal approximation.
3
Compute the test statistic: calculate \( z \) using the appropriate formula.
4
Find the p-value: use the standard normal distribution to find the probability in the direction of \( H_a \).
5
Make a decision: if \( \text{p-value} < \alpha \), reject \( H_0 \). State the conclusion in context.

Example 1: One-Sample Test

A hospital claims that 80% of its patients are satisfied. A random sample of 150 patients finds 108 satisfied. Test at \( \alpha = 0.05 \) whether the true rate is less than 80%.

Visualizing Example 1

\(z = -2.45\)
\(z = 0\)
\(\text{p-value} = 0.0071\)
Reject Region

Example 2: Two-Sample Test

A clinical trial compares a new drug to a placebo. In the drug group (\( n_1 = 200 \)), 56 patients improved. In the placebo group (\( n_2 = 180 \)), 36 patients improved. Test at \( \alpha = 0.05 \) whether the drug has a higher improvement rate.

Example 2: Conclusion

\(z = 1.82\)
\(z = 0\)
\(z = 1.645\)
\(p = 0.0344\)

Example 3: Failing to Reject

A public health official claims the smoking rate in a city is \( p_0 = 0.18 \). A random sample of 400 adults finds 78 smokers. Test at \( \alpha = 0.05 \) (two-sided).

Common Mistakes

✕ Wrong SE Formula
Using \( \hat{p} \) instead of \( p_0 \) in the one-sample SE, or forgetting to pool in the two-sample test.
✕ Skipping Conditions
Not checking \( np \geq 10 \) and \( n(1-p) \geq 10 \). If these fail, the normal approximation is unreliable.
✕ One- vs Two-Tailed Confusion
Using a two-tailed p-value when \( H_a \) is one-sided (or vice versa). Always match the p-value calculation to \( H_a \).

Summary Comparison

One-Sample \( z \) Two-Sample \( z \)
Null \( p = p_0 \) \( p_1 = p_2 \)
Test Statistic $$ \frac{\hat{p} - p_0}{\sqrt{\frac{p_0(1-p_0)}{n}}} $$ $$ \frac{\hat{p}_1 - \hat{p}_2}{\sqrt{\hat{p}(1-\hat{p})(\frac{1}{n_1}+\frac{1}{n_2})}} $$
SE uses \( p_0 \) Pooled \( \hat{p} \)
Conditions \( np_0 \geq 10,\; n(1-p_0) \geq 10 \) Both groups meet success/failure check
Decision Compare \( \text{p-value} \) to \( \alpha \). Reject \( H_0 \) if \( \text{p-value} < \alpha \).

Question 1 of 5

In a one-sample proportion test, the standard error in the denominator uses:

Question 2 of 5

A researcher tests \( H_0: p = 0.5 \) vs \( H_a: p > 0.5 \) and finds \( z = 1.96 \). What is the p-value?

Question 3 of 5

In a two-sample proportion test, why do we use a pooled proportion \( \hat{p} \)?

Question 4 of 5

A sample of \( n = 30 \) finds \( \hat{p} = 0.03 \). Testing \( H_0: p = 0.05 \), which condition is violated?

Question 5 of 5

In a two-sample test, \( \hat{p}_1 = 0.35 \), \( n_1 = 100 \), \( \hat{p}_2 = 0.25 \), \( n_2 = 120 \). What is the pooled proportion \( \hat{p} \)?