Chapter6 20191 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 92

Chapter 6: Hypothesis Testing

(1)
NGUYỄN THỊ THU THỦY

SCHOOL OF APPLIED MATHEMATICS AND INFORMATICS


HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

HANOI – 2019

(1)
Email: [email protected]
Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 1 / 64
6.1 Introduction

Content

1 6.1 Introduction
6.1.1 Key terms and concepts
6.1.2 Statistical decision for hypothesis testing

2 6.2 Hypothesis Testing with One Sample


6.2.1 Introduction to hypothesis testing
6.2.2 Hypothesis Testing for the Mean
6.2.3 Hypothesis testing for proportions

3 6.3 Hypothesis Testing with Two Samples


6.3.1 Testing the Difference Between Means (Independent Samples)
6.3.2 Testing the Difference Between Proportions

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 2 / 64


6.1 Introduction 6.1.1 Key terms and concepts

Introduction

Introduction
Hypothesis testing was introduced by Ronald Fisher, Jerzy Neyman, Karl Pearson and
Pearson’s son, Egon Pearson. Hypothesis testing is a statistical method that is used in
making statistical decisions using experimental data. Hypothesis Testing is basically an
assumption that we make about the population parameter.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 3 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts

Null hypothesis
Null hypothesis is a statistical hypothesis that assumes that the observation is due
to a chance factor.
Null hypothesis is denoted by H0 .

Alternative hypothesis
Contrary to the null hypothesis, the alternative hypothesis shows that observations
are the result of a real effect.
The alternative hypothesis, denoted by H1 .

Examples
H0 : µ1 = µ2 , which shows that there is no difference between the two population
means.
H1 : µ1 6= µ2 or H1 : µ1 > µ2 or H1 : µ1 < µ2 .

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 4 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts

Null hypothesis
Null hypothesis is a statistical hypothesis that assumes that the observation is due
to a chance factor.
Null hypothesis is denoted by H0 .

Alternative hypothesis
Contrary to the null hypothesis, the alternative hypothesis shows that observations
are the result of a real effect.
The alternative hypothesis, denoted by H1 .

Examples
H0 : µ1 = µ2 , which shows that there is no difference between the two population
means.
H1 : µ1 6= µ2 or H1 : µ1 > µ2 or H1 : µ1 < µ2 .

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 4 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts

Null hypothesis
Null hypothesis is a statistical hypothesis that assumes that the observation is due
to a chance factor.
Null hypothesis is denoted by H0 .

Alternative hypothesis
Contrary to the null hypothesis, the alternative hypothesis shows that observations
are the result of a real effect.
The alternative hypothesis, denoted by H1 .

Examples
H0 : µ1 = µ2 , which shows that there is no difference between the two population
means.
H1 : µ1 6= µ2 or H1 : µ1 > µ2 or H1 : µ1 < µ2 .

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 4 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts

Level of significance
Refers to the degree of significance in which we accept or reject the
null-hypothesis.
100% accuracy is not possible for accepting or rejecting a hypothesis, so we
therefore select a level of significance that is usually 5%.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 5 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts


Type I error
When we reject the null hypothesis, although that hypothesis was true.
P [Type I error] = α.
In hypothesis testing, the normal curve that shows the critical region is called the
α region.

Type II error
When we accept the null hypothesis but it is false.
P [Type II error] = β.
In Hypothesis testing, the normal curve that shows the acceptance region is called
the β region.

Power
Usually known as the probability of correctly accepting the null hypothesis. 1 − β is
called power of the analysis.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 6 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts


Type I error
When we reject the null hypothesis, although that hypothesis was true.
P [Type I error] = α.
In hypothesis testing, the normal curve that shows the critical region is called the
α region.

Type II error
When we accept the null hypothesis but it is false.
P [Type II error] = β.
In Hypothesis testing, the normal curve that shows the acceptance region is called
the β region.

Power
Usually known as the probability of correctly accepting the null hypothesis. 1 − β is
called power of the analysis.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 6 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts


Type I error
When we reject the null hypothesis, although that hypothesis was true.
P [Type I error] = α.
In hypothesis testing, the normal curve that shows the critical region is called the
α region.

Type II error
When we accept the null hypothesis but it is false.
P [Type II error] = β.
In Hypothesis testing, the normal curve that shows the acceptance region is called
the β region.

Power
Usually known as the probability of correctly accepting the null hypothesis. 1 − β is
called power of the analysis.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 6 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts

One-tailed test
A one-tailed test is a statistical test in which the critical area of a distribution is
one-sided so that it is either greater than or less than a certain value, but not both.

Two-tailed test
A two-tailed test is a method in which the critical area of a distribution is two-sided and
tests whether a sample is greater than or less than a certain range of values.

Examples
1 One-tailed test:
Left-tailed test: H0 : µ1 = µ2 , H1 : µ1 < µ2 ;
Right-tailed test: H0 : µ1 = µ2 , H1 : µ1 > µ2 .
2 Two-tailed test: H0 : µ1 = µ2 , H1 : µ1 6= µ2 .

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 7 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts

One-tailed test
A one-tailed test is a statistical test in which the critical area of a distribution is
one-sided so that it is either greater than or less than a certain value, but not both.

Two-tailed test
A two-tailed test is a method in which the critical area of a distribution is two-sided and
tests whether a sample is greater than or less than a certain range of values.

Examples
1 One-tailed test:
Left-tailed test: H0 : µ1 = µ2 , H1 : µ1 < µ2 ;
Right-tailed test: H0 : µ1 = µ2 , H1 : µ1 > µ2 .
2 Two-tailed test: H0 : µ1 = µ2 , H1 : µ1 6= µ2 .

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 7 / 64


6.1 Introduction 6.1.1 Key terms and concepts

