You are on page 1of 25

Two-Sample Test of

Hypothesis
and Confidence Intervals

MAY M. FERRY, PIE, ASEAN ENG.


IE41/MATH 403 LECTURER
INTRODUCTION

The previous chapter discussed hypothesis testing of mean,


variance and proportion for single sample. In this chapter,
statistical inference of two samples concerning means,
variances and proportions will be discussed.
LEARNING OBJECTIVES

Test hypotheses on the difference in means of


two normal distributions using either a
Z-test or a t-test.
Test hypotheses on the difference between
variances of normal distributions.

Test hypotheses on the difference between


population proportions.

Use the P-value approach for making decisions


in hypothesis tests.
3
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Known)

𝑥1 −𝑥2 − (𝜇1 − 𝜇2 )
z=
𝜎1 2 𝜎2 2
+
𝑛1 𝑛2

4
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Known)
Two-Sided / Two-Tailed Test

5
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Known)
Two-Sided / Two-Tailed Test

6
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Known)
 CONFIDENCE INTERVAL FOR THE
DIFFERENCE OF BETWEEN MEANS

7
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Unknown)
 EQUAL VARIANCES
𝑥1 −𝑥2 − (𝜇1 − 𝜇2 )
Formula: 𝑡 = 1 1
𝑆𝑝 +
𝑛1 𝑛 2

𝑆1 2 𝑛1 − 1 + 𝑆2 2 (𝑛2 − 1)
𝑆𝑝 2
= ;
𝑛1 + 𝑛2 − 2
(pooled variance)

𝑣 = 𝑛1 + 𝑛2 − 2 (degrees of
freedom, dof)

8
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Unknown)
 EQUAL VARIANCES 𝑆𝑝2 =
𝑆1 2 𝑛1 − 1 + 𝑆2 2 (𝑛2 − 1)
;
𝑛1 + 𝑛2 − 2
𝑥1 −𝑥2 − (𝜇1 − 𝜇2 )
Formula: 𝑡 = (pooled variance)
1 1
𝑆𝑝 +
𝑛1 𝑛2
𝑣 = 𝑛1 + 𝑛2 − 2 (degrees of
freedom, dof)

According to Chemical Engineering an important


property of fiber is its water absorbency. The average
percent absorbency of 25 randomly selected pieces of
cotton fiber was found to be 20 with a standard
deviation of 1.5. A random sample of 25 pieces of
acetate yielded an average percent of 12 with a
standard deviation of 1.25. Is there strong evidence
that the population mean percent absorbency for
cotton fiber is significantly higher than the mean for
acetate. Assume that the percent absorbency is
approximately normally distributed and that the
population variances in percent absorbency for the two
fibers are the same. Use a significance level of 0.05.
9
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Unknown)
 UNEQUAL VARIANCES

10
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Unknown)
 UNEQUAL VARIANCES

11
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Unknown)
 CONFIDENCE INTERVAL FOR THE
DIFFERENCE BETWEEN TWO MEANS

12
Two-Sample Hypothesis Test Concerning Mean: (σ1 and σ2 Unknown)
 CONFIDENCE INTERVAL FOR THE
DIFFERENCE BETWEEN TWO MEANS

13
Two-Sample Hypothesis Test Concerning Mean: Paired t-test
 PAIRED OBSERVATION

Use this if there is one sample and test by two different methods:
 if we split the sample
 if we paired the sample

ത 𝑑0
𝑑−
Formula: 𝑡= 𝑆𝑑
ൗ 𝑛

14
12
Two-Sample Hypothesis Test Concerning Mean: Paired t-test
 PAIRED OBSERVATION Students Pre-test Post test d
ത 𝑑0
𝑑− 1 58 63
Formula: 𝑡= 𝑆𝑑 2 49 46
ൗ 𝑛 3 64 59
Problem: 4 47 50
To test the effectiveness of the teaching 5 56 60
method, a random sample of students 6 60 62
were taken. Their scores before (pre-test) 7 44 48
and scores after (post test) the teaching 8 37 34
9 52 52
process were recorded as follows:
10 59 58
Test an appropriate hypothesis for this data
using 0.01 level of significance.
15
Two-Sample Hypothesis Test Concerning Mean: Paired t-test
 PAIRED OBSERVATION
ത 𝑑0
𝑑−
Formula: 𝑡= 𝑆𝑑
ൗ 𝑛

