Testing Hypothesis Testing Hypothesis: H H H X X H
Testing Hypothesis Testing Hypothesis: H H H X X H
Testing Hypothesis Testing Hypothesis: H H H X X H
α
α =reduced
0.0513 For fix n , we can only control one of the errors.
Convention : Control α .
1
Choice of H0 and H1 Choice of H0 and H1
Convention : Control α to be small. Criterion 2 : Put what you want to prove in H1.
Pr (false rejection of H0) = Pr (reject H0 | H0 true) = α Example : Want to show that Brand A is more popular than Brand B.
H0 : B is more popular than A.
Pr (false acceptance of H0) = Pr (accept H0 | H1 true) = β H1 : A is more popular than B.
2
Construction of Test Procedure Significance Probability
Example : life time of light bulbs with σ = 300 hours Example : life time of light bulbs with σ = 300 hours
H 0 : µ = 1200 vs H 1 : µ = 1240 H 0 : µ = 1200 vs H 1 : µ = 1240
Preset α = 0.05. Preset power = 0.9 , i.e. β = 0.1 n = 482 " Reject H 0 if X > 1222.48."
X = 1223 Reject H0 .
c − 1200
X − 1200 c − 1200
Pr = 1.>645 | µ = 1200 = 0.05
300 Stronger evidence X = 1237 Reject H0 .
300n n 300 n
n = 482 , c = 1222.48
c − 1240 Data strongly disagree with H0 .
X − 1240 − 1240
= −≤1.c282
Pr | µ = 1240 = 0.1
300 300n n 300 n Measure of agreement between data and H0
significance probability / p-value
1223)
p − value of (X = 1237 X > c ⇔ p − value < α
pp−−value
value==00..00342
0462
1237 1200
1223--1200 α
==11--ΦΦ ==00..00342
0462 Reject H0 if
300
300 482482 p-value
Reject H0
data fall < α region
in rejection
p-value
1200 1223
1237 c X
X − µ0 X − µ0
Test statistic Z= Test statistic Z=
σ n σ n
If Zobs <
>0,
p-value
p-value
= 2(1-Φ(Z
= 2Φ(Zobs
obs))) p-value Φ(Zobs
p-value==1-Φ(Z )
obs)
3
Large Sample, Known Variance Small Sample, Normal Population,
Example : package delivery time with known σ = 5 mins
Unknown Variance
H 0 : µ ≤ 28 vs H 1 : µ > 28 α = 0.05 Normal population σ2 unknown
Two Samples Problem (Small Samples) Two Samples Problem (Small Samples)
Example : 4 scores from class A : 64, 66, 89, 77
N (µ x ,σ x2 ) Sample with size m 3 scores from class B : 56, 71, 53
σ x2 = σ y2 Independent H 0 : µ x = µ y vs H 1 : µ x ≠ µ y α = 0.05
X −Y
H0 : µx ≤
= µ y vs H 1 : µ x <
≥ ≠ µy
> T= Reject H 0 at α = 0.05 if Tobs > t5, 0.025 = 2.5706 .
S pool 1 4 + 1 3
X −Y (3)(132.667 ) + (2 )(93) = 117
T= X = 74, S = 132.667, Y = 60, S y2 = 93
2 2
S pool =
Test statistic S pool 1 m + 1 n
x
3+ 2
74 − 60
Reject H
Reject H000 at
atsignifican
significan
significance levelαα ifif TTobs
ce level
level <>−t m+ n++−nn2−,2α,α2 .
obs > t mm
Tobs = = 1.695 < 2.5706 Do not reject H0 at α = 0.05.
obs
(117 )(1 4 + 1 3)
4
Two Samples Problem (Small Samples) Paired Data
Example : effect of stimulus on blood pressure
N (µ x ,σ x2 ) Sample with size m
Man 1 2 3 4 5 6 7 8 9 10 11 12
σ x2 ≠ σ y2 Independent Before (X) 120 124 130 118 140 128 140 135 126 130 126 127
After (Y) 128 131 131 127 132 125 141 137 118 132 129 135
N (µ y ,σ y2 ) Sample with size n D=Y-X 8 7 1 9 -8 -3 1 2 -8 2 3 8
H 0 : µ x = µ y vs H 1 : µ x ≠ µ y
Test H00 ::µµxD==µ0y vs
Test H vs HH11 ::µµxD≠≠µ0y at
at α
α== 0.05
0.05 ..
T=
X −Y (S 2
m+S 2
n)
2
v= x y
X and Y are dependent Two sample T-Test
S x2 m + S y2 n S x4 (m 2 (m − 1)) + S y4 (n 2 (n − 1))
0.7857 − 0.75
Z obs = = 1.3021 < Z 0.025 = 1.96
Φ(Zobs
p-value==1-Φ(Z
p-value ) (0.7857 )(0.2143) 224
obs)
5
Population Proportions Population Proportions
Independent binomial random variables Example : Graduation rate
ISP Non-ISP I 189
X ~ b(n1 ,π 1 ) Y ~ b(n2 ,π 2 ) π ISP = = 0.9545
Graduated 189 158 198
Not Graduated 9 52
Test H 00 : π 11 ≥
≤= ππ 22 vs H 11 : π 11 <
>≠ππ22 .. I
πN =
158
= 0.7524
Total 198 210 210
II I I I X I
ππ1 1−−ππ2 2 π1 = π2 =
Y
H 0 : π ISP ≤ π N vs H 1 : π ISP > π N α = 0.05
Z =Z = I I I I
π 1I1 − πI1 ) 1 π 2 (11 − π 2 )
( n1 n2
Test statistic
π (1 − π ) + + I X +Y I 189 + 158
n1 n1 n2n2 π= π= = 0.8505 Reject H0 at α = 0.05.
n1 + n2 198 + 210
0.95450.−9545− 0.7524
0.7524
levelαααififif ZZZobsobsobs><>Z−ZαZα2α. . Z obs = = 5.7216 >=Z60..050757
= 1.>645
Z 0.05 = 1.645
8505)()(00.0455 )(1 198 )(0).2476) 210
Reject
RejectHH000at
atsignifican
significance
ce
celevel
level
Reject H at
(0.9545 ) 198 + (0+.7524
obs
.1495 1 210