6.1.1 Key terms and concepts

One-tailed test
A one-tailed test is a statistical test in which the critical area of a distribution is
one-sided so that it is either greater than or less than a certain value, but not both.

Two-tailed test
A two-tailed test is a method in which the critical area of a distribution is two-sided and
tests whether a sample is greater than or less than a certain range of values.

Examples
1 One-tailed test:
Left-tailed test: H0 : µ1 = µ2 , H1 : µ1 < µ2 ;
Right-tailed test: H0 : µ1 = µ2 , H1 : µ1 > µ2 .
2 Two-tailed test: H0 : µ1 = µ2 , H1 : µ1 6= µ2 .

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 7 / 64


6.1 Introduction 6.1.2 Statistical decision for hypothesis testing

6.1.2 Statistical decision for hypothesis testing

Statistical decision for hypothesis testing


1 In statistical analysis, we have to make decisions about the hypothesis. These
decisions include deciding
if we should accept the null hypothesis or;
if we should reject the null hypothesis.
2 The rejection rule is as follows:
if the standardized test statistic is not in the rejection region, then we
accept the null hypothesis;
if the standardized test statistic is in the rejection region, then we
should reject the null hypothesis.

Rejection region
The rejection region is the values of test statistic for which the null hypothesis is
rejected.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 8 / 64


6.1 Introduction 6.1.2 Statistical decision for hypothesis testing

6.1.2 Statistical decision for hypothesis testing

Statistical decision for hypothesis testing


1 In statistical analysis, we have to make decisions about the hypothesis. These
decisions include deciding
if we should accept the null hypothesis or;
if we should reject the null hypothesis.
2 The rejection rule is as follows:
if the standardized test statistic is not in the rejection region, then we
accept the null hypothesis;
if the standardized test statistic is in the rejection region, then we
should reject the null hypothesis.

Rejection region
The rejection region is the values of test statistic for which the null hypothesis is
rejected.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 8 / 64


6.1 Introduction 6.1.2 Statistical decision for hypothesis testing

6.1.2 Statistical decision for hypothesis testing

Statistical decision for hypothesis testing


1 In statistical analysis, we have to make decisions about the hypothesis. These
decisions include deciding
if we should accept the null hypothesis or;
if we should reject the null hypothesis.
2 The rejection rule is as follows:
if the standardized test statistic is not in the rejection region, then we
accept the null hypothesis;
if the standardized test statistic is in the rejection region, then we
should reject the null hypothesis.

Rejection region
The rejection region is the values of test statistic for which the null hypothesis is
rejected.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 8 / 64


6.2 Hypothesis Testing with One Sample

Content

1 6.1 Introduction
6.1.1 Key terms and concepts
6.1.2 Statistical decision for hypothesis testing

2 6.2 Hypothesis Testing with One Sample


6.2.1 Introduction to hypothesis testing
6.2.2 Hypothesis Testing for the Mean
6.2.3 Hypothesis testing for proportions

3 6.3 Hypothesis Testing with Two Samples


6.3.1 Testing the Difference Between Means (Independent Samples)
6.3.2 Testing the Difference Between Proportions

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 9 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Basic concepts of hypothesis testing


A statistical test of hypothesis consists of 4 parts:
1 The null hypothesis H0 ; The alternative hypothesis H1 .
2 The test statistic uT .
3 The rejection region Wα .
4 The conclusion.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 10 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Basic concepts of hypothesis testing


A statistical test of hypothesis consists of 4 parts:
1 The null hypothesis H0 ; The alternative hypothesis H1 .
2 The test statistic uT .
3 The rejection region Wα .
4 The conclusion.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 10 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Basic concepts of hypothesis testing


A statistical test of hypothesis consists of 4 parts:
1 The null hypothesis H0 ; The alternative hypothesis H1 .
2 The test statistic uT .
3 The rejection region Wα .
4 The conclusion.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 10 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Basic concepts of hypothesis testing


A statistical test of hypothesis consists of 4 parts:
1 The null hypothesis H0 ; The alternative hypothesis H1 .
2 The test statistic uT .
3 The rejection region Wα .
4 The conclusion.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 10 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Note
The researcher uses the sample data to decide whether the evidence favors H1 rather
than H0 and draws one of these two conclusions:
Reject H0 and conclude that H1 is true.
Accept (do not reject) H0 as true.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 11 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Note
The researcher uses the sample data to decide whether the evidence favors H1 rather
than H0 and draws one of these two conclusions:
Reject H0 and conclude that H1 is true.
Accept (do not reject) H0 as true.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 11 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing


Example 6.1
You wish to show that the average hourly wage of carpenters in the state of California is
different from $14, which is the national average.
This is the alternative hypothesis, written as

H1 : µ 6= 14.

The null hypothesis is

H0 : µ = 14.

You would like to reject the null hypothesis, thus concluding that the California mean is
not equal to $14.

Two-tailed test for Example 6.1


In Example 6.1, no directional difference is suggested for the value of µ; that is, µ might
be either larger or smaller than $14 if H1 is true. This type of test is called a two-tailed
test of hypothesis.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 12 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing


Example 6.1
You wish to show that the average hourly wage of carpenters in the state of California is
different from $14, which is the national average.
This is the alternative hypothesis, written as

H1 : µ 6= 14.

The null hypothesis is

H0 : µ = 14.

You would like to reject the null hypothesis, thus concluding that the California mean is
not equal to $14.

Two-tailed test for Example 6.1


In Example 6.1, no directional difference is suggested for the value of µ; that is, µ might
be either larger or smaller than $14 if H1 is true. This type of test is called a two-tailed
test of hypothesis.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 12 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Two-tailed rejection region for Example 6.1


