Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Testing Hypothesis Testing Hypothesis: H H H X X H

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Testing Hypothesis Testing Hypothesis

Test Procedure (based on sample) leads to rejection


Statistical Hypothesis A statement about population
or non-rejection of the hypothesis
Null hypothesis : H0 Alternative hypothesis : H1
Example : Test H 0 : µ = 1 vs H 1 : µ ≠ 1.
H 0 : µ = 0 H 0 :σ 2 = 1
  " Reject H 0 if X > 2 or X < 0." is a reasonable test.
H 1 : µ ≠ 0  H1 : σ ≠ 1
2

 H 0 : σ x2 = σ y2  H 0 : π 1 = 2π 2 Draw a sample X = 2.3 Reject H0 .


 
 H 1 : σ x ≠ σ y  H 1 : π 1 ≠ 2π 2
2 2
Conclude that µ ≠ 1 .

 H 0 : Population is a normal distribution.


 But we may be wrong !
 H 1 : Population is not a normal distributi on.

Two Types of Errors Two Types of Errors


H0 True H1 True
Example : life time of light bulbs with σ = 300 hours
H0
Do not reject H0 Correct Type II error H 0 : µ = 1200 vs H 1 : µ = 1240
 300 2 
Reject
H1 H0 Type I error Correct Draw a sample with size 100. X ~ N  µ , 
 100 

α = Pr (Type I error ) = Pr (Reject H 0 | H 0 true )


H0
Test " Reject H 0 if X > 1249."

β = Pr (Type II error ) = Pr (Do not reject H 0 | H 1 true )  1249 − 1200 


α = Pr (Reject true )) =
H 0 ||µH=0 1200
X > 1249 =10−.0513Φ(1.633) 

 300 100 
 1249 − 1240 
H0 β = Pr (Do
X ≤not
1249 | µ =H1240
reject ) =true
0 | H1 = 0.()6179
Φ 0.3) 

 300 100 

Two Types of Errors Choice of H0 and H1


Sampling distribution of X αα α βββ β

α
α =reduced
0.0513 For fix n , we can only control one of the errors.
Convention : Control α .

Criterion 1 : Make Type I error a more serious error.

Example : Want to know if a man is guilty.


1200 1240 Type
Type II error
error Type
Type IIII error
error
H 0 : He is not guilty.
guilty.
ββ increased
= 0.6179 H0 H1 Release
Jail an innocence.
a criminal. Release
Jail an innocence.
a criminal.
1249
H 1 : He is guilty.
not guilty.
More serious error

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.

May be large If reject H0 Data shows strong evidence to against H0 ,


Reject H0 Strong conclusion i.e., high confidence that H1 is true.
Do notAccept
reject H0 Weak conclusion
If do not reject H0 Not enough evidence to against H0 ,
but may not have high confidence on H0.
Criterion 2 : Put what you want to prove in H1.

Choice of H0 and H1 Construction of Test Procedure


Example : Clinical trials on drug design. Example : life time of light bulbs with σ = 300 hours
Standard medicine : cure rate π0 = 0.6 H 0 : µ = 1200 vs H 1 : µ = 1240 Preset α = 0.05.
New medicine : believe that cure rate π > 0.6
 300 2 
Draw a sample with size 100. X ~ N  µ , 
H 0 : π ≤ 0.6 (new medicine is not better)  100 

H 1 : π > 0.6 (new medicine is better)


" Reject
Reject H 0Hif 0Xifis too > c ."."
X large
Reasonable test
 c − 1200  c − 1200
0.05 = α = 1Pr−(Φ  )
Type I error (switch to worse medicine) more serious
Criterion 1 : Type II error (abandon better medicine) X > c | H
Reject µ 0=| 1200 truec)= 1249.=
H 0 ⇒ 35Z 0.05 = 1.645
 300 100  30

Criterion 2 : What we want to prove is H1.


" Reject H 0 if X > 1249 .35 ." Constructed before observing data.

Construction of Test Procedure Construction of Test Procedure


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 Preset α = 0.05. H 0 : µ = 1200 vs H 1 : µ = 1240 Preset α = 0.05.


 300 2 
 300 
2
Draw a sample with size 400. X ~ N  µ , 
Draw a sample with size 100. X ~ N  µ ,   400 
 100 
