## 1. Intro

For this sub-competency, we will be using confidence intervals and hypothesis testing as tools for comparing two populations. Since the goal of most experiments is to compare two (or more) treatments, we need rigorous statistical tools to identify when there are significant differences between the treatments. Do NOT freak out about the size and messiness of the formulas. On the whole, they are the same as we’ve used before, at least in terms of the language of the terms used. However, because we’re dealing with two (or more) populations now, most formulas are going to be scaled-up to include values from both populations. There are going to be plenty of subscripts!

One of the most important ideas to keep in mind is this: if two things are equal, then the difference between them is zero. In symbols, if a = b, then ab = 0. That should be pretty obvious. But when we jump to comparing, for example, the mean of two different populations (μ1 and μ2), the notation can start to confuse the best of us. For example:

if μ1 = μ2, then:
μ1μ2 = 0

The number 0 is going to be very important to us. Because of this, we’ll have the two following goals:

• When creating a confidence interval about the difference of two populations, we’re going to be solely interested in whether our interval contains the number 0.
• When conducting a hypothesis test, our null hypothesis (which tests the condition of no difference between the two populations) will be: H0: μd = 0, where μd stands for the difference in the two populations, i.e., μd = μ1μ2. Our alternative hypothesis will be that μd is either greater than, less than, or not equal to (different from) zero.

## 2. Inference Methods for Two Population Proportions

At this time, it would probably be helpful to refer back to sub-competencies 8 and 10, where you learned about confidence intervals and hypothesis testing for population proportions. The inference formulas for comparing two population proportions are going to seem more complicated, but they are fundamentally the same and will look remarkably similar!

First, we need some notation and assumptions. We have two values for each variable, one for each of the two samples:

• The two hypothesized proportions, p1 and p2
• The two sample sizes, n1 and n2
• The two numbers with the certain characteristic, x1 and x2
• The two sample proportions, 1 = x1 / n1 and 2 = x2 / n2

The biggest difference, again, is with the standard deviation of the difference in sample proportions. Whereas with one sample with two independent samples the sample standard deviation for the difference in two proportions is: Recall that when dealing with two proportions, our sample sizes, n1 and n2, must satisfy the two basic requirements:

• n1p1 (1 – p1) ≥ 10 and n2p2 (1 – p2) ≥ 10
• n1 ≤ 0.05(N1) and n2 ≤ 0.05(N2), which state that the sample sizes be no larger than 5% of the population size. This condition ensures that our samples remain independent.

These requirements must be satisfied in order for our results from both hypothesis testing and confidence intervals to be valid.

## 3. A Confidence Interval for the Difference between Two Population Proportions

A level C = (1 – α) ⋅ 100% confidence interval for the difference between two population proportions, p1p2, is: which, in interval notation, is: ## 4. A Hypothesis Test Regarding Two Population Proportions

Skipping most of the details, the null hypothesis is the assumed condition that the proportions from both populations are equal,H0: p1 = p2, and the alternative hypothesis is one of the three conditions of non-equality.

When calculating the test statistic z0 (notice we use the standard normal distribution), we are assuming that the two population proportions are the same, p1 = p2 = . Now if both Population 1 and Population 2 are the same in terms of the required proportion, they could be considered to be the “same” population. (Think about this a bit.) We define  to be the pooled population proportion: Substituting  into the sample standard deviation expression gives: The formula for the test statistic z0 becomes: The term p1p2 in the numerator disappears because we are assuming that p1 = p2, so p1p2 = 0.

All other steps for the hypothesis test remain the same as discussed in sub-competency 9.

Example

A nutritionist claims that the proportion of individuals who have at most an eighth-grade education and consume more than the USDA’s recommended daily allowance of 300 mg of cholesterol is higher than the proportion of individuals who have at least some college and consume too much cholesterol. In interviews with 320 individuals who have at most an eighth-grade education, she determined that 114 of them consumed too much cholesterol. In interviews with 350 individuals with at least some college, she determined that 112 of them consumed too much cholesterol per day.

The most challenging part of using inference tools on problems dealing with two populations is keeping the information straight. Before starting any of the inference methods, take a few moments to label each population. That way you won’t get confused about which information pertains to which population. For example, Population 1 is the group of people who have at most an eighth-grade education and consume more than the USDA’s recommended daily allowance of 300 mg of cholesterol. Therefore, Population 2 is the group of people who have at least some college education and consume too much cholesterol.

First, let’s perform a hypothesis test on the difference in the two population proportions using a level of significance α = 0.05 (i.e., 5%). Keeping the information straight, we find:

 Population 1 Population 2 n1 = 320 p1 = 114/320 = 0.356.25 n2 = 350 p2 = 112/350 = 0.32

The null hypothesis, which is stated in Step 1, is the assumption that the two populations do not differ in terms of the characteristic of interest. We therefore need to determine the pooled proportion, : Step 1: State the null and alternative hypotheses.

• H0: p1 = p2
• H1: p1 > p2

Notice that this is a one-tail test, since the nutritionist claims that p1 “… is higher than…” p2.

Step 2: Determine the test statistic z0.

Using the calculated information shown in the above chart, we see: In other words, the two population proportions are roughly only 1 standard deviation different from each other.