In Example 6.1, you would be inclined to believe that California’s average hourly wage
was different from $14 if the sample mean is either much less than $14 or much greater
than $14. The two-tailed rejection region consists of very small and very large values of
x as shown in the Figure 6.1.

Figure 6.1: Rejection and acceptance regions for Example 6.1

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 13 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Two-tailed rejection region for Example 6.1


In Example 6.1, you would be inclined to believe that California’s average hourly wage
was different from $14 if the sample mean is either much less than $14 or much greater
than $14. The two-tailed rejection region consists of very small and very large values of
x as shown in the Figure 6.1.

Figure 6.1: Rejection and acceptance regions for Example 6.1

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 13 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Example 6.2
A milling process currently produces an average of 3% defectives. You are interested in
showing that a simple adjustment on a machine will decrease p, the proportion of
defectives produced in the milling process.
The alternative hypothesis is
H1 : p < 0.03
The null hypothesis is
H0 : p = 0.03.
If you can reject H0 , you can conclude that the adjusted process produces fewer than
3% defectives.

One-tailed test (left-tailed test) for Example 6.2


In Example 6.2, you are specifically interested in detecting a directional difference in the
value of p; that is, if H1 is true, the value of p is less than 0.03. This type of test is
called a one-tailed test (left-tailed test) of hypothesis.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 14 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Example 6.2
A milling process currently produces an average of 3% defectives. You are interested in
showing that a simple adjustment on a machine will decrease p, the proportion of
defectives produced in the milling process.
The alternative hypothesis is
H1 : p < 0.03
The null hypothesis is
H0 : p = 0.03.
If you can reject H0 , you can conclude that the adjusted process produces fewer than
3% defectives.

One-tailed test (left-tailed test) for Example 6.2


In Example 6.2, you are specifically interested in detecting a directional difference in the
value of p; that is, if H1 is true, the value of p is less than 0.03. This type of test is
called a one-tailed test (left-tailed test) of hypothesis.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 14 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Left-tailed rejection region for Example 6.2


In Example 6.2, since you want to prove that the percentage of defectives has decreased,
you would be inclined to reject H0 for values of p̂ that are much smaller than 0.03. Only
small values of p̂ belong in the left-tailed rejection region shown in the Figure 6.2.

Figure 6.2: Rejection and acceptance regions for Example 6.2

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 15 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Left-tailed rejection region for Example 6.2


In Example 6.2, since you want to prove that the percentage of defectives has decreased,
you would be inclined to reject H0 for values of p̂ that are much smaller than 0.03. Only
small values of p̂ belong in the left-tailed rejection region shown in the Figure 6.2.

Figure 6.2: Rejection and acceptance regions for Example 6.2

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 15 / 64


6.2 Hypothesis Testing with One Sample 6.2.1 Introduction to hypothesis testing

6.2.1 Introduction to hypothesis testing

Steps for hypothesis testing


1 State the claim mathematically and verbally. Identify the null and alternative
hypotheses (H0 and H1 ).
2 Find the standardized test statistic uT .
3 Determine the rejection region Wα for H0 .
4 Make a decision to reject or fail to reject the null hypothesis. If uT is in the
rejection region (uT ∈ Wα ), reject H0 . Otherwise (uT ∈ / Wα ), fail to reject H0 .
5 Write a statement to interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 16 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

u-test
u-test for the mean is a statistical test for a population mean.
Requirement of u-test: For any population when the sample size n ≥ 30.

Note
When the sample size is at least 30, the sampling distribution for the sample mean is
normal.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 17 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

u-test
u-test for the mean is a statistical test for a population mean.
Requirement of u-test: For any population when the sample size n ≥ 30.

Note
When the sample size is at least 30, the sampling distribution for the sample mean is
normal.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 17 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Steps for hypothesis testing


Step 1. Identify the null and alternative hypotheses.
Null hypothesis H0 µ = µ0 µ = µ0 µ = µ0
Alternative hypothesis H1 µ 6= µ0 µ > µ0 µ < µ0
Step 2. Find the standardized test statistic uT .
x − µ0 √
uT = n.
s

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 18 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Steps for hypothesis testing


Step 1. Identify the null and alternative hypotheses.
Null hypothesis H0 µ = µ0 µ = µ0 µ = µ0
Alternative hypothesis H1 µ 6= µ0 µ > µ0 µ < µ0
Step 2. Find the standardized test statistic uT .
x − µ0 √
uT = n.
s

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 18 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Steps for hypothesis testing


Step 3. Determine the rejection region.
H0 H1 Rejection region Wα
µ = µ0 µ 6= µ0 (−∞; −u1−α/2 ) ∪ (u1−α/2 ; +∞)
µ = µ0 µ > µ0 (u1−α ; +∞)
µ = µ0 µ < µ0 (−∞; −u1−α )
where u1−α/2 and u1−α are in Table 3.1.
Step 4. Make a decision to reject or fail to reject the null hypothesis.
If uT is in the rejection region (uT ∈ Wα ), then reject H0 ;
If uT is not in the rejection region (uT ∈
/ Wα ), then fail to reject H0 .
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 19 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Steps for hypothesis testing


Step 3. Determine the rejection region.
H0 H1 Rejection region Wα
µ = µ0 µ 6= µ0 (−∞; −u1−α/2 ) ∪ (u1−α/2 ; +∞)
µ = µ0 µ > µ0 (u1−α ; +∞)
µ = µ0 µ < µ0 (−∞; −u1−α )
where u1−α/2 and u1−α are in Table 3.1.
Step 4. Make a decision to reject or fail to reject the null hypothesis.
If uT is in the rejection region (uT ∈ Wα ), then reject H0 ;
If uT is not in the rejection region (uT ∈
/ Wα ), then fail to reject H0 .
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 19 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Steps for hypothesis testing


