Module 10: Hypothesis Testing With Two Samples
Comparing Two Independent Population Proportions
Barbara Illowsky & OpenStax et al.
When conducting a hypothesis test that compares two independent population proportions, the following characteristics should be present:
- The two independent samples are simple random samples that are independent.
- The number of successes is at least five, and the number of failures is at least five, for each of the samples.
- Growing literature states that the population must be at least ten or 20 times the size of the sample. This keeps each population from being over-sampled and causing incorrect results.
Comparing two proportions, like comparing two means, is common. If two estimated proportions are different, it may be due to a difference in the populations or it may be due to chance. A hypothesis test can help determine if a difference in the estimated proportions reflects a difference in the population proportions.
The difference of two proportions follows an approximate normal distribution. Generally, the null hypothesis states that the two proportions are the same. That is, H0: pA = pB. To conduct the test, we use a pooled proportion, pc.
The pooled proportion is calculated as follows: [latex]displaystyle{p}_{{c}}=frac{{{x}_{{A}}+{x}+{B}}}{{{n}_{{A}}+{n}_{{B}}}}[/latex]
The distribution for the differences is: [latex]displaystyle{P}prime_{{A}}-{P}prime_{{B}}~{N}{Bigg[{0},sqrt{{{p}_{{c}}{big({1}-{p}_{{c}}big)}{bigg(frac{{1}}{{n}_{{A}}}+frac{{1}}{{n}_{{B}}}bigg)}}}Bigg]}[/latex]
The test statistic (z-score) is: [latex]displaystyle{z}=frac{(pprime_{A}-pprime_{B})-(p_A-p_B)}{sqrt{p_c(1-p_c)(frac{1}{n_A}+frac{1}{n_B})}}[/latex]
Example
Two types of medication for hives are being tested to determine if there is a difference in the proportions of adult patient reactions. Twenty out of a random sample of 200 adults given medication A still had hives 30 minutes after taking the medication. Twelve out of another random sample of 200 adults given medication B still had hives 30 minutes after taking the medication. Test at a 1% level of significance.
Solution:
The problem asks for a difference in proportions, making it a test of two proportions.
Let A and B be the subscripts for medication A and medication B, respectively. Then pA and pB are the desired population proportions.
Random Variable: P′A – P′B = difference in the proportions of adult patients who did not react after 30 minutes to medication A and to medication B.
H0: pA = pB
pA – pB = 0
Ha: pA ≠ pB
pA – pB ≠ 0
The words “is a difference” tell you the test is two-tailed.
Distribution for the test: Since this is a test of two binomial population proportions, the distribution is normal:
[latex]displaystyle{p_c}=frac{x_A-x_B}{n_A-n_B}=frac{20+12}{200+200}=0.08[/latex] 1 – pc = 0.92
[latex]displaystyle{P}prime_{{A}}-{P}prime_{{B}}~{N}{Bigg[{0},sqrt {{{({0.08})}{({0.92})}{bigg(frac{{1}}{{200}}+frac{{1}}{{200}}bigg)}}}}Bigg][/latex]P′A – P′B follows an approximate n