Problem:
To test the effectiveness of the teaching
method, a random sample of students
were taken. Their scores before (pre-test)
and scores after (post test) the teaching
process were recorded as follows:
Test an appropriate hypothesis for this data
using 0.01 level of significance.
16
Two-Sample Hypothesis Test Concerning Mean: Paired t-test
 CONFIDENCE INTERVAL: PAIRED OBSERVATION
Two-Sample Hypothesis Test Concerning Mean: Paired t-test
 CONFIDENCE INTERVAL: PAIRED OBSERVATION
Two-Sample Hypothesis Test Concerning Variances
 TEST OF EQUALITY OF VARIANCES
For independent random samples of size n1 and n2, respectively, from the two populations, the f-
value for testing 𝜎1 2 = 𝜎2 2 is the ratio
𝒔𝟏 𝟐
f=
𝒔𝟐 𝟐

Critical Region:

One-sided alternatives:
For 𝜎1 2 < 𝜎2 2 , f < f1-α (υ1, υ2 )
For 𝜎1 2 > 𝜎2 2 f > f1-α (υ1, υ2 )

Two-sided alternative: 𝜎1 2 ≠ 𝜎2 2 , the critical regions is f < f1-α/2 (υ1, υ2 ) or f > fα/2 (υ1, υ2 ).
Two-Sample Hypothesis Test Concerning Variances
𝒔𝟏 𝟐
 TEST OF EQUALITY OF VARIANCES f=
𝒔𝟐 𝟐
Given Data: Hypothesis:
nCF = 25 nAF = 25 H0 : 𝜎1 2 = 𝜎2 2
𝐻1 : 𝜎1 2 ≠ 𝜎2 2
σCF = 1.5% σAF = 1.25%

𝑥𝐶𝐹 = 20% 𝑥𝐴𝐹 = 12%

Assume that the percent absorbency is


approximately normally distributed
and that the population variances in
percent absorbency for the two fibers
are the same. Use a significance level
of 0.10.
Question:
Is this a correct assumption?
Two-Sample Hypothesis Test Concerning Variances
𝒔𝟏 𝟐
 TEST OF EQUALITY OF VARIANCES f=
𝒔𝟐 𝟐
Given Data: α = 0.05 Assume that the observations come from
normal populations with different
𝑠 2 1 = 62,005,060 n1 = 16 variances.

𝑠 2 2 = 6,147,935.6 n2 = 12
Hypothesis:
𝐻0 : 𝜎1 2 = 𝜎2 2 𝐻1 : 𝜎1 2 ≠ 𝜎2 2

𝒔𝟏 𝟐
Solution: f =
𝒔𝟏 𝟐

Is it a correct assumption, 𝜎 2 1 ≠ 𝜎 2 2?

16
Two-Sample Hypothesis Test Concerning Variances
𝒔𝟏 𝟐
 TEST OF EQUALITY OF VARIANCES f=
𝒔𝟐 𝟐
Given Data: α = 0.05
𝑠 2 1 = 62,005,060 n1 = 16
𝑠 2 2 = 6,147,935.6 n2 = 12
Hypothesis:
𝐻0 : 𝜎1 2 = 𝜎2 2 𝐻1 : 𝜎1 2 ≠ 𝜎2 2

𝒔𝟏 𝟐
Solution: f =
𝒔𝟏 𝟐

22
Two-Sample Hypothesis Test Concerning Variances
𝒔𝟏 𝟐
 TEST OF EQUALITY OF VARIANCES f=
𝒔𝟐 𝟐

Two-sided alternative: 𝜎1 2 ≠ 𝜎2 2 ,
the critical regions is f < f1-α/2 (υ1, υ2 ) or
f > fα/2 (υ1, υ2 ).
Two-Sample Hypothesis Test Concerning Two Proportions

When 𝐻0 is true, we can substitute 𝑝1 = 𝑝2 = p and 𝑞1 = 𝑞2 = q (where p


and q are the common values) in the preceding formula for Z to give the
form

•Pooled estimate of the proportion p


Two-Sample Hypothesis Test Concerning Two Proportions
In a study to estimate the proportion of residents in a certain city and its suburbs who favor the construction of a
nuclear power plant, it is found that 63 of 100 urban residents favor the construction while only 59 of 125
suburban residents are in favor. Is there a significant difference between the proportion of urban and suburban
residents who favor construction of the nuclear plant? Make use of a P-value.

Given Data:
xU = 63 xSU = 59
nU = 100 nSU = 125
α = 0.01
Hypothesis:
H0 : pU = pSU H0 : pU - pSU = 0

H1 : pU ≠ pSU H1 : pU - pSU ≠ 0

You might also like