Step 3. Determine the rejection region.
H0 H1 Rejection region Wα
µ = µ0 µ 6= µ0 (−∞; −u1−α/2 ) ∪ (u1−α/2 ; +∞)
µ = µ0 µ > µ0 (u1−α ; +∞)
µ = µ0 µ < µ0 (−∞; −u1−α )
where u1−α/2 and u1−α are in Table 3.1.
Step 4. Make a decision to reject or fail to reject the null hypothesis.
If uT is in the rejection region (uT ∈ Wα ), then reject H0 ;
If uT is not in the rejection region (uT ∈
/ Wα ), then fail to reject H0 .
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 19 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Example 6.3
The average weekly earnings for female social workers is $670. Do men in the same
positions have average weekly earnings that are higher than those for women? A random
sample of n = 40 male social workers showed x = $725 and s = $102. Test the
appropriate hypothesis using α = 0.01.

Example 6.3 Solution


You would like to show that the average weekly earnings for men are higher than $670,
the women’s average. Hence, if µ is the average weekly earnings for male social workers,
you can set out the formal test of hypothesis in steps.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 20 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Example 6.3
The average weekly earnings for female social workers is $670. Do men in the same
positions have average weekly earnings that are higher than those for women? A random
sample of n = 40 male social workers showed x = $725 and s = $102. Test the
appropriate hypothesis using α = 0.01.

Example 6.3 Solution


You would like to show that the average weekly earnings for men are higher than $670,
the women’s average. Hence, if µ is the average weekly earnings for male social workers,
you can set out the formal test of hypothesis in steps.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 20 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Example 6.3 Solution (continuous)


1 Null and alternative hypotheses: H0 : µ = 670 versus H1 : µ > 670.
2 Test statistic:
x − µ0 √ (725 − 670) √
uT = n= 40 = 3.41.
s 102
3 Rejection region: Wα = (u1−α ; +∞) = (2, 33; +∞), where u1−α = u0,99 = 2.33
(in Table 3.1).
4 Conclusion: Since uT = 3.41 ∈ Wα , you can reject H0 (see Figure 6.3).
5 The average weekly earnings for male social workers are higher than the average
for female social workers. The probability that you have made an incorrect decision
is α = 0.01.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 21 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Figure 6.3: The rejection region for a right-test with α = 0.01

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 22 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Example 6.3 (continuous)


If you wish to detect departures either greater or less than µ0 , then the alternative
hypothesis is two-tailed, written as

H1 : µ 6= µ0

which implies either µ < µ0 or µ > µ0 .


If you choose α = 0.01, the area in the rejection region is equally divided between
the two tails of the normal distribution, as shown in Figure 6.4.
Using the standardized test statistic uT , you can reject H0 if uT > 2.58 or
uT < −2.58.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 23 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Figure 6.4: The rejection region for a two-tailed test with α = 0.01

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 24 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Example 6.4
The daily yield for a local chemical plant has averaged 880 tons for the last several
years. The quality control manager would like to know whether this average has changed
in recent months. She randomly selects 50 days from the computer database and
computes the average and standard deviation of the n = 50 yields as x = 871 tons and
s = 21 tons, respectively. Test the appropriate hypothesis using α = 0.05.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 25 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(a) Large Samples, n ≥ 30

Example 6.4 Solution


1 Null and alternative hypotheses: H0 : µ = 880 versus H1 : µ 6= 880.
2 Test statistic: The point estimate for µ is x. Therefore, the test statistic is
x − µ0 √ (871 − 880) √
uT = n= 50 = −3.03.
s 21
3 Rejection region: For this two-tailed test, using α = 0.05, u1−α/2 = u0.975 = 1.96.
Hence, Wα = (−∞; −1.96) ∪ (1.96; +∞).
4 Conclusion: Since uT = −3.03 falls in the rejection region Wα , the manager can
reject the null hypothesis that µ = 880 tons and conclude that it has changed.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 26 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

Practice Test

Question 6.1
Many companies are becoming involved in flextime, in which a worker schedules his or
her own work hours or compresses work weeks. A company that was contemplating the
installation of a flextime schedule estimated that it needed a minimum mean of 7 hours
per day per assembly worker in order to operate effectively. Each of a random sample of
100 of the company’s assemblers was asked to submit a tentative flextime schedule:

The number of hours worked 5–5.5 5.5–6 6–6.5 6.5–7 7–7.5 7.5–8
per day on Mondays
The number of random samples 5 10 25 30 17 13

Do the data provide sufficient evidence to indicate that the mean number of hours
worked per day on Mondays, for all of the company’s assemblers, will be less than 7
hours? Test using α = 0.05.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 27 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Finding Critical Values in a t-Distribution


The t-test for the mean is a statistical test for a population mean.
The t-test can be used when the population is normal or nearly normal σ is
unknown, and n < 30.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 28 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Steps for hypothesis testing


Step 1. Identify the null and alternative hypotheses.
Null hypothesis H0 µ = µ0 µ = µ0 µ = µ0
Alternative hypothesis H1 µ 6= µ0 µ > µ0 µ < µ0
Step 2. Find the standardized test statistic tT .
x − µ0 √
tT = n.
s

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 29 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Steps for hypothesis testing


Step 1. Identify the null and alternative hypotheses.
Null hypothesis H0 µ = µ0 µ = µ0 µ = µ0
Alternative hypothesis H1 µ 6= µ0 µ > µ0 µ < µ0
Step 2. Find the standardized test statistic tT .
x − µ0 √
tT = n.
s

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 29 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Steps for hypothesis testing