Step 3: Determine the P-value and Identify the Level of Significance

Using the test statistic z0 ≈ 0.99, a table of standard normal values indicates that the P-value is 0.1611. Using technology, we get the results z0 ≈ 0.9913 and P-value = 0.1608.

The level of significance was given to us as α = 0.05.

Step 4: Make Appropriate Conclusions

Because our P-value is far greater than the level of significance, α = 0.05, the conclusion of our hypothesis test is: Do Not Reject the Null Hypothesis H0: p1 = p2. In other words, the data set does not provide significant evidence that there is a real difference in how college-educated people and those with at most an eighth-grade education consume cholesterol.

### A Confidence Interval Approach

For fun, let’s continue with this example but use a 95% confidence interval about the difference between the two population proportions p1p2. Using the information in the table above, we compute: In interval notation, our 95% confidence interval is:

(-0.0355,0.1080)

Since the value 0 is contained within this interval, this means there is likely no difference in the two population proportions. This supports the conclusions of our hypothesis test.

## 5. Independent and Dependent Sampling

It’s important at this time to distinguish between sampling methods that result in an independent sample and methods that result in a dependent sample. Two (or more) samples are called independent if the members chosen for one sample do not determine which individuals are chosen for a second sample. Two (or more) samples are called dependent if the members chosen for one sample automatically determine which members are to be included in the second sample.

Dependent samples are often called matched-pairs samples because individuals in one sample can be “matched” with a corresponding individual used in another sample. The terminology is self-evident because we’re going to observe a “pair” of individuals, one involved in each sample, which will allow us to compare results for the given pair. For example, a husband and wife are often considered a pair, with the husband in one sample and the wife in the other. We then compare the difference(s) in characteristics of interest. Twins also make a great pair. The term “pair” can be misleading because sometimes the pair is only one individual who is involved in both samples. This often arises in “before and after” experiments.

## 6. Inference Methods for Dependent Samples

The method to analyze matched-pairs data is to first combine the pair into one measurement (a new data set!) by calculating the difference between the two data sets. Some examples:

• If our data set consists of before and after measurements, we subtract the before value from the after value to get a single “difference” measurement.
• If our data set consists of Twin 1 and Twin 2 measurements, we subtract the Twin 1 value from the Twin 2 value to get a single “difference between twins” measurement.

## 7. A Confidence Interval for Population Mean Difference of Matched-Pairs Data

Following the same logic of a level C = (1 – α) ⋅ 100% confidence interval, we use the standard formula:

point estimate ± margin of error

Before we jump to the confidence interval formula, we need to see a bit of notation. The population mean difference in the two data sets is denoted by μd, and we represent the sample mean difference in the two data sets by . The standard deviation of the difference in the two data sets is represented by sd.

Our point estimate of μd is, thus, . The formula for a level C = (1 – α) ⋅ 100% confidence interval is which, in interval notation, is: ## 8. Hypothesis Testing for Matched-Pairs Data

Once we have the one data set (which, again, represents the difference between the two populations), we need to calculate both the mean and standard deviation of this new data set and then use the same hypothesis test steps and formulas as before. The only change is the act of subtracting the matched-pairs data to obtain one sample. And remember, since we do not know the exact value of the population standard deviation of the difference, σd, we must estimate σd with the sample standard deviation of the difference, sd. Therefore, we cannot use the standard normal distribution and must instead rely on the Student’s t-distribution. As usual, focus on the P-value approach to calculating confidence intervals and performing hypothesis tests.

## 9. Inference Methods for Independent Samples

In this section we learn about inference methods for comparing population means from two independent samples of data. These methods work for situations such as testing whether a new drug lowers cholesterol levels more than the current drug or comparing two different teaching methods conducted on difference classes (or different students within the same class).

The formulas and steps that we’ll use for hypothesis testing and confidence intervals are fundamentally the same as we used throughout the previous sub-competencies. However, when comparing two population means from independent samples of data, some of the details of the new formulas go beyond the scope of this class because we now have two values for each variable–one for each of the two samples:

• The two hypothesized means: μ1 and μ2
• The two sample sizes: n1 and n2
• The two sample means, 1 and 2
• The two sample standard deviations, s1 and s2

In particular, the sample standard deviation of the sample difference 12 is not as intuitive because we must “combine” the standard deviations from two independent samples. Without showing any proof, it turns out that the standard deviation of the sample difference 12 is: Realize that although this standard deviation looks completely different from the previously used standard deviation of the sample mean, σ = σ/√n , the difference is actually very minimal, and is based on the following (obvious) bit of algebra: (you should verify this algebraically)

Thus, instead of including the term in a formula, we could just as easily use In a rough sense, because we have a sample standard deviation from each independent sample, there will be a term representing each sample. This should help illustrate why the standard deviation of the sample difference 12 looks the way it does.

## 10. A Confidence Interval for the Difference of Two Independent Means

Not much changes here, except for the inclusion of the point estimate for the difference in population means μ1μ2, which is the value 12, and the standard deviation of the sample difference, which as discussed earlier is A level C = (1 – α) ⋅ 100% confidence interval for the population mean difference is, therefore: which, in interval notation, is: 