Stat Trek

Teach yourself statistics

Stat Trek

Teach yourself statistics


Hypothesis Test: Difference Between Paired Means

This lesson explains (1) what paired data is and (2) how to conduct a hypothesis test for the difference between paired means, using a matched-pairs t-test. Key points are illustrated step-by-step with a sample problem.

Understanding Paired Data

Paired data consists of a set of observations that are dependent or somehow related. Some ways to achieve pairing include the following:

  • Take two measurements on the same subject (e.g., before and after treatment).
  • Take one measurement on each member of a naturally-occurring pair (e.g., twins or spouses).
  • Take one measurement on each member of an artificial pair (e.g., subjects matched on some attribute, like height, weight, or IQ).

Key Measure

With paired data, a key measure of interest is the difference (d) between paired measurements:

d = x1 - x2

where d is the difference for a single pair, and x1 and x2 are two related measurements on the same pair.

Key Statistics

If we select a simple random sample of n matched pairs, we can compute the mean difference (d) and the standard deviation (s) of the sampled differences:

d = Σdi / n

s = sqrt [ Σ (di - d)2 / (n - 1) ]

where di is the difference for the ith data pair. The sample mean d is a point estimate of the mean difference in the population of pairs.

Requirements for Analysis

This lesson explains how to conduct a hypothesis test for the difference between paired means. The approach described is valid when the following conditions are met:

When is it normal?

Generally, it is safe to assume the sampling distribution of the mean difference between data pairs will be approximately normal in shape when any of the following statements are true.

  • The population distribution of paired differences (i.e., the variable d) is normal.
  • The sample distribution of paired differences is symmetric, unimodal , without outliers, and the sample size is 15 or less.
  • The sample distribution is moderately skewed, unimodal, without outliers, and the sample size is between 16 and 29.
  • The sample size is 30 or more, without outliers.

General Procedure for Hypothesis Testing

To test any hypothesis, the same five-step procedure is used: (1) state the hypotheses, (2) choose the significance level, (3) compute the test statistic, (4) find the P-value, and (5) interpret results. Here, we apply the general procedure to a hypothesis test for means with paired data.

State the Hypotheses

Every hypothesis test requires the analyst to state a null hypothesis and an alternative hypothesis . The table below shows three sets of null and alternative hypotheses. Each makes a statement about how the true difference in population values μd is related to some hypothesized value D. (In the table, the symbol ≠ means " not equal to ".)

Set Null hypothesis Alternative hypothesis Number of tails
1 μd= D μd ≠ D 2
2 μd > D μd < D 1
3 μd < D μd > D 1

The first set of hypotheses (Set 1) is an example of a two-tailed test , since an extreme value on either side of the sampling distribution would cause a researcher to reject the null hypothesis. The other two sets of hypotheses (Sets 2 and 3) are one-tailed tests , since an extreme value on only one side of the sampling distribution would cause a researcher to reject the null hypothesis.

Choose the Significance Level

Common choices for significance levels are α = 0.05 or α = 0.01, representing the probability of rejecting the null hypothesis when it is true (Type I error).

Compute the Test Statistic

Use the matched-pairs t-test to determine whether the sample difference (d) for paired data is significantly different from the hypothesized population difference. This test requires that you compute the standard error of the sampling distribution for d , a t-score test statistic, and the degrees of freedom for the test statistic. Formulas for all the necessary computations appear below.

  • Standard error. Compute the standard error (SE) of the sampling distribution of d.

    SE = s * sqrt{ ( 1/n ) * [ (N - n) / ( N - 1 ) ] }

    where s is the standard deviation of paired differences, N is the number of matched pairs in the population, and n is the number of matched pairs in the sample. When the population size is much larger (at least 20 times larger) than the sample size, the standard error can be approximated by:

    SE = s / sqrt( n )

  • Test statistic. The test statistic is a t-score (t) defined by the following equation.

    t = (d - D) / SE

    where d is the mean difference between paired values in the sample, D is the hypothesized difference between population means, and SE is the standard error.
  • Degrees of freedom. The degrees of freedom (df) is: df = n - 1 .

