Module 9: Statistical Inference of Two Samples: The Z-Test
Module 9: Statistical Inference of Two Samples: The Z-Test
Review question: What is the use level of significance in statistics? Write your
answers in the space below.
The z-test
1. Population Parameter
If the population variances are known, use:
(𝒙 ̅𝟐 ) − (𝝁
̅𝟏 − 𝒙 ̅𝟏 − 𝝁
̅𝟐) (𝒙 ̅𝟐 ) − 𝒅𝟎
̅𝟏 − 𝒙
𝒛= =
𝟐 𝟐 𝟐 𝟐
√𝝈𝟏 + 𝝈𝟐 √𝝈𝟏 + 𝝈𝟐
𝒏𝟏 𝒏𝟐 𝒏𝟏 𝒏𝟐
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
Null Hypothesis Alternative Critical Region
(H0) Hypothesis (H1) (Reject H0 if)
Solution:
1. Hypotheses:
H0: 𝝁𝟏 = 𝝁𝟐 (𝝁𝟏 − 𝝁𝟐 = 𝟎), and the difference is due merely to chance.
H1: 𝝁𝟏 ≠ 𝝁𝟐 , and there is a significant difference between the classes.
2. Level of Significance:
𝒂. 𝜶 = 𝟎. 𝟎𝟓
𝒃. 𝜶 = 𝟎. 𝟎𝟏
3. Critical regions (𝑧 < −𝑧𝛼/2 𝑜𝑟 𝑧 > 𝑧𝛼/2 ):
a. P(Z < -𝑧𝛼/2 ) = 0.05/2 = 0.025
z < -1.96
or z > 1.96
b. P(Z < -𝑧𝛼/2 ) = 0.01/2 = 0.005
z < -2.575
or z > 2.575
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
𝒛 = −𝟐. 𝟒𝟗
5. Decision
The results are significant at the 0.05 level (the mean grade of the first
class is less than the second class) but not at the 0.01 level.
2. Population proportions
̂𝟏 − 𝒑
𝒑 ̂𝟐
𝒛=
𝟏 𝟏
√𝒑
̂𝒒̂(
𝒏𝟏 + 𝒏𝟐 )
𝑥1 𝑥2
𝑤ℎ𝑒𝑟𝑒: 𝑝̂1 = , 𝑝̂ 2 =
𝑛1 𝑛2
𝑥1 + 𝑥2 𝑛1 𝑝̂1 + 𝑛1 𝑝̂1
𝑝̂ = = , 𝑞̂ = 1 − 𝑝̂
𝑛1 + 𝑛2 𝑛1 + 𝑛2
Example 2: Two groups, A and B, consist of 100 people each who have a
disease. A serum is given to group A but not to group B (which is
called the control); otherwise, the two groups are treated identically.
It is found that in groups A and B, 75 and 65 people, respectively,
recover from the disease. At significance levels of (a) 0.01, (b) 0.05,
and (c) 0.10, test the hypothesis that the serum helps cure the
disease.
Solution:
1. Hypotheses:
Let p1 and p2 denote the population proportions cured by (1) using
the serum and (2) not using the serum, respectively.
H0: 𝒑𝟏 = 𝒑𝟐 , and the observed difference is due merely to chance
(i.e., the serum is ineffective).
H1: 𝒑𝟏 > 𝒑𝟐 , and the serum is effective.
2. Level of Significance:
𝒂. 𝜶 = 𝟎. 𝟎𝟏
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
𝒃. 𝜶 = 𝟎. 𝟎𝟓
𝒄. 𝜶 = 𝟎. 𝟏𝟎
5. Decision
We conclude that the serum is effective at the 0.10 level but not
at 0.05 and 0.01 level. Note that this conclusion depends on how
much we are willing to risk being wrong.
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
The t-test
1. Population Parameter
a. For unknown but equal variances
(𝒙 ̅𝟐 ) − 𝒅𝟎
̅𝟏 − 𝒙
𝒕=
𝟏 𝟏
𝒔𝒑 √𝒏 + 𝒏
𝟏 𝟐
𝒔𝟏 𝟐 (𝒏𝟏 − 𝟏) + 𝒔𝟐 𝟐 (𝒏𝟐 − 𝟏)
𝟐
𝑤ℎ𝑒𝑟𝑒: 𝑠𝑎𝑚𝑝𝑙𝑒 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒, 𝒔𝒑 =
𝒏𝟏 + 𝒏𝟐 − 𝟐
𝐷𝑒𝑔𝑟𝑒𝑒 𝑜𝑓 𝑓𝑟𝑒𝑒𝑑𝑜𝑚, 𝒗 = 𝒏𝟏 + 𝒏𝟐 − 𝟐
Solution:
1. Hypotheses:
H0 : 𝝁 𝟏 − 𝝁 𝟐 = 𝟐
H1 : 𝝁 𝟏 − 𝝁 𝟐 > 𝟐
2. Level of Significance:
𝜶 = 𝟎. 𝟎𝟓
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
Looking t-Distribution Table at 𝛼 = 0.05 and with degree of
freedom, v =12 + 10 -2 = 20, we have
t > 1.725
𝑠1 2 (𝑛1 − 1) + 𝑠2 2 (𝑛2 − 1)
𝑤ℎ𝑒𝑟𝑒: 𝑠𝑝 2 =
𝑛1 + 𝑛2 − 2
42 (12 − 1) + 52 (10 − 1)
= = 20.05
12 + 10 − 2
𝑠𝑝 = 4.4777
(85 − 81) − 2
𝑡=
1 1
4.4777√12 + 10
𝒕 = 𝟏. 𝟎𝟒
5. Decision
Since t = 1.04 is NOT greater than 1.725, DO NOT reject H0.
We are unable to conclude that the abrasive wear of material 1
exceeds that of material 2 by more than 2 units.
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
Example 4: The following data represent the running times of films produced
by two motion-picture companies:
Company Time (minutes)
1 102 86 98 109 92
2 81 165 97 134 92 87 114
Test the hypothesis that the average running time of films produced
by company 2 exceeds the average running time of films produced
by company 1 by 10 minutes. Use a 0.1 level of significance and
assume the distributions of times to be approximately normal with
unequal variances.
Solution:
1. Hypotheses:
H0: 𝝁𝟐 − 𝝁𝟏 = 𝟏𝟎
H1: 𝝁𝟐 − 𝝁𝟏 > 𝟏𝟎
2. Level of Significance:
𝜶 = 𝟎. 𝟏
We have
t >1.415
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
4. Calculate the t-value and compare it with the critical value
(𝑥̅2 − 𝑥̅1 ) − 𝑑0
𝑡′ =
𝑠 2 𝑠 2
√ 2 + 1
𝑛 𝑛 2 1
(110 − 97.4) − 10
𝑡′ =
√913.3333 + 78.8
7 5
𝒕′ = 𝟎. 𝟐𝟏𝟓
5. Decision
Fail to reject H0.
Example 5: It is claimed that a new diet will reduce a person’s weight by 4.5
kilograms on average in a period of 2 weeks. The weights of 7
women who followed this diet were recorded before and after the
2-week period.
Woman Weight Weight
Before After
1 58.5 60.0
2 60.3 54.9
3 61.7 58.1
4 69.0 62.1
5 64.0 58.5
6 62.6 59.9
7 56.7 54.4
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
Use the t-distribution to test the hypothesis that the diet reduces a
woman’s weight by 4.5 kilograms on average against the
alternative hypothesis that the mean difference in weight is less
than 4.5 kilograms. Use 0.05 level of significance.
Solution:
1. Hypotheses:
H0: 𝝁𝟏 − 𝝁𝟐 = 𝟒. 𝟓 𝒌𝒈 𝒐𝒓 𝝁𝑫 = 𝟒. 𝟓 𝒌𝒈
H1: 𝝁𝟏 − 𝝁𝟐 < 𝟒. 𝟓 𝒌𝒈 𝒐𝒓 𝝁𝑫 < 𝟒. 𝟓 𝒌𝒈
2. Level of Significance:
𝜶 = 𝟎. 𝟎𝟓
3.5571 − 4.5
𝑡=
2.776
√7
𝒕 = −𝟎. 𝟖𝟗𝟗
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
5. Decision
Do not reject H0.
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.
Summative Graded Quiz
Property of and for the exclusive use of SLU. Reproduction, storing in a retrieval system, distributing, uploading or posting online, or transmitting in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise of any part of this document, without the prior written permission of SLU, is strictly prohibited.