section 9.3 hypothesis tests for the difference between two means: paired samples copyright ©2014...

29
SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Upload: declan-ottley

Post on 14-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

SECTION 9.3HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES

Copyright ©2014 The McGraw-Hill Companies, Inc.  Permission required for reproduction or display.

Page 2: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Objectives

1. Perform a hypothesis test with matched pairs using the P-value method

2. Perform a hypothesis test with matched pairs using the critical value method

3. Construct confidence intervals with paired samples

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 3: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Perform a hypothesis test with matched pairs using the P-value method

Objective 1

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 4: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Paired Samples

A sample of eight automobiles were run to determine their mileage, in miles per gallon. Then each car was given a tune-up, and run again to measure the mileage a second time.

The sample mean mileage was higher after tune-up. We would like to determine how strong the evidence is that the population mean mileage is higher after tune-up.

These are paired samples, because each value before tune-up is paired with the value from the same car after tune-up.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 5: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Matched Pairs

When we have paired samples, the pairs are called matched pairs. By computing the difference between the values in each matched pair, we construct a sample of differences:

If we denote the population mean mileage before tune-up by , and the population mean mileage after tune-up by , then we are interested in the difference −. Because these are paired samples, the population mean of the differences, , is the same as −.

Therefore, performing a hypothesis test on is the same as performing a hypothesis test on the difference of the population means − .

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 6: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Notation

We use the following notation:

• is the sample mean of the differences between the values in the matched pairs.

• is the sample standard deviation of the differences between the values in the matched pairs.

• is the population mean difference for the matched pairs.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 7: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Assumptions

The method for testing a hypothesis about is the usual method for testing a hypothesis about a population mean. It requires the following assumptions:

1. We have a simple random sample of matched pairs.

2. Either the sample size is large (n > 30), or the differences between items in the matched pairs show no evidence of strong skewness and no outliers. This is required to be sure that will be approximately normally distributed.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 8: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Hypothesis Test with Matched-Pair Data Using the P-Value Method

Step 1: State the null and alternate hypotheses.

Step 2: If making a decision, choose a significance level .

Step 3: Compute the test statistic .

Step 4: Compute the P-value. The P-value is an area under the t curve with degrees of freedom.

Step 5: Interpret the P-value. If making a decision, reject if the P-value is less than or equal to the significance level .

Step 6: State a conclusion.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 9: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Example

Using the data about a tune-up improving car engine gas mileage, test versus > 0. Use the = 0.01 significance level.

Solution:We first check the assumptions. We have a simple random sample of differences. Because the sample size is small (n = 8), we must check for signs of strong skewness or outliers. Following is a dotplot of the differences.

The dotplot does not reveal any outliers or strong skewness. Therefore we may proceed.Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or

display.

Page 10: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Solution

Step 1: State and : > 0

Step 2: Choose a significance level: We will use = 0.01.

Step 3: Compute the test statistic: First we compute the sample mean and sample standard deviation of the differences. These are

= 1.20625 = 0.37317

Under the assumption that is true, . The value of the test statistic is therefore

= = 9.1427

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 11: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Solution

Step 4: Compute the P-value: Under the assumption that is true, the test statistic has a t distribution. The number of degrees of freedom is n − 1 = 8 − 1 = 7. The alternate hypothesis is > 0, so the P-value is the area to the right of the observed value of 9.1427. Technology gives P = 0.0000193.

Step 5: Interpret the P-value: The P-value is nearly 0. Because P < 0.01, we reject at the = 0.01 level.

Step 6: State a conclusion: We conclude that the gas mileage increased after a tune-up.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 12: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Perform a hypothesis test with matched pairs using the critical value method

Objective 2

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 13: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Testing a Hypothesis with Matched-Pair Data Using the Critical Value Method

The critical value method for matched-pair data is essentially the same as that for a population mean with unknown. The assumptions for the critical value method are the same as for the P-value method.

Step 1: State the null and alternate hypotheses.

Step 2: Choose a significance level and find the critical value or values.Step 3: Compute the test statistic .

Step 4: Determine whether to reject , as follows:

Step 5: State a conclusion.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 14: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Example

For a sample of nine automobiles, the mileage (in 1000s of miles) at which the original front brake pads were worn to 10% of their original thickness was measured, as was the mileage at which the original rear brake pads were worn to 10% of their original thickness. The results are given below.

The differences in the last line of the table are Rear − Front. Can you conclude that the mean time for the rear brake pads to wear out is longer than the mean time for the frontpads? Use the α = 0.05 significance level.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 15: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Solution

Check the assumptions: Since the sample size is small, we construct a dotplot.

The dotplot shows no evidence of outliers or extreme skewness, so we may proceed.

Step 1: State the null and alternate hypotheses: We are interested in determining whether the mean time for the rear pads is longer than for the front. Therefore, the hypotheses are

> 0

Step 2: Choose a significance level α and find the critical value: We will use = 0.05. Because this is a right-tailed test, the critical value is the value for which the area to the right is 0.05. The sample size is n = 9, so there are 9 − 1 = 8 degrees of freedom. The critical value is = 1.860.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 16: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Solution