Find the P-Value

The P-value is the probability of observing a sample statistic as extreme as the test statistic. Since the test statistic is a t-score, use a t-distribution table or statistical software to find the probability for the t-score critical value, given the degrees of freedom computed above. (In the sample problem at the end of this lesson, we use the t Distribution Calculator to find the P-value probability.)

Interpret Results

If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis. This involves comparing the P-value to the significance level, and rejecting the null hypothesis when the P-value is less than the significance level.

Test Your Understanding

Problem

Forty-four sixth graders were randomly selected from a school district. Then, they were divided into 22 matched pairs, each pair having equal IQ's. One member of each pair was randomly selected to receive special training. Then, all of the students were given an IQ test. Test results are summarized below.

Pair Training No training Diff, d (d - d)2
1 95 90 5 16
2 89 85 4 9
3 76 73 3 4
4 92 90 2 1
5 91 90 1 0
6 53 53 0 1
7 67 68 -1 4
8 88 90 -2 9
9 75 78 -3 16
10 85 89 -4 25
11 90 95 -5 36

Pair Training No training Diff, d (d - d)2
12 85 83 2 1
13 87 83 4 9
14 85 83 2 1
15 85 82 3 4
16 68 65 3 4
17 81 79 2 1
18 84 83 1 0
19 71 60 11 100
20 46 47 -1 4
21 75 77 -2 9
22 80 83 -3 16

Σ(d - d)2 = 270

d = 1

Do these results provide evidence that the special training helped or hurt student performance? Use an 0.05 level of significance. Assume that the mean differences are approximately normally distributed.

Solution

The solution to this problem takes five steps:(1) state the hypotheses, (2) choose the significance level, (3) compute the test statistic, (4) find the P-value, and (5) interpret results. We work through those steps below:

  1. State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis.

    Null hypothesis: μd = 0

    Alternative hypothesis: μd ≠ 0

    Note that these hypotheses constitute a two-tailed test. The null hypothesis will be rejected if the difference between sample means is too big or if it is too small.
  2. Choose the significance level. For this problem, the significance level is 0.05.
  3. Compute the test statisic. To define a test statistic for a matched-pairs t-test, we need to compute the following measures: the standard deviation of the differences (s), the standard error (SE) of the mean difference, the degrees of freedom (df), and the t-score test statistic (t). Those computations appear below:

    s = sqrt [ (Σ(di - d)2 / (n - 1) ]

    s = sqrt[ 270/(22-1) ] = sqrt(12.857) = 3.586


    SE = s / sqrt(n) = 3.586 / [ sqrt(22) ]

    SE = 3.586/4.69 = 0.765


    df = n - 1 = 22 -1 = 21


    t = (d - D)/ SE = (1 - 0)/0.765 = 1.307

    where di is the observed difference for pair i, d is mean difference between sample pairs, D is the hypothesized mean difference between population pairs, and n is the number of pairs.

  4. Find the P-value. Since we have a two-tailed test, the P-value is the probability that a t-score having 21 degrees of freedom will be more extreme than the test statistic (i.e., less than -1.307 or greater than 1.307). We use the t Distribution Calculator to find P(t < -1.307) is about 0.103.
t-Distribution Calculator
  1. Since the t-distribution is symmetric around zero, we know that the P(t < 1.307) equals, P(t > 1.307). Thus, the P-value = 0.103 + 0.103 = 0.206.
  1. Interpret results. Since the P-value (0.206) is greater than the significance level (0.05), we cannot reject the null hypothesis.

Note: If you use this approach on an exam, you may also want to mention why this approach is appropriate. Specifically, the approach is appropriate because the sampling method was simple random sampling, the samples consisted of paired data, and the mean differences were normally distributed. In addition, we used the approximation formula to compute the standard error, since the sample size was small relative to the population size.