STAT2225 Module 8. Hypothesis Testing For Two Population Parameters
STAT2225 Module 8. Hypothesis Testing For Two Population Parameters
STAT2225 Module 8. Hypothesis Testing For Two Population Parameters
Inferential
Statistics
Hypothesis
Estimation
Testing
Example:
• we wish to compare the average lifetime of two different brands of batteries
• two different brands of fertilizer might be tested to see whether one brand is
more effective than the other
• compare two different teaching styles to test if there is a difference in effectivity in
terms of perceived learning by the students
Hypothesis Testing for Two Population Parameters | 4
DEPARTMENT of
STATISTICS Hypothesis Testing for Two Populations
• Two samples are independent if the samples from one population are not related to or
not paired with the samples selected from other population.
• Two samples are dependent if there is some relationship so that each value in one
sample is paired (or matched) with a corresponding value in the other sample.
Example:
• One group of subjects is treated with the cholesterol-reducing drug Lipitor, while
second and separate group of subjects is given a placebo. These two sample groups are
independent because the individual treatment group are in no way paired or matched
with the corresponding members in the placebo group. The two groups here are
different.
• The effectiveness of a diet pill is tested using weights of subjects measured before and
after the treatment. Each “before” value is matched with the “after” value because each
before-after pair of measurements comes from same person, thus these are dependent.
Assumptions:
1. The samples must be random samples.
2. The populations from which the samples were obtained must be normally
distributed. (Note: The test should not be used when the distributions
depart from normality.)
3. The samples must be independent of each other.
𝐹0.10ൗ = 𝐹0.05, 8, 12
2 , 9−1, 13−1
= 𝟐. 𝟖𝟓
𝐹0.05ൗ
2 , 5−1, 6−1
= 𝐹0.025, 4, 5
= 𝟕. 𝟑𝟗
Smokers Nonsmokers
Sample size 10 8
Variance 36 10
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: F-test or Test for Homogeneity of Variance
Distribution’s tail: two-tailed test (since 𝐻𝑎 is 𝜎12 ≠ 𝜎22 )
Hypothesis Testing for Two Population Parameters | 15
DEPARTMENT of
STATISTICS Test for Homogeneity of Variance (F-test)
Step 3: Find the critical value.
Decision Rule:
Reject 𝑯𝟎 if 𝑭 > 𝟑. 𝟔𝟖
𝑠12 36
𝐹= 2= = 𝟑. 𝟔𝟎
𝑠2 10
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: F-test or Test for Homogeneity of Variance
Distribution’s tail: two-tailed test (since 𝐻𝑎 is 𝜎12 ≠ 𝜎22 )
Decision Rule:
Reject 𝑯𝟎 if 𝑭 > 𝟐. 𝟗𝟕𝟖𝟔
𝑠12 35.5
35.522
𝐹= 2= 22
=
= 𝟐.
𝟐.𝟗𝟗𝟖𝟖
𝟐. 𝟗𝟗𝟖𝟖
𝟗𝟗𝟖𝟖
𝑠2 20.5
20.5
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: F-test or Test for Homogeneity of Variances
Distribution’s tail: two-tailed test (since 𝐻𝑎 is 𝜎12 ≠ 𝜎22 )
Decision Rule:
Reject 𝑯𝟎 if 𝑭 > 𝟒. 𝟐𝟗𝟗𝟑
𝑠12 14.2
14.222
𝐹= 2== 22
=
= 𝟐.
𝟐.𝟎𝟗𝟗𝟓
𝟎𝟗𝟗𝟓
𝑠2 9.8
9.8
NO
NO
Assumptions:
1. Both samples are random samples.
2. The samples must be independent of each other.
3. Either or both of these conditions are satisfied:
• The two sample sizes are both large (𝑛1 > 30 and 𝑛2 > 30).
• Both samples come from populations having normal or
approximately normal distribution.
Hypothesis Testing for Two Population Parameters | 31
DEPARTMENT of
STATISTICS 2. Independent Samples z-test
Independent Samples z-test
Critical Values
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: Independent Samples z-test (since 𝜎1 and 𝜎2 are known)
Distribution’s tail: two-tailed test (since 𝐻𝑎 is 𝜇1 ≠ 𝜇2 )
Hypothesis Testing for Two Population Parameters | 35
DEPARTMENT of
STATISTICS 2. Independent Samples z-test
Step 3: Find the critical value and the critical region. Formulate decision rule.
𝑧 = −1.96 0 𝑧 = 1.96
Decision Rule:
𝑧 = −1.96 0 𝑧 = 1.96
Decision Rule:
Reject 𝐻0 if |𝑍𝑐 | ≥ 𝑍𝛼Τ2 , that is,
Reject 𝑯𝟎 if |𝒁𝒄 | ≥ 𝟏. 𝟗𝟔
Given: Aside from the table, we are also given that 𝜇1 = 48, 𝜇2 = 43, and
𝛼 = 0.05
Hypothesis Testing for Two Population Parameters | 41
DEPARTMENT of
STATISTICS 2. Independent Samples z-test
Step 0: Verify if the requirements are met.
The requirements are met.
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: Independent Samples z-test (since 𝜎1 and 𝜎2 are known)
Distribution’s tail: right-tailed test (since 𝐻𝑎 is 𝜇1 > 𝜇2 )
0 1.645
Decision Rule:
0 1.645
Decision Rule:
Reject 𝐻0 if 𝑍𝑐 > 𝑍𝛼 , that is,
Reject 𝑯𝟎 if 𝒁𝒄 > 𝟏. 𝟔𝟒𝟓
NO
Assumptions:
1. Both samples are random samples.
2. The samples must be independent of each other.
3. Either or both of these conditions are satisfied:
• The two sample sizes are both large (𝑛1 > 30 and 𝑛2 > 30).
• Both samples come from populations having normal or
approximately normal distribution.
Hypothesis Testing for Two Population Parameters | 49
DEPARTMENT of
STATISTICS 3. Independent Samples t-test
Are
Independent Samples
Independent Samples population YES t-test
t-test variances
equal? (Equal Variances)
NO Independent Samples
t-test
(Unequal Variances)
Are
Independent Samples
Independent Samples population YES t-test
t-test variances
equal? (Equal Variances)
NO Independent Samples
t-test
(Unequal Variances)
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: Independent Samples t-test (Equal Variances)
(since 𝜎1 and 𝜎2 are unknown and variances are assume
equal)
Distribution’s tail: two-tailed test (since 𝐻𝑎 is 𝜇1 ≠ 𝜇2 )
Decision Rule:
Decision Rule:
Reject 𝐻0 if |𝑡𝑐 | ≥ 𝑡𝛼Τ2 ,𝑛1 +𝑛2 −2 , that is,
Reject 𝑯𝟎 if |𝒕𝒄 | ≥ 𝟏. 𝟕𝟎𝟏
2 2 2 2
2
𝑛1 − 1 𝑠1 + 𝑛 2 − 1 𝑠2 15 − 1 6.17 + 15 − 1 13.2
𝑠𝑝 = = = 106.15
𝑛1 − 1 + (𝑛2 − 1) 15 − 1 + (15 − 1)
Recall: This problem is also used in Example 3 (Test for Homogeneity of Variance) and result
showed that the population variances of these two colleges are equal, hence it is
appropriate to use Independent Samples t-test (Equal Variances).
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: Independent Samples t-test (Equal Variances)
(since 𝜎1 and 𝜎2 are unknown and population variances are
shown to be equal)
Distribution’s tail: two-tailed test (since 𝐻𝑎 is 𝜇1 ≠ 𝜇2 )
Decision Rule:
Decision Rule:
Reject 𝐻0 if |𝑡𝑐 | ≥ 𝑡𝛼Τ2 ,𝑛1 +𝑛2 −2 , that is,
Reject 𝑯𝟎 if 𝒕𝒄 ≥ 𝟐. 𝟕𝟖𝟕
2 2 2 2
2
𝑛1 − 1 𝑠1 + 𝑛 2 − 1 𝑠2 12 − 1 14.2 + 15 − 1 9.8
𝑠𝑝 = = =
= 142.50
142.50
𝑛1 − 1 + (𝑛2 − 1) 12 − 1 + (15 − 1)
Are
Independent Samples
Independent Samples population YES t-test
t-test variances
equal? (Equal Variances)
NO Independent Samples
t-test
(Unequal Variances)
*Round-up df to next whole number Hypothesis Testing for Two Population Parameters | 69
DEPARTMENT of
STATISTICS 3.2 Independent Samples t-test (Unequal Variances)
Recall: This problem is also used in Example 2 (Test for Homogeneity of Variance) and result showed
that the population variances are unequal, hence it is appropriate to use Independent Samples t-
test (Unequal Variances).
Hypothesis Testing for Two Population Parameters | 70
DEPARTMENT of
STATISTICS 3.2 Independent Samples t-test (Unequal Variances)
(Group 1) (Group 2)
Given: 𝑛1 = 15, 𝑠1 = 20.5, 𝑋ത1 = 195.9,
𝑛2 = 15, 𝑠2 = 35.5, 𝑋ത2 = 227.4, 𝛼 = 0.05
Hypothesis Testing for Two Population Parameters | 71
DEPARTMENT of
STATISTICS 3.2 Independent Samples t-test (Unequal Variances)
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: Independent Samples t-test (Unequal Variances)
(since 𝜎1 and 𝜎2 are unknown and population variances are
shown to be unequal)
Distribution’s tail: left-tailed test (since 𝐻𝑎 is 𝜇1 < 𝜇2 )
Step 3: Find the critical value and the critical region. Formulate decision rule.
𝑑𝑓 = 22.4026 ≈ 𝟐𝟑
Step 3: Find the critical value and the critical region. Formulate decision rule.
−1.714
Decision Rule:
*Round-up df to next whole number Hypothesis Testing for Two Population Parameters | 75
DEPARTMENT of
STATISTICS 3.2 Independent Samples t-test (Unequal Variances)
Step 3: Find the critical value and the critical region. Formulate decision rule.
−1.714
Decision Rule:
Reject 𝐻0 if 𝑡𝑐 < −𝑡𝛼, 𝑑𝑓 , that is,
Reject 𝑯𝟎 if 𝒕𝒄 < −𝟏. 𝟕𝟏𝟒.
NO
Assumptions:
1. Both samples are random samples.
2. The sample data are dependent.
3. Either or both of these conditions are satisfied:
• The number of pairs of sample data is large (𝑛 > 30).
• The population must be normally or approximately normally distributed.
Hypothesis Testing for Two Population Parameters | 80
DEPARTMENT of
STATISTICS 4. Dependent Samples t-test
Dependent Samples t-test
∑𝑑𝑖 2
∑𝑑𝑖 ∑𝑑𝑖2 − 𝜇𝑑 = claimed value of
𝑑ҧ = 𝑛 the difference
𝑛 𝑠𝑑 =
𝑛−1
Hypothesis Testing for Two Population Parameters | 81
DEPARTMENT of
STATISTICS 4. Dependent Samples t-test
Example 9. As an aid for improving students’ study habits, nine students were
randomly selected to attend a seminar on the importance of education in life.
The table shows the number of hours each student studied per week before
and after the seminar. At 𝛼 = 0.05, did attending the seminar increase the
number of hours the students studied per week? Assume that the sample
came from normally distributed population.
Student 1 2 3 4 5 6 7 8 9
Before (𝑋1 ) 9 12 6 15 3 18 10 13 7
After (𝑋2 ) 9 17 9 20 2 21 15 22 6
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: Dependent Samples t-test (since data are paired)
Distribution’s tail: left-tailed test (since 𝐻𝑎 is 𝜇1 < 𝜇2 )
−1.860 0
Decision Rule:
∑𝑑𝑖 2
∑𝑑𝑖 ∑𝑑𝑖2 − 𝜇𝑑 = claimed value of
𝑑ҧ = 𝑛 the difference
𝑛 𝑠𝑑 =
𝑛−1
Hypothesis Testing for Two Population Parameters | 85
DEPARTMENT of
STATISTICS 4. Dependent Samples t-test
Step 3: Find the critical value and the critical region. Formulate decision rule.
−1.860 0
Decision Rule:
Reject 𝐻0 if 𝑡𝑐 < −𝑡𝛼 , 𝑛−1 , that is
Reject 𝑯𝟎 if 𝒕𝒄 < −𝟏. 𝟖𝟔𝟎
∑𝑑𝑖 2 −28 2
2
∑𝑑𝑖 −28 ∑𝑑𝑖 − 176 −
𝑛 9
𝑑ҧ = = = −3.11 𝑠𝑑 = = = 3.33
𝑛 9 𝑛−1 9−1
Hypothesis Testing for Two Population Parameters | 87
DEPARTMENT of
STATISTICS 4. Dependent Samples t-test
Step 4: Compute for the test statistic.
Recall: 𝑑ҧ = −3.11, 𝑠𝑑 = 3.33, 𝑛=9
𝑑ҧ − 𝜇𝑑 −3.11 − 0
𝑡𝑐 = 𝑠𝑑 = = −𝟐.
−𝟐. 𝟖𝟎𝟐
𝟖𝟎𝟐
3.33
𝑛 9
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: Dependent Samples t-test (since data are paired)
Distribution’s tail: right-tailed test (since 𝐻𝑎 is 𝜇1 > 𝜇2 )
0 1.476
Decision Rule:
∑𝑑𝑖 2
∑𝑑𝑖 ∑𝑑𝑖2 − 𝜇𝑑 = claimed value of
𝑑ҧ = 𝑛 the difference
𝑛 𝑠𝑑 =
𝑛−1
Hypothesis Testing for Two Population Parameters | 93
DEPARTMENT of
STATISTICS 4. Dependent Samples t-test
Step 3: Find the critical value and the critical region. Formulate decision rule.
0 1.476
Decision Rule:
Reject 𝐻0 if 𝑡𝑐 > 𝑡𝛼 , 𝑛−1 , that is
Reject 𝑯𝟎 if 𝒕𝒄 > 𝟏. 𝟒𝟕𝟔
2 ∑𝑑𝑖 2 (100)2
∑𝑑𝑖 100 ∑𝑑𝑖 − 4890 −
𝑛 6 = 25.39
𝑑ҧ = = = 16.67 𝑠𝑑 = =
𝑛 6 𝑛−1 6−1
Hypothesis Testing for Two Population Parameters | 95
DEPARTMENT of
STATISTICS 4. Dependent Samples t-test
Step 4: Compute for the test statistic.
Recall: 𝑑ҧ = 16.67, 𝑠𝑑 = 25.39, 𝑛=6
𝑑ҧ − 𝜇𝑑 16.67 − 0
𝑡𝑐 = 𝑠𝑑 = 25.39 = 𝟏. 𝟔𝟎𝟖
𝑛 6
At 10% significance level, there is enough evidence to support the claim that
the mineral supplement is effective for diet.
Examples:
• Assess whether the proportion of female household heads is greater in
urban areas than in rural localities.
• Compare the percentage of left-handed male basketball players and
female volleyball players.
• A marketing manager would consider packaging a product for working
mothers if, based on planned research, the proportion of potential
purchasers is higher in this group compared to the group of nonworking
mothers.
Hypothesis Testing for Two Population Parameters | 98
DEPARTMENT of
STATISTICS 5. Hypothesis Testing for Two Proportions
z-test for Two Proportions
Critical Values
We want to test the hypothesis that males dislike shopping more than females
at 0.05 level of significance.
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: z-test for Two Proportions
Distribution’s tail: right-tailed test (since 𝐻𝑎 is 𝑝1 > 𝑝2 )
Hypothesis Testing for Two Population Parameters | 103
DEPARTMENT of
STATISTICS 5. Hypothesis Testing for Two Proportions
Step 3: Find the critical value and the critical region. Formulate decision rule.
0 1.645
Decision Rule:
0 1.645
Decision Rule:
Reject 𝐻0 if 𝑍𝑐 > 𝑍𝛼 , that is,
Reject 𝑯𝟎 if 𝒁𝒄 > 𝟏. 𝟔𝟒𝟓
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: z-test for Two Proportions
Distribution’s tail: left-tailed test (since 𝐻𝑎 is 𝑝1 < 𝑝2 )
−2.326
Decision Rule:
−2.326
Decision Rule:
Reject 𝐻0 if 𝑍𝑐 < −𝑍𝛼 , that is,
Reject 𝑯𝟎 if 𝒁𝒄 < −𝟐. 𝟑𝟐𝟔
Step 2: Determine the test statistic to use and its distribution’s tail.
Test statistic: z-test for Two Proportions
Distribution’s tail: two-tailed test (since 𝐻𝑎 is 𝑝1 ≠ 𝑝2 )
𝑧 = −1.960 0 𝑧 = 1.960
Decision Rule:
𝑧 = −1.960 0 𝑧 = 1.960
Decision Rule:
Reject 𝐻0 if 𝑍𝑐 ≥ 𝑍𝛼Τ2 , that is,
Reject 𝑯𝟎 if 𝒁𝒄 ≥ 𝟏. 𝟗𝟔𝟎.