Step 3: Compute the test statistic: The sample size is n = 9. We compute the sample mean and standard deviation of the differences

= 10.1444 = 1.0333

The test statistic is =

Step 4: Determine whether to reject : This is a right-tailed test, so we reject if . Because t = 60.28 and = 1.860, we reject at the = 0.05 level.

Step 5: State a conclusion: We conclude that the mean time for rear brake pads to wear out is longer than the mean time for front brake pads.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 17: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Construct confidence intervals with paired samples

Objective 3

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 18: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Paired Samples

Suppose we select sixteen volunteers and they are given a test in which they had to push a button in response to the appearance of an image on a screen. Their reaction times are measured. Then the subjects consumed enough alcohol to raise their blood alcohol level to 0.05%. They then took the reaction test again.

Now, we have gathered two samples of data, a sample of reaction times before alcohol consumption, and a sample after alcohol consumption.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 19: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Notation

We can compute the means of the two original samples as well as the mean of the sample of differences between each matched pair.

The data for our experiment, along with the means, is presented in the table:

Means of the two original samples:

and

Mean of the sample differences

between each matched pair:

0.05% 0% Difference 1 102 103 -12 100 99 13 77 69 84 61 50 115 85 96 -116 50 26 247 95 71 248 115 109 69 64 53 11

10 98 89 911 107 103 412 44 27 1713 47 50 -314 92 100 -815 70 66 416 94 86 8

Sample Mean 81.3 74.8 6.5

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 20: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Relationship Between , , and

The values of , , and are

= 81.3 , = 74.8, and = 6.5

Simple arithmetic shows that the mean of the differences, , is the same as the difference between the sample means. In other words, = .

The same relationship holds for the populations. If we let and represent the population means and represent the population mean of the difference, then = .

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 21: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Confidence Interval Using Matched Pairs

Since = , a confidence interval for the mean is also a confidence interval for the difference . The paired data reduce the two-sample problem to a one-sample problem.

Suppose we want to construct a confidence interval for the population mean increase of our experiment. The method for computing a confidence interval for is the usual method for computing a confidence interval for a population mean.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 22: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Confidence Interval for the Mean Difference Between Matched Pairs

Let be the sample mean of the differences between matched pairs, and let be the sample standard deviation.

Let be the population mean difference between matched pairs.

A level 100(1 − )% confidence interval for is

– < < +

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 23: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Example

Suppose we select sixteen volunteers and they are given a test in which they had to push a button in response to the appearance of an image on a screen. Their reaction times are measured. Then the subjects consumed enough alcohol to raise their blood alcohol level to 0.05%. They then took the reaction test again.

Construct a 95% confidence for , the mean difference in reaction times.

0.05% 0% Difference 1 102 103 -12 100 99 13 77 69 84 61 50 115 85 96 -116 50 26 247 95 71 248 115 109 69 64 53 11

10 98 89 911 107 103 412 44 27 1713 47 50 -314 92 100 -815 70 66 416 94 86 8

Sample Mean 81.3 74.8 6.5

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 24: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Solution

First, we check the assumptions. Since the sample size is small (n = 16), we construct a boxplot for the differences to check for outliers or strong skewness.

There are no outliers and no evidence of strong skewness, so we may proceed.

Step 1: Compute the sample mean difference , and the sample standard deviation of the differences .

The sample mean and standard deviation are

= 6.500 = 9.93311Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or

display.

Page 25: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Solution

Step 2: Compute the critical value. We use the t statistic. The sample size is n = 16, so

the degrees of freedom is 16 − 1 = 15. The confidence level is 95%. From Table A.3, we find the critical value to be

= 2.131

Step 3: Compute the standard error and the margin of error.

The standard error is

The margin of error is

= 2.131(2.48328) = 5.292Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or

display.

Page 26: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Solution

Step 4: Construct the confidence interval. The 95% confidence interval is

Point estimate margin of error

6.5 – 5.292 < < 6.5 + 5.292

1.2 < < 11.8

Step 5: Interpret the result: We are 95% confident that the mean difference is

between 1.2 and 11.8. In particular, the confidence interval does not contain 0, and all the values in the confidence interval are positive. We can be fairly certain that the mean reaction time is greater when the blood alcohol

level is 0.05%.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 27: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Matched Pairs and Margin of Error

Matched pairs usually have a smaller margin of error than the margin of error for two independent samples.

To see this, we will compute the sample standard deviations for the reaction time data in the previous example.

Let denote the sample standard deviation for the blood level 0.05% sample and let denote the sample standard deviation for the blood level 0 sample.

We have

= 22.71 = 27.39

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 28: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Matched Pairs and Margin of Error

If the samples had been independent, the standard error would have been

= = 8.90

Because we were able to use the sample of differences, the standard error was only 2.48.

This smaller value results in a smaller margin of error.

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Page 29: SECTION 9.3 HYPOTHESIS TESTS FOR THE DIFFERENCE BETWEEN TWO MEANS: PAIRED SAMPLES Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for

Do You Know…

• How to perform a hypothesis test with matched pairs using the P-value method?

• How to perform a hypothesis test with matched pairs using the critical value method?

• How to construct confidence intervals with paired samples?

Copyright ©2014 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.