Wiki Page, Math 13 - Perez Sandbox : Module 24 - Hypothesis Test for a Population Mean Matched Pairs (3 of 5)

Wiki Page
2026-01-17T21:15:42-08:00

Another common use of the t-test for a population mean is in “before and after” situations. In this situation, we have two quantitative measurements from a single sample of individuals. This is an example of a matched-pairs design.

EXAMPLE Drinking and driving

The Centers for Disease Control and Prevention (CDC) website cites studies from the National Highway Traffic Safety Administration to support this statement: “Alcohol use slows reaction time and impairs judgment and coordination, which are all skills needed to drive a car safely. The more alcohol consumed, the greater the impairment.” All states in the United States have adopted a blood alcohol concentration of 0.08% (80 mg/dL) as the legal limit for operating a motor vehicle. The CDC website continues, “Note: Legal limits do not define a level below which it is safe to operate a vehicle or engage in some other activity. Impairment due to alcohol use begins to occur at levels well below the legal limit.”

It is this last statement that may be surprising to drivers. Interviews with drunk drivers who were involved in accidents reveal that drunk drivers do not realize how drunk they are. "I only had one or two drinks—I am okay to drive" is a common sentiment.

Suppose a college conducts a study to call attention to this issue. Researchers use a random sample of 20 college students to examine the effect of drinking two beers on reaction times. They use a driving simulator to measure each student’s reaction time before and after drinking two beers. The reaction time is the time it takes the student to hit the brakes in the simulator when an obstacle appears in the road. Here is the data.

Reaction times of students before and after drinking two beers

Driver

Before
(seconds)

After
(seconds)

Before – After
(seconds)

1 | 6.25 | 6.85 | –0.60
2 | 2.96 | 4.78 | –1.82
3 | 4.95 | 5.57 | –0.62
4 | 3.94 | 4.01 | –0.07
5 | 4.85 | 5.91 | –1.06
6 | 4.81 | 5.34 | –0.53
7 | 6.60 | 6.09 | 0.51
8 | 5.33 | 5.84 | -0.51
9 | 5.19 | 4.19 | 1.00
10 | 4.88 | 5.75 | –0.07
11 | 5.75 | 6.25 | –0.50
12 | 5.23 | 7.23 | –1.97
13 | 3.16 | 4.55 | –1.39
14 | 6.65 | 6.42 | 0.23
15 | 5.49 | 5.25 | 0.24
16 | 4.05 | 5.59 | –1.54
17 | 4.42 | 3.96 | 0.46
18 | 4.99 | 5.93 | –0.94
19 | 5.01 | 6.03 | –1.02
20 | 4.69 | 3.72 | 0.97

In this situation, we have two quantitative measurements for each student. To measure the effect of the two beers, we subtract the two reaction times to create one measurement of “change” or “effect.” This controls the effects of individual characteristics that could influence reaction time, such as driving experience or natural quickness.

We define the difference as “before minus after.”

A negative difference in the last column means that person had a slower (longer) reaction time after two beers. (When "before minus after" is negative, then the After measurement is larger than the Before measurement.)

A positive difference in the last column means that person had a faster (shorter) reaction time after two beers. (When "before minus after" is positive, then the After measurement is smaller than the Before measurement.)

Note: It is common to define the difference in measurements as “before minus after.” But we could also define the difference the other way around as “after minus before.” In this definition, if the “after” reaction time is longer, then the difference is positive, so a slower reaction time after drinking corresponds to a positive value. This makes less intuitive sense to us. We want “negative” to mean “drinking has a negative effect,” so we used the other definition, “before minus after.”

Step 1: Determine the hypotheses

The null hypothesis is a claim of “no change” or “no effect.” The alternative hypothesis reflects the claim.

: Drinking two beers has no effect on reaction time.

: Drinking two beers slows reaction time.

If drinking two beers has no effect on reaction time, then the mean of the differences in reaction times (before minus after) will be zero. If drinking two beers slows reaction time, then the mean of the differences in reaction times (before minus after) will be negative (less than zero.) So we can rewrite our hypotheses as follows:

:

:

where is the mean of the difference in reaction time (before minus after) for all students at this college after drinking two beers.

Suppose researchers set a significance level of 5%.

Note: if we defined the difference in reverse order as “after minus before,” then a positive difference corresponds to a slower reaction time. This changes the alternative hypothesis to : . This will not affect the P-value or our conclusion. You just have to make sure the alternative hypothesis says what you want it to say given the way you define the difference.

Note: In some textbooks and other statistical materials, you will see the “mean of the difference” written as .

Step 2: Collect the data

Now we use the data from our supposed sample of 20 college students to calculate the mean and standard deviation of the differences.

The mean of the differences (before minus after) is approximately −0.46 seconds.

The standard deviation is approximately 0.87 seconds.

Step 3: Assess the evidence

Check the Criteria for Use of a T-Model

The sample size is only 20, and we do not know if these differences would be normally distributed in general when comparing these two treatments in the population of all college students. We therefore do not meet the conditions for use of a t-model. Some researchers would stop here and not complete the hypothesis test. Others would check the shape of the distribution of differences in the sample. If the sample is approximately normal (or at least not heavily skewed), then they view this as a hopeful indication that the distribution in the population will also be approximately normal, and they continue with the hypothesis test, adding a disclaimer to the conclusion.

Here is a histogram of the differences in the sample.

The data is not heavily skewed, so we are willing to proceed with the t-test and we will add a cautionary note to our conclusion.

Compute the Test Statistic

Find the P-value

We use the applet with the t-model for 19 degrees of freedom (df = n − 1 = 20 − 1 = 19). The P-value is . Here is a picture of the applet showing this result.

Step 4: State a conclusion

The P-value (0.015) is less than the significance level (0.05), so we reject the null and accept the alternative hypothesis that .

This study suggests that reactions times when driving are significantly slower after drinking two beers for students at this college. (P = 0.015).

It is good practice to include a disclaimer with this conclusion because the sample is small. We might add the following to our conclusion if we were publicly presenting these results: “The sample was too small to formally meet the requirements for a t-test. On the basis of the data, we are assuming that the difference in reaction times would be normally distributed in general when comparing these two treatments in the population of all college students. The conclusion from this test is valid only if this assumption is true.”

Comment

From this study, can we generalize to a larger population of “all college students” or “all drivers”?

Technically, such a generalization requires that the sample be randomly selected from the more general population. Is this type of random sampling done in practice? Not always. The matched pairs design controls for individual differences that would otherwise confound such a generalization. This is one of the reasons that researchers run hypothesis tests with data gathered by groups like the National Highway Traffic Safety Administration, even when participants are not randomly selected. But ideally we should select samples randomly from the population of interest.

Can we make a cause-and-effect conclusion from this study?

We should be cautious about a cause-and-effect conclusion here because there is no random assignment. We take measurements from every student in both the treatment and the control setting without randomizing the treatment order. Every participant did the driving test sober, then drank two beers and did the driving test again. Technically, we need a more sophisticated study design that uses random assignment in order to make cause-and-effect conclusions. For example, we could randomly assign the treatment order for each student by flipping a coin, assigning some students do the first driving test while sober and others do the first driving test after drinking two beers. Then everyone comes back on another day to complete the part of the experiment that he or she had not done.

The next activities give you an opportunity to practice parts of the hypothesis testing process. In each of these activities, the study is a matched-pairs design, so the population mean represents a mean of differences in paired measurements. Later you will have the opportunity to practice the hypothesis test from start to finish.

Mark this page as done, then click the "Next" or > button to continue.

Content by the Open Learning Initiative and licensed under CC BY.