Step 3. Determine the rejection region.
H0 H1 Rejection region Wα
(n−1) (n−1)
µ = µ0 µ 6= µ0 (−∞; −t1−α/2 ) ∪ (t1−α/2 ; +∞)
(n−1)
µ = µ0 µ > µ0 (t1−α ; +∞)
(n−1)
µ = µ0 µ < µ0 (−∞; −t1−α )
(n−1) (n−1)
where t1−α/2 and t1−α are in Table 5.1 (using Table 5.1 in the row with n − 1
degrees of freedom (d.f.)).
Step 4. Make a decision to reject or fail to reject the null hypothesis.
If tT is in the rejection region (tT ∈ Wα ), then reject H0 ;
If tT is not in the rejection region (tT ∈
/ Wα ), then fail to reject H0 .
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 30 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Steps for hypothesis testing


Step 3. Determine the rejection region.
H0 H1 Rejection region Wα
(n−1) (n−1)
µ = µ0 µ 6= µ0 (−∞; −t1−α/2 ) ∪ (t1−α/2 ; +∞)
(n−1)
µ = µ0 µ > µ0 (t1−α ; +∞)
(n−1)
µ = µ0 µ < µ0 (−∞; −t1−α )
(n−1) (n−1)
where t1−α/2 and t1−α are in Table 5.1 (using Table 5.1 in the row with n − 1
degrees of freedom (d.f.)).
Step 4. Make a decision to reject or fail to reject the null hypothesis.
If tT is in the rejection region (tT ∈ Wα ), then reject H0 ;
If tT is not in the rejection region (tT ∈
/ Wα ), then fail to reject H0 .
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 30 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Steps for hypothesis testing


Step 3. Determine the rejection region.
H0 H1 Rejection region Wα
(n−1) (n−1)
µ = µ0 µ 6= µ0 (−∞; −t1−α/2 ) ∪ (t1−α/2 ; +∞)
(n−1)
µ = µ0 µ > µ0 (t1−α ; +∞)
(n−1)
µ = µ0 µ < µ0 (−∞; −t1−α )
(n−1) (n−1)
where t1−α/2 and t1−α are in Table 5.1 (using Table 5.1 in the row with n − 1
degrees of freedom (d.f.)).
Step 4. Make a decision to reject or fail to reject the null hypothesis.
If tT is in the rejection region (tT ∈ Wα ), then reject H0 ;
If tT is not in the rejection region (tT ∈
/ Wα ), then fail to reject H0 .
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 30 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Example: Find the critical value(s) t using Table 5.1 in the row with (n − 1) d.f.
(n−1)
The critical value t1−α for a right-tailed test given α = 0.01 and n = 24 is
(23)
t0.99 = 2.500.
(n−1)
The critical value t1−α/2 for a two-tailed test given α = 0.01 and n = 24 is
(23)
t0.995 = 2.807.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 31 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Example 6.5
A local telephone company claims that the average length of a phone call is 8 minutes. In
a random sample of 18 phone calls, the sample mean was 7.8 minutes and the standard
deviation was 0.5 minutes. Is there enough evidence to support this claim at α = 0.05?

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 32 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Example 6.5 Solution


1 Null and alternative hypotheses: H0 : µ = 8 versus H1 : µ 6= 8. The test is a
two-tailed test.
2 The standardized test statistic is
x − µ0 √ (7.8 − 8) √
tT = n= 18 = −1.70.
s 0.5
(n−1) (17)
3 Rejection region: For this two-tailed test, using α = 0.05, t1−α/2 = t0.975 = 2.110.
Hence, Wα = (−∞; −2.110) ∪ (2.110; +∞).
4 Conclusion: Since tT = −1.70 falls in the nonrejection region, so H0 is not
rejected.
5 At the 5% level of significance, there is not enough evidence to reject the claim
that the average length of a phone call is 8 minutes.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 33 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Example 6.6
A manufacturer claims that its rechargeable batteries have an average life greater than
1000 charges. A random sample of 10 batteries has a mean life of 1002 charges and a
standard deviation of 14. Is there enough evidence to support this claim at α = 0.01?

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 34 / 64


6.2 Hypothesis Testing with One Sample 6.2.2 Hypothesis Testing for the Mean

(b) Small Samples, n < 30

Example 6.6 Solution


1 Null and alternative hypotheses: H0 : µ = 1000 versus H1 : µ > 1000. The test is
a two-tailed test.
2 The standardized test statistic is
x − µ0 √ (1002 − 1000) √
tT = n= 10 = 0.45.
s 14
(n−1) (9)
3 Rejection region: For this right-tailed test, using α = 0.01, t1−α = t0.99 = 2.821.
Hence, Wα = (2.821; +∞).
4 Conclusion: Since tT = 0.45 falls in the nonrejection region, so H0 is not rejected.
5 At the 1% level of sig, there is not enough evidence to support the claim that the
rechargeable battery has an average life of at least 1000 charges.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 35 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a u-Test for a Proportion p

Using a u-Test for a Proportion p: Verify that np ≥ 5 and n(1 − p) ≥ 5


1 The u-test for a population is a statistical test for a population proportion. The
u-test can be used when a binomial distribution is given such that np ≥ 5 and
n(1 − p) ≥ 5.
2 The test statistic is the sample proportion p̂ and the standardized test statistic is u.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 36 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a u-Test for a Proportion p

Steps for hypothesis testing


Step 1. State the claim mathematically and verbally. Identify the null and
alternative hypotheses.
Null hypothesis H0 p = p0 p = p0 p = p0
Alternative hypothesis H1 p 6= p0 p > p0 p < p0
Step 2. Find the standardized test statistic.

p̂ − p0 √
uT = p n
p0 (1 − p0 )

m
where p̂ = .
n

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 37 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a u-Test for a Proportion p

Steps for hypothesis testing