" Reject H 0 if X > c."
" Reject H 0 if X > 1249 .35 ."
 c − 1200  c − 1200
 1249.35 − 1240  0.05 = α = 1Pr−(Φ
X > c | H
Reject H 0 ⇒
µ 0=| 1200
⇒ ) c) =151224.=675Z 0.05 = 1.645
true
Pr((Do
ββ ==Φ
Pr X ≤not reject
1249 =| H1240
.35 |Hµ0 = Φ ) ))
01(.06225
true
.312  300 400 
 300 100 
 1224.675 − 1240 
Pr (Reject H 0 | H 1 true ) = 1 − β = 0.3775 Pr(Do −)1).022)
(.1534
 =1240
Power of the test. ββ == Φ
Pr X ≤not .675H| µ
reject
1224 =HΦ
0 |= 10true Power = 0.8466
 300 400 

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

Significance Probability Significance Probability


compare
significance probability of an observation p-value α
smallest α for which it leads to the rejection of H0
compute compute
Example : life time of light bulbs with σ = 300 hours
data critical value
H 0 : µ = 1200 vs H 1 : µ = 1240 n = 482 compare

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

Large Sample, Known Variance Large Sample, Known Variance


H 0 : µ = µ 0 vs H 1 : µ ≠ µ 0 σ2 known H0 : µ ≥
≤ µ 0 vs H 1 : µ <> µ 0 σ2 known

X − µ0 X − µ0
Test statistic Z= Test statistic Z=
σ n σ n

Reject H 0 at significance level α if Z obs > Z α 2 . Reject


RejectHH00 at
atsignifican
significance level αα ifif ZZobsobs <>−ZZαα. .
ce level

If Zobs <
>0,

p-value
p-value
= 2(1-Φ(Z
= 2Φ(Zobs
obs))) p-value Φ(Zobs
p-value==1-Φ(Z )
obs)

Zobs 0 Zobs Zobs 0 Zobs

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

Sample with n = 100 X = 31.5 , S 2 = 28.9 H0 : µ ≥


≤ µ 0 vs H 1 : µ <
= > µ0

X − 28
Test statistic Z= X − µ0
5 100 Test statistic T=
S n
Reject H 0 at significance level α = 0.05 if Z obs > Z 0.05 = 1.645 .
Reject
Reject H
H000at
H atsignifican
at significan levelαααififif TTT
level
significancecelevel ><>t−nt−tn1n,−α−1,1α2,α. .
31.5 − 28 obs
obs
obs
Z obs = = 7 > 1.645 Reject H0 at α = 0.05.
5 100
p − value = 1 − Φ(7 ) ≈ 0

Small Sample, Unknown Variance Two Samples Problem (Large Samples)


Example : package delivery time X ~ N (µ ,σ 2
)
µ x ,σ x2 Sample with size m
H 0 : µ ≤ 28 vs H 1 : µ > 28 α = 0.05
Independent
Sample with n = 10 X = 32.3 , S 2 = 46.3 µ y ,σ 2
y Sample with size n
X − 28
Test statistic T=
S 10 H0 : µx ≤
= µ y vs H 1 : µ x <
≥ ≠ µy
>
Reject H 0 at significance level α = 0.05 if Tobs > t9,0.05 = 1.833 .
X −Y
Test statistic Z=
32.3 − 28 σS x2x2 m + σ
S y2y2 nn
Tobs = = 1.998 > 1.833 Reject H0 at α = 0.05.
46.3 10
Reject H
H00 at
at significan
significance
significan levelα
ce level
level ααififif ZZobsobs<>>−ZZα α2 .
p − value = Pr (t9 > 1.998) = 0.0384

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

N (µ y ,σ y2 ) Sample with size n


Assumptions :
(i) Normal populations. (ii) Independent samples. (iii) Equal variances.

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))

Reject H 0 at significance level α if Tobs > tv ,α 2 . D =Y − X µ D = E (D ) = µ y − µ x

Paired Data Population Proportion


Example : effect of stimulus on blood pressure
H 0 : π = π 0 vs H 1 : π ≠ π 0
Man 1 2 3 4 5 6 7 8 9 10 11 12

D=Y-X 8 7 1 9 -8 -3 1 2 -8 2 3 8 π −π0  X
Test statistic Z=   π=
π (1 − π ) n n
Test H0 : µD = 0 vs H1 : µD ≠ 0 at α = 0.05.
Reject H 0 at significance level α if Z obs > Z α 2 .
D −0
Test statistic T= Reject H 0 if Tobs > t11, 0.025 = 1.796
SD 12
If Zobs <
>0,
1.833
D = 1.833, S D = 5.83 Tobs = = 1.09 < 1.796
5.83 12 p-value
p-value
= 2(1-Φ(Z
= 2Φ(Zobs
obs)))
Do not reject H0 at α = 0.05.
S5D.83
95% C.I. for µD = µy - µx : 1.D ± t±111,0..796
833 025 = 1.833 ± 3.023 Zobs 0 Zobs
1212

Population Proportion Population Proportion


H0 :π ≥
≤ π 0 vs H 1 : π <
>π0 Example : Crosses of peas π = Pr(Yellow pea)
 Experiment : 176 Yellow, 48 Green
π −π0  X
Test statistic Z=   π=
π (1 − π ) n n H 0 : π = 0.75 vs H 1 : π ≠ 0.75 α = 0.05
level αα ifif ZZobsobs <>−ZZαα. . 
Reject
Reject H
H00 at
atsignifican
significance
ce level π − 0.75  176
Test statistic Z=   π= = 0.7857
π (1 − π ) 224 224

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)

Do not reject H0 at α = 0.05.


Zobs 0 Zobs p − value = 2(1 − Φ(1.0321)) = 0.1928

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 n2n2 π= π= = 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

You might also like