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

Hypothesis Testing: Two sample test

Dr. A. Ramesh
DEPARTMENT OF MANAGEMENT
IIT ROORKEE

1
Hypothesis Testing about the Difference in Two
Sample Means
Population 1
X 1

X X
x 1 2
X  n1
1
X X1 2


x
X 2
n2

X 2

Population 2

2
Two Sample Tests
Two Sample Tests

Population Population
Means, Means, Population Population
Independent Dependent Proportions Variances
Samples Samples
Examples:
Group 1 vs. Same group before Proportion 1 vs. Variance 1 vs.
independent vs. after treatment Proportion 2 Variance 2
Group 2

3
Difference Between Two Means

Population means,
independent samples

σ12 and σ22 known Test statistic is a z value

σ12 and σ22 unknown

σ12 and σ22 assumed equal


Test statistic is a value from the
σ12 and σ12 assumed Student’s t distribution
unequal
4
σ12 and σ12 Known

Population means, Assumptions:


independent samples
 Samples are randomly and
independently drawn

σ12 and σ22 known  both population distributions


are normal
σ12 and σ22 unknown
 Population variances are
known

5
σ12 and σ22 Known

When σx2 and σy2 are known and both


Population means, populations are normal, the variance of 1 – 2
independent is 2
σ1 σ 2
2
samples σ 2X1 X2  
n1 n 2

σ12 and σ22 known …and the random variable


(x1  x 2 )  (μ1  μ 2 )
Z
σ12 σ 22
σ12 and σ22 unknown 
n1 n 2
has a standard normal distribution
6
Test Statistic, σ12 and σ22 Known

Population means, H0 :μ1  μ 2  D0


independent
samples The test statistic for
μ1 – μ2 is:
σ12 and σ22 known
z
 x 1 
 x2  D0

σ12 and σ22 unknown σ12 σ 2 2



n1 n2

7
Hypothesis Tests for Two Population Means

Two Population Means, Independent Samples

Lower-tail test: Upper-tail test: Two-tail test:


H0: μ1  μ2 H0: μ1 ≤ μ2 H0: μ1 = μ2
H1: μ1 < μ2 H1: μ1 > μ2 H1: μ1 ≠ μ2
i.e., i.e., i.e.,
H0: μ1 – μ2  0 H0: μ1 – μ2 ≤ 0 H0: μ1 – μ2 = 0
H1: μ1 – μ2 < 0 H1: μ1 – μ2 > 0 H1: μ1 – μ2 ≠ 0

8
Decision Rules

a a
a/2 a/2

-za za -za/2 za/2


Reject H0 if z < -za Reject H0 if z > za Reject H0 if z < -za/2 or z > za/2

9
Hypothesis Testing about the Difference in Two
Sample Means

X  X2
  
1 2
X   2
1
  2
2
 X2 n n
1
1
1 2

X 1
 X2
X 1
 X 2

10
Sampling Distribution of x1  x2

• Expected Value

• Standard Deviation (Standard Error)

where: 1 = standard deviation of population 1


2 = standard deviation of population 2
n1 = sample size from population 1
n2 = sample size from population 2

11
Interval Estimation of 1 - 2:  1 and  2 Known
• Interval Estimate

where: 1 - a is the confidence coefficient

12
Problem ( 1 and  2 Known)
• A product developer is interested in reducing the drying time of a primer paint.
• Two formulations of the paint are tested; formulation 1 is the standard chemistry, and
formulation 2 has a new drying ingredient that should reduce the drying time.
• From experience, it is known that the standard deviation of drying time is 8 minutes, and this
inherent variability should be unaffected by the addition of the new ingredient.
• Ten specimens are painted with formulation 1, and another 10 specimens are painted with
formulation 2; the 20 specimens are painted in random order.
• The two-sample average drying times are 𝑥1 = 121 minutes and 𝑥2 = 112 minutes,
respectively.
• What conclusions can the product developer draw about the effectiveness of the new
ingredient, using alpha = 0.05?
Source: Applied Probability and statistics for Engineers by Douglas C. Montgomery and George C. Runger John Wiley, 3rd Ed. 2003

13
Problem ( 1 and  2 Known)

14
Problem ( 1 and  2 Known)

15
Problem ( 1 and  2 Known)
Reject H0

t
121  112   0  2.52
.05
0 1.645 t
 1 1 2.52
8   
2

 10 10  Decision:
Reject H0 at a = 0.05
Conclusion:
There is evidence of a difference in
means.

16
Problem ( 1 and  2 Known)

17
Problem ( 1 and  2 Known)

18
σ12 and σ22 Unknown, Assumed Equal

Population means, Assumptions:


independent samples • Samples are randomly and
independently drawn
σ12 and σ12 known • Populations are normally
distributed
σ12 and σ22 unknown
• Population variances are unknown
σ12 and σ12 assumed equal
*
σ12 and σ12 assumed unequal
but assumed equal

19
σ12 and σ22 Unknown, Assumed Equal

• The population variances are assumed equal, so use the two sample
standard deviations and pool them to estimate σ

• use a t value with (n1 + n2 – 2) degrees of freedom

20
Test Statistic, σ12 and σ22 Unknown, Equal
The test statistic for
μ1 – μ2 is:

t
 x 1 
 x2   μ1  μ 2 
s 2p s 2p

n1 n2

Where t has (n1 + n2 – 2) d.f.,


and (n1  1)s12  (n 2  1)s 22
s 
2

n1  n 2  2
p

21
Decision Rules

1 2 1 2 1 2
1 2 1 2 1 2

22
Decision Rules

23
σ12 and σ22 Unknown, Assumed equal
• Two catalysts are being analyzed to
determine how they affect the mean Observation Catalyst 1 Catalyst 2
yield of a chemical process. Number
• Specifically, catalyst 1 is currently in use, 1 91.50 89.19
but catalyst 2 is acceptable. 2 94.18 90.95
• Since catalyst 2 is cheaper, it should be 3 92.18 90.46
adopted, providing it does not change 4 95.39 93.21
the process yield. 5 91.79 97.19
• A test is run in the pilot plant and results 6 89.07 97.04
in the data shown in table. 7 94.72 91.07
• Is there any difference between the 8 89.21 92.75
mean yields?
𝑥 1= 92.255 𝑥 1 = 92.733
• Use 0.05, and assume equal variances.
s1 =2.39 s2 =2.98
24
σ12 and σ22 Unknown, Assumed equal

25
σ12 and σ22 Unknown, Assumed equal

26
σ12 and σ22 Unknown, Assumed equal

27
σ12 and σ22 Unknown, Assumed equal

28
Thank You

29

You might also like