Professional Documents
Culture Documents
Hypothesis Testing
Part 2
1
Eng Stat I 2104253
Define:
a = P(Type I error) = P(reject H0 when H0 is true)
b = P(Type II error) = P(do not reject H0 when H0 is false) 2
Eng Stat I 2104253
Type I error
a
m0
Ho
m1 3
Ho
Eng Stat I 2104253
−Z𝜶 ⋅ 𝝈/ 𝒏 + 𝝁𝟎 − 𝝁′
= P (𝐙 < )
𝝈/ 𝒏
𝝁𝟎 − 𝝁′
= P (𝐙 < −𝐙𝜶 + )
𝝈/ 𝒏 5
Eng Stat I 2104253
6
Eng Stat I 2104253
7
Eng Stat I 2104253
x − m0
= P Z < −(−𝟐. 𝟓𝟕𝟓) + 𝟐𝟏 − P Z < −𝟐. 𝟓𝟕𝟓 + 𝟐𝟏
z
𝟓𝟎 𝟓𝟎
Sample Size
One important thing in hypothesis testing is to
choose the appropriate sample size according to
▪ the cost
▪ the time consuming
▪ the accepted errors
✓ type I error
✓ type II error
10
Eng Stat I 2104253
follows: ( Za + Z b ) 2 2
n=
( m 0 − m ) 2
11
Eng Stat I 2104253
Sample Size
Determination
This formula for determining sample is used for the
Z test of hypotheses,
12
Eng Stat I 2104253
13
Eng Stat I 2104253
𝟔𝟖.𝟑−𝟔𝟖.𝟓 𝟔𝟖.𝟑−𝟔𝟖.𝟓
= P Z < −(−𝟐. 𝟓𝟕𝟓) + 𝟎.𝟖𝟑 − P Z < −𝟐. 𝟓𝟕𝟓 + 𝟎.𝟖𝟑
𝟏𝟓 𝟏𝟓
= 0.9495
16
Eng Stat I 2104253
(−𝟐.𝟓𝟕𝟓+(−𝟏.𝟐𝟖))2 (𝟎.𝟖𝟑)2
=
(𝟔𝟖.𝟑−𝟔𝟖.𝟓)2
= 256.3
Then, round up to 257.
17
Eng Stat I 2104253
Case III
• A normal population distribution/ is unknown
• When n is small (n < 30), the basic procedures are the
same as those used for large samples.
𝑥lj − 𝜇0
Test H0 : 𝜇 = 𝜇0 test statistic: 𝑡𝒐𝒃 =
𝑠/ 𝑛
Ha Rejection Region 𝑝 − value
Ha : 𝜇 > 𝜇0 𝑡𝒐𝒃 > 𝑡𝛼,𝑛−1 P (𝑡 > 𝑡𝒐𝒃 )
xi 115
x= = = 19.167
n 6
( x ) 2
115 2
x2 − 2477 −
s= n = 6 = 7.387
n −1 5
19
Eng Stat I 2104253
21
Eng Stat I 2104253
One-Sample T: Times
Test of mu = 15 vs > 15
95%
Lower
Variable N Mean StDev SE Mean Bound T P
Times 6 19.1667 7.3869 3.0157 13.0899 1.38 0.113
23
Eng Stat I 2104253
24
Eng Stat I 2104253
26
Eng Stat I 2104253
Then,
0.05 < P (𝑡 < −1.42) < 0.10
From the table, we can approximate that .05 < p-value < .10.
Since p-value is greater than a = .05, thus do not reject H0 .
27
Eng Stat I 2104253
Interpolation
Given this information, P (𝑡 < −1.383) =P (𝑡 > 1.383) = 0.10
P (𝑡 < −1.833) =P (𝑡 > 1.833) = 0.05
28
Eng Stat I 2104253
29
Eng Stat I 2104253
n=
( m 0 − m ) 2
30
Eng Stat I 2104253
Example 9: b Calculation
Referring to Example 7: Sprinkler system, what is the probability
that H0 is not rejected when 𝜇′ = 16, 𝜇0 = 15, = 7.387, n = 6,
and a = 0.05.
For upper tailed test
(𝜇0 − 𝜇′ )
𝛽 = P(𝑡 < 𝑡𝛼,𝑛−1 + )
𝑠/ n
(15 − 16)
= P(𝑡 < 𝑡.05,5 + )
7.387/ 6
= P(𝑡 < 1.68)
Note that from the t table, 0.05 < P(𝑡 > 1.68) < 0.10
(𝜇0 −𝜇′ )2
Right = 0.293
𝑠2
(𝜇0 − 𝜇′ )
𝑑=
𝑠 34
Eng Stat I 2104253
OC curve for
the one-sided t-test
OC-Curve _One Sided_t
a = 0.05
1
0.9
Prob. of accepting H0
0.8
n=3
0.7
n=4
0.6
n=5
0.5
0.4
0.3
0.2
0.1
0
0
3
0.
0.
0.
1.
1.
1.
2.
2.
2.
Difference
35
Eng Stat I 2104253
End of Part 2
36