Step 3. Determine any rejection regions.
H0 H1 Rejection region Wα
p = p0 p 6= p0 (−∞; −u1−α/2 ) ∪ (uα/2 ; +∞)
p = p0 p > p0 (u1−α ; +∞)
p = p0 p < p0 (−∞; −u1−α )
where uα/2 and u1−α are in Table 3.1.
Step 4. Make a decision to reject or fail to reject the null hypothesis. If tT is in
the rejection region, reject H0 . Otherwise, fail to reject H0 .
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 38 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a z-Test for a Proportion p

Example 6.7
A college claims that more than 94% of their graduates find employment within 6
months of graduation. In a sample of 500 randomly selected graduates, 475 of them
were employed. Is there enough evidence to support the college’s claim at a 1% level of
significance?

Example 6.7 Solution


Verify np ≥ 5 and n(1 − p) ≥ 5: np = (500)(0.94) = 470; n(1 − p) = (500)(0.06) = 30.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 39 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a z-Test for a Proportion p

Example 6.7
A college claims that more than 94% of their graduates find employment within 6
months of graduation. In a sample of 500 randomly selected graduates, 475 of them
were employed. Is there enough evidence to support the college’s claim at a 1% level of
significance?

Example 6.7 Solution


Verify np ≥ 5 and n(1 − p) ≥ 5: np = (500)(0.94) = 470; n(1 − p) = (500)(0.06) = 30.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 39 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a z-Test for a Proportion p

Example 6.7 Solution


1 H0 : p = 0.94 := p0 versus H1 : p > 0.94 (Claim). Right-tailed test.
2 Find the standardized test statistic:
m 475 (p̂ − p0 ) √ (0.95 − 0.94) √
p̂ = = = 0.95, uT = p n= √ 500 = 0.94.
n 500 p0 (1 − p0 ) 0.94 × 0.06

3 α = 0.01, the critical value u1−α = 2.33, Wα = (2.33; +∞).


4 The test statistic falls in the non-rejection region. H0 is not rejected.
5 At the 1% level of significance, there is not enough evidence to support the
college’s claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 40 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a z-Test for a Proportion p

Example 6.8
A cigarette manufacturer claims that 1/8 of the US adult population smokes cigarettes.
In a random sample of 100 adults, 5 are cigarette smokers. Test the claim at α = 0.05.

Example 6.8 Solution


p̂ = 5/100 = 0.05. Verify np and n(1 − p) are at least 5. np = (100)(0.125) = 12.5;
n(1 − p) = (100)(0.875) = 87.5.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 41 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a z-Test for a Proportion p

Example 6.8
A cigarette manufacturer claims that 1/8 of the US adult population smokes cigarettes.
In a random sample of 100 adults, 5 are cigarette smokers. Test the claim at α = 0.05.

Example 6.8 Solution


p̂ = 5/100 = 0.05. Verify np and n(1 − p) are at least 5. np = (100)(0.125) = 12.5;
n(1 − p) = (100)(0.875) = 87.5.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 41 / 64


6.2 Hypothesis Testing with One Sample 6.2.3 Hypothesis testing for proportions

Using a z-Test for a Proportion p

Example 6.8 Solution


1 H0 : p = 0.125 := p0 (Claim); H1 : p 6= 0.125. Two-tailed test.
2 The test statistic is
(0.05 − 0.125) √
uT = p 100 = −2.27.
(0.125)(0.875)

3 α = 0.05, critical values u1−α/2 = 1.96, Wα = (−∞; −1.96) ∪ (1.96; +∞).


4 The test statistic falls in the rejection region. H0 is rejected.
5 At the 5% level of significance, there is enough evidence to reject the claim that
one-eighth of the population smokes.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 42 / 64


6.3 Hypothesis Testing with Two Samples

Content

1 6.1 Introduction
6.1.1 Key terms and concepts
6.1.2 Statistical decision for hypothesis testing

2 6.2 Hypothesis Testing with One Sample


6.2.1 Introduction to hypothesis testing
6.2.2 Hypothesis Testing for the Mean
6.2.3 Hypothesis testing for proportions

3 6.3 Hypothesis Testing with Two Samples


6.3.1 Testing the Difference Between Means (Independent Samples)
6.3.2 Testing the Difference Between Proportions

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 43 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Null and Alternative Hypothesis


1 In a two-sample hypothesis test, two parameters from two populations are
compared.
2 The null hypothesis H0 is a statistical hypothesis that usually states there is no
difference between the parameters of two populations. The null hypothesis always
contains the symbol ” = ”.
3 The alternative hypothesis H1 is a statistical hypothesis that is true when H0 is
false. The alternative hypothesis always contains the symbol ” >, 6=, < ”.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 44 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Null and Alternative Hypothesis


