Math E x a m feb 23 8 am
Advanced Business Statistics
▪ Introduction to Hypothesis Testing (Two Sample)
Winter 2022
Instructor: Ahmad Teymouri All rights Reserved
Agenda
Introduction to Hypothesis Testing of the
Deference Means (Two Sample)
❑ When 𝜎1 and 𝜎2 are known
❑ When 𝜎1 and 𝜎2 are unknown
• Considering equal variances
• Considering unequal variances
❑ For Proportion
Instructor: Ahmad Teymouri All rights Reserved
Concept of Hypothesis Testing - Review
▪ There are two hypothesis; (1) null and (2) alternative
▪ In hypothesis testing, first, we start with the assumption that null
hypothesis is true.
▪ The main objective is to determine whether there is enough evidence to
reject 𝐻0 or 𝐻𝐴
▪ Two possible results are:
o there is enough evidence to support the alternative
o there is not enough evidence to support the alternative
▪ Two possible errors are:
o Reject a true null hypothesis, P(error type one) = α
o Not reject a false null hypothesis, P(error type two) = β
Instructor: Ahmad Teymouri All rights Reserved
𝐻0: 𝜇 = 𝑎
𝐻1: 𝜇 > 𝑎
𝐻0: 𝜇 = 𝑎
𝐻1: 𝜇 < 𝑎
𝐻0: 𝜇 = 𝑎
𝐻1: 𝜇 ≠ 𝑎
𝐻0: 𝜇 = 𝑎
𝐻1: 𝜇 > 𝑎
𝐻0: 𝜇 = 𝑎
𝐻1: 𝜇 < 𝑎
𝐻0: 𝜇 = 𝑎
𝐻1: 𝜇 ≠ 𝑎
𝐻0:𝑝 = 𝑏
𝐻1:𝑝 > 𝑏
𝐻0:𝑝 = 𝑏
𝐻1:𝑝 < 𝑏
𝐻0:𝑝 = 𝑏
𝐻1:𝑝 ≠ 𝑏
𝒛𝜶
− 𝒛𝜶
− 𝒛𝜶/𝟐 𝒛𝜶/𝟐
𝒛𝜶
− 𝒛𝜶
− 𝒛𝜶/𝟐 𝒛𝜶/𝟐
𝒕𝜶
− 𝒕𝜶
− 𝒕𝜶/𝟐 𝒕𝜶/𝟐
one-tail right
one-tail left
two-tail
one-tail right
one-tail left
two-tail
one-tail right
one-tail left
two-tail
𝑍𝑠𝑡𝑎𝑡 = ത𝑋 − 𝜇
ൗ 𝜎
𝑛
𝑡𝑠𝑡𝑎𝑡 = ത𝑋 − 𝜇
ൗ 𝑠
𝑛
𝑍𝑠𝑡𝑎𝑡 = Ƹ𝑝 − 𝑝
𝑝(1 − 𝑝) 𝑛
Hypothesis
Testing
𝛅 𝐮𝐧𝐤𝐧𝐨𝐰𝐧
𝑧𝑠𝑡𝑎𝑡 > 𝑧𝛼 reject 𝐻0
𝑧𝑠𝑡𝑎𝑡 < −𝑧𝛼 reject 𝐻0
𝑧𝑠𝑡𝑎𝑡> 𝑧𝛼/2 𝑧𝑠𝑡𝑎𝑡 < −𝑧𝛼/2
reject 𝐻0
𝑡𝑠𝑡𝑎𝑡 > 𝑡 reject 𝐻0
𝑡𝑠𝑡𝑎𝑡 < −𝑡𝛼 reject 𝐻0
𝑡𝑠𝑡𝑎𝑡> 𝑡𝛼/2 𝑡𝑠𝑡𝑎𝑡 < −𝑡𝛼/2
reject 𝐻0
𝑧𝑠𝑡𝑎𝑡 > 𝑧𝛼 reject 𝐻0
𝑧𝑠𝑡𝑎𝑡 < −𝑧𝛼 reject 𝐻0
𝑧𝑠𝑡𝑎𝑡> 𝑧𝛼/2 𝑧𝑠𝑡𝑎𝑡 < −𝑧𝛼/2
reject 𝐻0
1 2 3 4 5
Instructor: Ahmad Teymouri All rights Reserved
Instructor: Ahmad Teymouri All rights Reserved
Two Populations - Two Samples
Population 1
Parameters: 𝝁𝟏 and 𝜹𝟏
Population 2
Parameters: 𝝁𝟐 and 𝜹𝟐
Sample Size: 𝒏𝟏 Statistics: ഥ𝑿𝟏 and 𝒔𝟏
Sample Size: 𝒏𝟐 Statistics: ഥ𝑿𝟐 and 𝒔𝟐
Inference about the
difference between two
population means 𝜇1 − 𝜇2
Instructor: Ahmad Teymouri All rights Reserved
Testing Difference Population Means: 𝝈𝟏and 𝝈𝟐are Known – Main Steps When standard deviation of both populations are known, below steps should be
followed to test the difference between populations’ mean.
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 > 𝜇2
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 < 𝜇2
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 ≠ 𝜇2
𝑧𝛼
− 𝑧𝛼
− 𝑧𝛼/2 𝑧𝛼/2
one-tail right
one-tail left
two-tail
𝑧𝑠𝑡𝑎𝑡 = ത𝑋1 − ത𝑋2
(𝛿1) 2
𝑛1 + (𝛿2)
2
𝑛2
One-tail right: If 𝑍𝑠𝑡𝑎𝑡 > 𝑍𝛼 , there is enough evidence to reject 𝐻0.
One-tail left: If 𝑍𝑠𝑡𝑎𝑡 < −𝑍𝛼 , there is enough evidence to reject 𝐻0.
Two-tail: If 𝑍𝑠𝑡𝑎𝑡 > 𝑍𝛼/2 or 𝑍𝑠𝑡𝑎𝑡 <
−𝑍𝛼/2 , there is enough evidence to
reject 𝐻0.
1 2-3 4
5
Instructor: Ahmad Teymouri All rights Reserved
Instructor: Ahmad Teymouri All rights Reserved
Example 1
A baby-food producer company, ABC, claims that its product helps babies to
gain weight faster than a leading competitor’s product, XYZ. A survey was
designed by a MBA student as follow two steps:
• Mothers were asked which product (ABC or XYZ) they intended to
feed their babies.
• There were 38 mothers feeding babies with ABC and 29 mentioned
that they would feed their babies XYZ.
• Mothers were asked to keep track of their babies’ weight gains over
the next 3 months.
• Each baby’s weight gain (in gram) was recorded. ( refer to Excel Data)
Assume, according to historical data, the standard deviation of babies’ weight
who were fed by ABC is 285 gram and by XYZ is 320 gram. Can we conclude,
using weight gain as our criterion, that company A is indeed superior. Assume
confidence level is 95%.
Instructor: Ahmad Teymouri All rights Reserved
Example 1
ത𝑋1 = σ𝑥1 𝑛1
= 94,078
38 = 2,476 𝛿1 = 285
1 − 𝛼 = 0.95
𝛼 = 0.05
𝑍0.05 = 1.64
✓ Question is a hypothesis testing
✓ Standard deviation of populations are known, we use z
ത𝑋2 = σ𝑥2 𝑛2
= 66,605
29 = 2,297 𝛿2 = 320
𝑛1 = 38
𝑛2 = 29
from Z table
Instructor: Ahmad Teymouri All rights Reserved
Example 1
𝐻0: 𝜇1 = 𝜇2
𝐻1:𝜇1 > 𝜇2
The test is one-tail right.
For z critical, we use Normal table.
For z-stat, we use the formula:
z-stat > z-critical. Therefore z-stat falls in rejection region. There is enough evidence to reject
𝐻0. Company A is superior.
𝑍𝛼 = 𝑍0.05 = −1.64
First, we construct the hypothesis:
rejection
region
𝟏.𝟔𝟒 𝟐.𝟑𝟕
𝑧𝑠𝑡𝑎𝑡 = ത𝑋1 − ത𝑋2
(𝛿1) 2
𝑛1 + (𝛿2)
2
𝑛2
= 2,476 − 2,297
(285)2
38 + (320)2
29
= 2.37
Instructor: Ahmad Teymouri All rights Reserved
Testing Difference Population Means: 𝝈𝟏and 𝝈𝟐are unknown
When standard deviation of both populations are unknown, the difference of
population means depends on whether the two unknown population variances
are equal or not.
• 𝜎1 2 = 𝜎2
2
• 𝜎1 2 ≠ 𝜎2
2
For both situations, student t distribution is applied. However, the formula is
different.
Instructor: Ahmad Teymouri All rights Reserved
Testing Difference Population Means: 𝝈𝟏and 𝝈𝟐are Unknown – Main Steps When 𝜎1
2 = 𝜎2 2 below steps should be followed to test the difference between
populations’ mean.
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 > 𝜇2
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 < 𝜇2
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 ≠ 𝜇2
𝑡𝛼
− 𝑡𝛼
− 𝑡𝛼/2 𝑡𝛼/2
one-tail right
one-tail left
two-tail
𝑡𝑠𝑡𝑎𝑡 = ത𝑋1 − ത𝑋2
𝑠𝑝 2 1 𝑛1
+ 1 𝑛2
One-tail right: If 𝑡𝑠𝑡𝑎𝑡 > 𝑡𝛼, there is enough evidence to reject 𝐻0.
One-tail left: If 𝑡𝑠𝑡𝑎𝑡 < −𝑡𝛼, there is enough evidence to reject 𝐻0.
Two-tail: If 𝑡𝑠𝑡𝑎𝑡 > 𝑡𝛼/2 or 𝑡𝑠𝑡𝑎𝑡 < −𝑡𝛼/2 ,
there is enough evidence to reject 𝐻0.
1 2-3 4
5
𝑠𝑝 2 =
(𝑛1 − 1)𝑠1 2 + (𝑛2 − 1)𝑠2
2
𝑛1 + 𝑛2 − 2
𝐷𝑒𝑔𝑟𝑒𝑒 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚 = 𝑛1 + 𝑛2 − 2
Instructor: Ahmad Teymouri All rights Reserved
Instructor: Ahmad Teymouri All rights Reserved
Example 2
A large car manufacturer developed a mandatory training program for its
workers in 4 countries. In assessing the effectiveness of this program, an
operation manager designed a survey by measuring two factors:
• Workers’ improved performance (saving time, second).
• age of each worker, 21-to-30 and 31-to-40 age groups.
The survey measured 200 workers’ improved performance in each age group,
the data was listed in the Excel file. With 90% confidence, can we conclude
that the training program has been more effective for age group 31-to-40.
Assume the variances of the improved performance for workers 21-to-30 and
31-to-40 are equal 𝜎1 2 = 𝜎2
2.
Instructor: Ahmad Teymouri All rights Reserved
Example 2
✓ Question is a hypothesis testing
✓ Standard deviation of populations are unknown, we use t
ത𝑋1 = σ𝑥1 𝑛1
= 17,575
200 = 87.87 𝑆1 = 13.38
1 − 𝛼 = 0.90
𝛼 = 0.10
𝑡0.1 = 1.282
ത𝑋2 = σ𝑥2 𝑛2
= 10,254
200 = 51.22
𝑆2 = 17.06
𝑛1 = 200
𝑛2 = 200
from t table = 𝑛1 + 𝑛2 − 2 = 200 + 200 − 2 = 398
𝑑𝑒𝑔𝑟𝑒𝑒 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚
Instructor: Ahmad Teymouri All rights Reserved
Example 2
𝐻0: 𝜇1 = 𝜇2
𝐻1:𝜇1 < 𝜇2
The test is one-tail left.
For t critical, we use t-student table.
For t-stat, we use the formula:
𝑡𝛼 = 𝑡0.1 = 1.282
First, we construct the hypothesis:
rejection
region
𝟐𝟑.𝟗−𝟏.𝟐𝟖𝟐
𝑡𝑠𝑡𝑎𝑡 = ത𝑋1 − ത𝑋2
𝑠𝑝 2 1 𝑛1
+ 1 𝑛2
= (87.87 − 51.22)
235( 1 200
+ 1 200
)
= 23.9
𝑠𝑝 2 =
(𝑛1 − 1)𝑠1 2 + (𝑛2 − 1)𝑠2
2
𝑛1 + 𝑛2 − 2
𝑠𝑝 2 =
200 − 1 13.382 + (200 − 1)17.062
200 + 200 − 2 = 235
t-stat > t-critical. Therefore t-stat
does not fall in the rejection region.
We fail to r𝑒𝑗𝑒𝑐𝑡 𝐻0.
Instructor: Ahmad Teymouri All rights Reserved
Testing Difference Population Means: 𝝈𝟏and 𝝈𝟐are Unknown – Main Steps When 𝜎1
2 ≠ 𝜎2 2 below steps should be followed to test the difference between
populations’ mean.
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 > 𝜇2
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 < 𝜇2
𝐻0:𝜇1 = 𝜇2
𝐻1:𝜇1 ≠ 𝜇2
𝑡𝛼
− 𝑡𝛼
− 𝑡𝛼/2 𝑡𝛼/2
one-tail right
one-tail left
two-tail
𝑡𝑠𝑡𝑎𝑡 = ത𝑋1 − ത𝑋2
𝑠1 2
𝑛1 + 𝑠2
2
𝑛2
One-tail right: If 𝑡𝑠𝑡𝑎𝑡 > 𝑡𝛼, there is enough evidence to reject 𝐻0.
One-tail left: If 𝑡𝑠𝑡𝑎𝑡 < −𝑡𝛼, there is enough evidence to reject 𝐻0.
Two-tail: If 𝑡𝑠𝑡𝑎𝑡 > 𝑡𝛼/2 or 𝑡𝑠𝑡𝑎𝑡 < −𝑡𝛼/2 ,
there is enough evidence to reject 𝐻0.
1 2-3 4
5
𝐷𝑒𝑔𝑟𝑒𝑒 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚
= ( 𝑠1
2
𝑛1 +
𝑠2 2
𝑛2 )2
( 𝑠1
2
𝑛1 )2
𝑛1 − 1 +
( 𝑠2
2
𝑛2 )2
𝑛2 − 1
Instructor: Ahmad Teymouri All rights Reserved
Instructor: Ahmad Teymouri All rights Reserved
Example 3
A business analyst designed a survey to determine the effect of gender on the
automobile insurance rate. A random sample of young men and women was
listed in the Excel file. 178 men and 211 women were asked how many
kilometers he or she had driven in the past year.
After analysing data, she claims that men and women drive totally almost an
equal distance in a year. With 90% confidence, do you accept her analysis.
Assume the variances of the distance driven by men and women drivers are
not equal 𝜎1 2 ≠ 𝜎2
2.
Instructor: Ahmad Teymouri All rights Reserved
Example 3
ത𝑋1 = σ𝑥1 𝑛1
= 3,589,962
178 = 20,168
𝑆1 = 3,609
1 − 𝛼 = 0.90
𝛼 = 0.10
𝛼
2 = 0.05
𝑡0.05 = 1.645
ത𝑋2 = σ𝑥2 𝑛2
= 3,913,864
210 = 18,549 𝑆2 = 3,386
𝑛1 = 178
𝑛2 = 211
from t table
= ( 𝑠1
2
𝑛1 +
𝑠2 2
𝑛2 )2
( 𝑠1
2
𝑛1 )2
𝑛1 − 1 +
( 𝑠2
2
𝑛2 )2
𝑛2 − 1
𝑑𝑒𝑔𝑟𝑒𝑒 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚
= ( 3,6092
178 +
3,3862
211 )2
( 3,6092
178 )2
178 − 1 +
( 3,3862
211 )2
211 − 1
𝑑𝑒𝑔𝑟𝑒𝑒 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚
= 367
✓ Question is a hypothesis testing
✓ Standard deviation of populations are unknown, we use t
Instructor: Ahmad Teymouri All rights Reserved
Example 3
𝐻0: 𝜇1 = 𝜇2
𝐻1:𝜇1 ≠ 𝜇2
The test is two-tail.
For t critical, we use t-student table.
For t-stat, we use the formula:
𝑡𝛼/2 = 𝑡0.05 = 1.645
First, we construct the hypothesis:
𝑡𝑠𝑡𝑎𝑡 = ത𝑋1 − ത𝑋2
𝑠1 2
𝑛1 + 𝑠2
2
𝑛2
= (20,168 − 18,549)
( 3,6092
178 + 3,3862
211 )
= 4.53
t-stat > t-critical. Therefore t-stat falls in the rejection region. We have enough evidence to
reject 𝐻0.
rejection
region
+𝟏.𝟔𝟒𝟓−𝟏.𝟔𝟒𝟓
rejection
region
𝟒.𝟓𝟑
Instructor: Ahmad Teymouri All rights Reserved
Testing Difference Population Proportions
In some cases, the objective is to determine the difference between proportion
of two populations, 𝑝1−𝑝2.
To draw inferences about 𝑝1and 𝑝2, a sample of size 𝑛1from population 1 and a
sample of size 𝑛2 from population 2 are taken.
Population 1 Population 2
Parameter: 𝒑𝟏 Parameter: 𝒑𝟐
Statistics: ෝ𝒑𝟏 Statistics: ෝ𝒑𝟐
Sample
Size: 𝒏𝟏
Sample
Size: 𝒏𝟐
ෝ𝒑𝟏 = 𝒙𝟏 𝒏𝟏
ෝ𝒑𝟐 = 𝒙𝟐 𝒏𝟐
For each sample, the
number of successes is
represented by x, which
we label 𝒙𝟏 and 𝒙𝟐 , respectively.
Instructor: Ahmad Teymouri All rights Reserved
Testing Difference Population Proportions – Main Steps
𝐻0: 𝑝1 = 𝑝2
𝐻1:𝑝1 > 𝑝2
𝐻0:𝑝1 = 𝑝2
𝐻1:𝑝1 < 𝑝2
𝐻0:𝑝1 = 𝑝2
𝐻1:𝑝1 ≠ 𝑝2
𝑧𝛼
− 𝑧𝛼
− 𝑧𝛼/2 𝑧𝛼/2
one-tail right
one-tail left
two-tail
One-tail right: If 𝑍𝑠𝑡𝑎𝑡 > 𝑍𝛼, there is enough evidence to reject 𝐻0.
One-tail left: If 𝑍𝑠𝑡𝑎𝑡 < −𝑍𝛼, there is enough evidence to reject 𝐻0.
Two-tail: If 𝑍𝑠𝑡𝑎𝑡 > 𝑍𝛼/2 or 𝑍𝑠𝑡𝑎𝑡 < −𝑍𝛼/2, there is enough evidence to reject 𝐻0.
1 2-3 4
5
𝑧𝑠𝑡𝑎𝑡 = ( Ƹ𝑝1− Ƹ𝑝2)
Ƹ𝑝(1 − Ƹ𝑝)( 1 𝑛1
+ 1 𝑛2 )
Ƹ𝑝 = 𝑥1 + 𝑥2 𝑛1 + 𝑛2
Instructor: Ahmad Teymouri All rights Reserved
Instructor: Ahmad Teymouri All rights Reserved
Example 4
Selling extended warranties for products is a profitable business for many
stores. The extended warranty is offered for both regular and sale prices. A
store manager has recently conducted a survey about the difference in
proportion of customers who bought extended warranty. The below table
shows the results:
At the 1% significance level, can we say that the people who paid the regular
price are more likely to buy an extended warranty?
Sale Price Regular Price
Sample size 354 478
Number who bought
extended warranty
111 105
Instructor: Ahmad Teymouri All rights Reserved
Example 4
✓ Question is a population proportion hypothesis testing
𝑥1 = 111
𝛼 = 0.01
𝑍0.01 = 2.33
𝑥2 = 105
𝑛1 = 354
𝑛2 = 478
from Z table
Ƹ𝑝2 = 𝑥2 𝑛2
= 105
478 = 0.22
Ƹ𝑝1 = 𝑥1 𝑛1
= 111
354 = 0.31
Ƹ𝑝 = 𝑥1 + 𝑥2 𝑛1 + 𝑛2
= 111 + 105
354 + 478 = 0.26
Instructor: Ahmad Teymouri All rights Reserved
Example 4
𝐻0: 𝑝1 = 𝑝2
𝐻1:𝑝1 < 𝑝2
This is case number one. The test is one-tail left.
For z critical, we use Normal table.
For z-stat, we use the formula:
z-stat > z-critical. Therefore z-stat does not fall in the rejection region. There is not enough
evidence to accept 𝐻1.
𝑍𝛼 = 𝑍0.01 = −2.33
First, we construct the hypothesis:
𝑧𝑠𝑡𝑎𝑡 = ( Ƹ𝑝1− Ƹ𝑝2)
Ƹ𝑝(1 − Ƹ𝑝)( 1 𝑛1
+ 1 𝑛2 )
= (0.31 − 0.22)
0.26(1 − 0.26)( 1 354
+ 1 478
)
= 2.92
rejection
region
𝟐.𝟗𝟐−𝟐.𝟑𝟑
Instructor: Ahmad Teymouri All rights Reserved
In Class Activity 1
How important to your health are regular vacations? In a study a random
sample of men and women were asked how frequently they take
vacations. The men and women were divided into two groups each. The
members of group 1 had suffered a heart attack; the members of group
2 had not. The number of days of vacation last year was recorded for
each person. Can we infer that men and women who suffer heart
attacks vacation less than those who did not suffer a heart attack?
Instructor: Ahmad Teymouri All rights Reserved
In Class Activity 2
In designing advertising campaigns to sell magazines, it is important to know
how much time each of a number of demographic groups spends reading
magazines. In a preliminary study, 40 people were randomly selected. Each
was asked how much time per week he or she spends reading magazines;
additionally, each was categorized by gender and by income level (high or
low). The data are stored in the following way: column 1 = Time spent reading
magazines per week in minutes for all respondents; column 2 = Gender (1 =
Male, 2 = Female); column 3 = Income level (1 = Low, 2 = High).
Is there sufficient evidence at the 10% significance level to conclude that men
and women differ in the amount of time spent reading magazines?
Instructor: Ahmad Teymouri All rights Reserved
In Class Activity 3
The manager of a dairy is in the process of deciding which of two new carton-
filling machines to use. The most important attripute is the consistency of the
fills. In a preliminary study she measured the fills in the 1-liter carton and listed
them here. Can the manager infer that the two machines differ in their
consistency of fills?
Instructor: Ahmad Teymouri All rights Reserved
Data Analysis - Microsoft Excel
Instructor: Ahmad Teymouri All rights Reserved
Data Analysis - Microsoft Excel
Let’s answer example 1 with data analysis Add-Ins in Excel.
Instructor: Ahmad Teymouri All rights Reserved
Data Analysis - Microsoft Excel
Instructor: Ahmad Teymouri All rights Reserved
References
• Business Statistics in Practice: Second Canadian Edition, Bowerman,
O'Connell, et al. McGraw-Hill, Third Canadian Edition
• G. Keller (2017) Statistics for Management and Economics (Abbreviated),
11th Edition, South-Western (students can also use the 8th edition of the
same textbook).
• M. Middleton (1997) Data Analysis Using Microsoft Excel, Duxbury. (A good
reference for basic statistical work with Excel.)
Thank you