Hypothesis Testing with Two Samples

Read this chapter, which discusses how to compare data from two similar groups. This is useful when, for example, you want to analyze things like how someone's income relates to another sample that you are interested in. Make sure you read the introduction as well as sections 10.1 through 10.6. Attempt the practice problems and homework at the end of the chapter.

Comparing Two Independent Population Proportions

When conducting a hypothesis test that compares two independent population proportions, the following characteristics should be present:

  1. The two independent samples are random samples that are independent.
  2. The number of successes is at least five, and the number of failures is at least five, for each of the samples.
  3. Growing literature states that the population must be at least ten or even perhaps 20 times the size of the sample. This keeps each population from being over-sampled and causing biased 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 in the sampling. A hypothesis test can help determine if a difference in the estimated proportions reflects a difference in the two population proportions.

Like the case of differences in sample means, we construct a sampling distribution for differences in sample proportions: (p′_A−p′_B) where p′_A=X \dfrac{A}{n_A} and p′_B=X\dfrac{B}{n_B} are the sample proportions for the two sets of data in question. XA and XB are the number of successes in each sample group respectively, and nA and nB are the respective sample sizes from the two groups. Again we go the Central Limit theorem to find the distribution of this sampling distribution for the differences in sample proportions. And again we find that this sampling distribution, like the ones past, are normally distributed as proved by the Central Limit Theorem, as seen in Figure 10.5 .

Figure 10.5

Figure 10.5

Generally, the null hypothesis allows for the test of a difference of a particular value, 𝛿_0, just as we did for the case of differences in means.

H_0:p_1−p_2=δ_0

H_1:p_1−p_2≠δ_0

Most common, however, is the test that the two proportions are the same. That is,

H_0:p_A=p_B

H_a:p_A≠p_B

To conduct the test, we use a pooled proportion, pc.

The pooled proportion is calculated as follows:

pc=\dfrac{x_A+x_B}{n_A+n_B}

The test statistic (z-score) is:

Z_c=\frac{\left(\mathrm{P}_A^{\prime}-\mathrm{P}_B^{\prime}\right)-\delta_0}{\sqrt{P_c\left(1-P_c\right)\left(\frac{1}{n_A}+\frac{1}{n_B}\right)}}=1.47

where δ0 is the hypothesized differences between the two proportions and pc is the pooled variance from the formula above.


Example 10.6

Problem
A bank has recently acquired a new branch and thus has customers in this new territory. They are interested in the default rate in their new territory. They wish to test the hypothesis that the default rate is different from their current customer base. They sample 200 files in area A, their current customers, and find that 20 have defaulted. In area B, the new customers, another sample of 200 files shows 12 have defaulted on their loans. At a 10% level of significance can we say that the default rates are the same or different?

Solution 1
This is a test of proportions. We know this because the underlying random variable is binary, default or not default. Further, we know it is a test of differences in proportions because we have two sample groups, the current customer base and the newly acquired customer base. Let A and B be the subscripts for the two customer groups. Then pA and pB are the two population proportions we wish to test.

Random Variable:
P′_A – P′_B = difference in the proportions of customers who defaulted in the two groups.

H_0:p_A=p_B

H_a:p_A≠p_B

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:

p_c=\dfrac{x_A+x_B}{n_A+n_B}=\dfrac{20+12}{200+200}=0.081–p_c=0.92

(p′_A – p′_B) = 0.04 follows an approximate normal distribution.

Estimated proportion for group A: p′_A=\dfrac{x_A}{n_A}=\dfrac{20}{200}=0.1

Estimated proportion for group B: p′_B=\dfrac{x_B}{n_B}=\dfrac{12}{200}=0.06

The estimated difference between the two groups is : p′_A – p′_B = 0.1 – 0.06 = 0.04.

Figure 10.6


Figure 10.6

 Z_c=\frac{\left(\mathrm{P}_A^{\prime}-\mathrm{P}_B^{\prime}\right)-\delta_0}{\sqrt{P_c\left(1-P_c\right)\left(\frac{1}{n_A}+\frac{1}{n_B}\right)}}=1.47

The calculated test statistic is 1.47 and is not in the tail of the distribution.

Make a decision: Since the calculate test statistic is not in the tail of the distribution we cannot reject H0.

Conclusion: At a 1% level of significance, from the sample data, there is not sufficient evidence to conclude that there is a difference between the proportions of customers who defaulted in the two groups.


Try It 10.6

Two types of valves are being tested to determine if there is a difference in pressure tolerances. Fifteen out of a random sample of 100 of Valve A cracked under 4,500 psi. Six out of a random sample of 100 of Valve B cracked under 4,500 psi. Test at a 5% level of significance.