( ( (
H0 : µ1 = µ2 , H 0 : µ1 = µ2 , H 0 : µ 1 = µ2 ,
H1 : µ1 6= µ2 , H 1 : µ1 > µ 2 , H1 : µ1 < µ2 .
Regardless of which hypotheses used, µ1 = µ2 is always assumed to be true.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 45 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Two Sample u-Test


Three conditions are necessary to perform a u-test for the difference between two
population means µ1 and µ2 .
1 The samples must be randomly selected.
2 The samples must be independent. Two samples are independent if the sample
selected from one population is not related to the sample selected from the second
population.
3 Each sample size must be at least 30, or, if not, each population must have a
normal distribution with a known standard deviation.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 46 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Mean and Standard error


If these requirements are met, the sampling distribution for x1 − x2 (the difference of
the sample means) is a normal distribution with mean and standard error of

µx1 −x2 = µx1 − µx2 = µ1 − µ2 ,

and s
q σ12 σ2
σx1 −x2 = σx21 + σx22 = + 2.
n1 n2

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 47 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Standardized test statistic


The test statistic is x1 − x2 and the standardized test statistic is
s
(x1 − x2 ) − (µ1 − µ2 ) σ12 σ2
uT = , where σx1 −x2 = + 2.
σx1 −x2 n1 n2

Note
When the samples are large, you can use s1 and s2 in place of σ1 and σ2 . If the samples
are not large, you can still use a two-sample u-test, provided the populations are
normally distributed and the population standard deviations are known.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 48 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Standardized test statistic


The test statistic is x1 − x2 and the standardized test statistic is
s
(x1 − x2 ) − (µ1 − µ2 ) σ12 σ2
uT = , where σx1 −x2 = + 2.
σx1 −x2 n1 n2

Note
When the samples are large, you can use s1 and s2 in place of σ1 and σ2 . If the samples
are not large, you can still use a two-sample u-test, provided the populations are
normally distributed and the population standard deviations are known.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 48 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Steps for hypothesis testing


Step 1. State the claim mathematically and verbally. Identify the null and
alternative hypotheses.
Null hypothesis H0 µ1 = µ2 µ1 = µ2 µ1 = µ2
Alternative hypothesis H1 µ1 6= µ2 µ1 > µ 2 µ1 < µ 2
Step 2. Find the standardized test statistic.
(x1 − x2 ) (x1 − x2 )
uT = r 2 or uT = r 2 .
σ1 σ2 s1 s2
+ 2 + 2
n1 n2 n1 n2

Step 3. Specify the level of significance. Determine the rejection region (Wα ).
Step 4. Make a decision to reject or fail to reject the null hypothesis.
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 49 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Example 6.9
A high school math teacher claims that students in her class will score higher on the
math portion of the ACT then students in a colleague’s math class. The mean ACT
math score for 49 students in her class is 22.1 and the standard deviation is 4.8. The
mean ACT math score for 44 of the colleague’s students is 19.8 and the standard
deviation is 5.4. At α = 0.10, can the teacher’s claim be supported?

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 50 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(a) Large Independent Samples

Example 6.9 Solution


1 H0 : µ1 = µ2 , H1 : µ1 > µ2 .
2 The standardized error is
s r
σ12 σ2 4.82 5.42
σx1 −x2 = + 2 = + ' 1.0644.
n1 n2 49 44

The standardized test statistic is


22.1 − 19.8
uT = ' 2.161.
1.0644
3 α = 0.10, the critical value u1−α = 1.28, Wα = (1.28; +∞).
4 Since uT = 2.161 ∈ Wα , reject H0 .
5 There is enough evidence at the 10% level to support the teacher’s claim that her
students score better on the ACT.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 51 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(b) Small Independent Samples

Two Sample t-Test


If samples of size less than 30 are taken from normally-distributed populations, a t-test
may be used to test the difference between the population means µ1 and µ2 .

Three conditions are necessary to use a t-test for small independent samples.
1 The samples must be randomly selected.
2 The samples must be independent. Two samples are independent if the sample
selected from one population is not related to the sample selected from the second
population.
3 Each population must have a normal distribution.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 52 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(b) Small Independent Samples

Two Sample t-Test


If samples of size less than 30 are taken from normally-distributed populations, a t-test
may be used to test the difference between the population means µ1 and µ2 .

Three conditions are necessary to use a t-test for small independent samples.
1 The samples must be randomly selected.
2 The samples must be independent. Two samples are independent if the sample
selected from one population is not related to the sample selected from the second
population.
3 Each population must have a normal distribution.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 52 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(b) Small Independent Samples

Mean and Standard error


1 A two-sample t-test is used to test the difference between two population means
µ1 and µ2 when a sample is randomly selected from each population. Performing
this test requires each population to be normally distributed, and the samples
should be independent. The standardized test statistic is
(x1 − x2 ) − (µ1 − µ2 )
tT =
σx1 −x2

2 If the population variances are equal, then information from the two samples is
combined to calculate a pooled estimate of the standard deviation σ̂.
s
(n1 − 1)s21 + (n2 − 1)s22
σ̂ =
n1 + n2 − 2

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 53 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(b) Small Independent Samples

Mean and Standard error


1 If the population variances are equal, then the standard error is
r
1 1
σx1 −x2 = σ̂ +
n1 n2
and d.f. is n1 + n2 − 2.
2 If the population variances are not equal, then the standard error is
s
s21 s2
σx1 −x2 = + 2
n1 n2

and d.f. is smaller of n1 − 1 or n2 − 2.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 54 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(b) Small Independent Samples

Steps for hypothesis testing


Step 1. State the claim mathematically and verbally. Identify the null and
alternative hypotheses.
Null hypothesis H0 µ1 = µ2 µ1 = µ2 µ1 = µ2
Alternative hypothesis H1 µ1 6= µ2 µ1 > µ 2 µ1 < µ 2
Step 2. Find the standardized test statistic.
(x1 − x2 ) − (µ1 − µ2 )
tT =
σx1 −x2

Step 3. Specify the level of significance. Determine the rejection region Wα (with
d.f. = n1 + n2 − 2 or d.f. is smaller of n1 − 1 or n2 − 1.).
Step 4. Make a decision to reject or fail to reject the null hypothesis. If tT is in
the rejection region, reject H0 . Otherwise, fail to reject H0 .
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 55 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(b) Small Independent Samples

Example 6.10
A random sample of 17 police officers in Brownsville has a mean annual income of
$35800 and a standard deviation of $7800. In Greensville, a random sample of 18 police
officers has a mean annual income of $35100 and a standard deviation of $7375. Test
the claim at α = 0.01 that the mean annual incomes in the two cities are not the same.
Assume the population variances are equal.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 56 / 64


6.3.1 Testing the Difference Between Means (Independent
6.3 Hypothesis Testing with Two Samples Samples)

(b) Small Independent Samples


Example 6.10 Solution
1 State the claim mathematically. H0 : µ1 = µ2 , H1 : µ1 6= µ2 .
2 The standardized error is
r s r
1 1 (n1 − 1)s21 + (n2 − 1)s22 1 1
σx1 −x2 = σ̂ + = +
n1 n2 n1 + n2 − 2 n1 n2
s r
(17 − 1)78002 + (18 − 1)73752 1 1
= + = 2564.92.
17 + 18 − 2 17 18

The standardized test statistic is


(x1 − x2 ) − (µ1 − µ2 ) (35800 − 35100) − 0
tT = = ' 0.273.
σx1 −x2 2564.92

1 2 (n +n −2) (n +n −2)
1 2
3 Wα = (−∞; −t1−α/2 ) ∪ (t1−α/2 ; +∞) = (−∞; −2.576) ∪ (2.576; +∞).
4 Since tT = 0.273 ∈
/ Wα , fail to reject H0 .
5 There is not enough evidence at the 1% level to support the claim that the mean
annual incomes differ.
Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 57 / 64
6.3 Hypothesis Testing with Two Samples 6.3.2 Testing the Difference Between Proportions

6.3.2 Testing the Difference Between Proportions

Two Sample u-Test for Proportions


A u-test is used to test the difference between two population proportions, p1 and p2 .
Three conditions are required to conduct the test.
1 The samples must be randomly selected.
2 The samples must be independent.
3 The samples must be large enough to use a normal sampling distribution. That is,
n1 p1 ≥ 5, n1 (1 − p1 ) ≥ 5, n2 p2 ≥ 5, n2 (1 − p2 ) ≥ 5.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 58 / 64


6.3 Hypothesis Testing with Two Samples 6.3.2 Testing the Difference Between Proportions

6.3.2 Testing the Difference Between Proportions

Mean and Standard error


If these conditions are met, then the sampling distribution for p̂1 − p̂2 is a normal
distribution with mean
µp̂1 −p̂2 = p1 − p2 .
and standard error r
 1 1 
σp̂1 −p̂2 = +p̄(1 − p̄)
.
n1 n2
A weighted estimate of p1 and p2 can be found by using
n1 p̂1 + n2 p̂2
p̄ =
n1 + n2

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 59 / 64


6.3 Hypothesis Testing with Two Samples 6.3.2 Testing the Difference Between Proportions

6.3.2 Testing the Difference Between Proportions

Standardized test statistic


A two sample u-test is used to test the difference between two population proportions
p1 and p2 when a sample is randomly selected from each population. The test statistic is

p̂1 = p̂2 ,

and the standardized test statistic is


(p̂1 − p̂2 ) − (p1 − p2 )
uT = r  1 .
1 
p̄(1 − p̄) +
n1 n2

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 60 / 64


6.3 Hypothesis Testing with Two Samples 6.3.2 Testing the Difference Between Proportions

6.3.2 Testing the Difference Between Proportions

Steps for hypothesis testing


Step 1. State the claim mathematically and verbally. Identify the null and
alternative hypotheses.
Null hypothesis H0 p1 = p2 p1 = p2 p1 = p2
Alternative hypothesis H1 p1 6= p2 p1 > p 2 p1 < p 2
Step 2. Find the standardized test statistic.
(p̂1 − p̂2 ) − (p1 − p2 )
uT = r  1 .
1 
p̄(1 − p̄) +
n1 n2

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 61 / 64


6.3 Hypothesis Testing with Two Samples 6.3.2 Testing the Difference Between Proportions

6.3.2 Testing the Difference Between Proportions

Steps for hypothesis testing


Step 3. Determine the rejection region.
H0 H1 Rejection region Wα
p 1 = p2 6 p2
p1 = (−∞; −u1−α/2 ) ∪ (u1−α/2 ; +∞)
p 1 = p2 p1 > p 2 (u1−α ; +∞)
p 1 = p2 p1 < p 2 (−∞; −u1−α )
where u1−α/2 and u1−α are in Table 3.1.
Step 4. Make a decision to reject or fail to reject the null hypothesis.
Step 5. Interpret the decision in the context of the original claim.

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 62 / 64


6.3 Hypothesis Testing with Two Samples 6.3.2 Testing the Difference Between Proportions

6.3.2 Testing the Difference Between Proportions

Example 6.11
A recent survey stated that male college students smoke less than female college
students. In a survey of 1245 male students, 361 said they smoke at least one pack of
cigarettes a day. In a survey of 1065 female students, 341 said they smoke at least one
pack a day. At α = 0.01, can you support the claim that the proportion of male college
students who smoke at least one pack of cigarettes a day is lower then the proportion of
female college students who smoke at least one pack a day?

Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 63 / 64


6.3 Hypothesis Testing with Two Samples 6.3.2 Testing the Difference Between Proportions

6.3.2 Testing the Difference Between Proportions


Example 6.11 Solution
1 H0 : p1 = p2 , H1 : p1 < p2 .
2 Caculate
n1 p̂1 + n2 p̂2 361 + 341 702
p̄ = = = ' 0.304, and 1 − p̄ = 0.696.
n1 + n2 1245 + 1065 2310
Because 1245 × 0.304, 1245 × 0.696, 1065 × 0.304, and 1065 × 0.696 are all at
least 5, we can use a two-sample u-test.
0.29 − 0.32
uT = r  1 ' −1.56.
1 
0.304 × 0.696 × +
1245 1065

3 α = 0.01, the critical value u1−α = 2.33, Wα = (−∞; −2.33).


4 Since uT = −1.56 ∈
/ Wα , fail to reject H0 .
5 There is not enough evidence at the 1% level to support the claim that the
proportion of male college students who smoke is lower then the proportion of
female college students who smoke.
Nguyễn Thị Thu Thủy (SAMI-HUST) Hypothesis Testing HANOI – 2019 64 / 64

You might also like