1 Power of the Test & Likelihood Ratio Test <Todayโs Topic> Power Calculation (Inference on one population mean) Likelihood Ratio Test (one population mean, normal population) You can watch this and other related โfunnyโ videos about statistics (power of the test etc.) at YouTube: https://www.youtube.com/watch?v=kMYxd6QeAss Truth 0 H a H Decision 0 H Type II error a H Type I error ฮฒ = P(Type II error) = P(Fail to reject 0 H | a H ) Power = 1- ฮฒ = P(Reject 0 H | a H )
19
Embed
Power of the Test & Likelihood Ratio Testzhu/ams570/Lecture18_570.pdftest at the significance level of 0.05? Solution: ๐ป0: = 0=525 ๐ป๐: = ๐=550> 0 Power = P(Reject H0 |Ha)
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Power of the Test & Likelihood Ratio Test
<Todayโs Topic>
Power Calculation (Inference on one population mean)
Likelihood Ratio Test (one population mean, normal
population)
You can watch this and other related โfunnyโ videos
about statistics (power of the test etc.) at YouTube:
https://www.youtube.com/watch?v=kMYxd6QeAss
Truth
0H aH
Decision 0H Type II error
aH Type I error
ฮฒ = P(Type II error) = P(Fail to reject 0H | aH )
Relationship between ฮฑ and ฮฒ (and of course, 1-ฮฒ) The following diagrams illustrate the relationship between the Type I error and the Type II error (and thus power of the test). You can see that for the given sample, ฮฑ and ฮฒ have a competitive relationship. When you decrease one, the other will increase.
Power Calculation (Inference on one population mean)
1.
)(:
:
00
00
aaH
H
1st scenario, Normal population, 2 is known.
Test statistic : )1,0(~0
00 N
n
XZ
H
At the significance level , we reject 0H if ZZ 0
3
Power of the test = 1-
= P(reject 0H | aH ) = P( )|0 aZZ
= )|( 0
aZn
XP
,
If a , )1,(~ 000
nN
n
XZ a
Therefore,
1- = )|( 0a
aa Znn
XP
= )|( 0a
a
nZZP
, )1,0(~ NZ
2nd scenario, Normal population, 2 is unknown.
Test statistic : 10
0 ~0
n
H
tnS
XT
At the significance level , we reject 0H if ,10 ntT
Power = 1- = P(reject 0H | aH ) = P( )|,10 antT
4
= )|( ,10
antnS
XP
= )|( ,10
anaa t
nSnS
XP
= )|( 0,1 a
an
nStTP
, Here 1~ ntT
Recall that the Shapiro-Wilk test: can be used to determine
whether the population is normal.
3rd scenario, Any population (*usually we use this test when the
population is found not normal), large sample (n30 )
Test statistic : )1,0(~0
00 N
nS
XZ
H
At the significance level , we reject 0H if ZZ 0
Power = 1- = P(reject 0H | aH ) = P( )|0 aZZ
5
= )|( 0
aZnS
XP
= )|( 0a
aa ZnSnS
XP
= )|( 0a
a
nSZZP
, )1,0(~ NZ
2.
)(:
:
00
00
aaH
H
1st scenario, Normal population, 2 is known.
Test statistic : )1,0(~0
00 N
n
XZ
H
At the significance level , we reject 0H if ZZ 0
Power = P(reject 0H | aH ) = P( )|0 aZZ
6
= )|( 0aZ
n
XP
=
)|( 0a
aa Znn
XP
= )|( 0a
a Zn
ZP
, )1,0(~ NZ
The derivation of the remaining two scenarios is very similar
to that of the first pair of hypotheses too and is thus omitted.
3.
0
00
:
:
aaH
H
1st scenario, Normal population, 2 is known.
Test statistic : )1,0(~0
00 N
n
XZ
H
At the significance level , we reject 0H if 20 ZZ
Power = P(reject 0H | aH ) = P( )|( 20 aZZ
7
= )|()|( 2020 aa ZZPZZP
=
)|()|( 20
20
aaa
aaa Z
nn
XPZ
nn
XP
=
)|()|( 02
02 a
aa
a
nZZP
nZZP
(*Without loss of generality, for the plot below, we assume
0 a )
The derivation of the remaining two scenarios is very similar
to that of the first pair of hypotheses too and is thus omitted.
8
Ex1) Jerry is planning to purchase a sports goods store. He
calculated that in order to make profit, the average daily sales must
be 525$ . He randomly sampled 36 days and found 565$X
and 50$S
If the true average daily sales is $550, what is the power of Jerryโs
test at the significance level of 0.05?
Solution:
๐ป0: ๐ = ๐0 = 525
๐ป๐: ๐ = ๐๐ = 550 > ๐0
Power = P(Reject aHH |0 )
9123.02
9131.09115.0
)355.1()3650
525550645.1(
)|(
)|(
)|(
0
0
0
ZPZP
nSZ
nS
XP
ZnS
XP
ZZP
aaa
a
a
Ex2) John Pauzke, president of Cerealโs Unlimited Inc, wants to
be very certain that the mean weight of packages satisfies the
package label weight of 16 ounces. The packages are filled by a
machine that is set to fill each package to a specified weight.
However, the machine has random variability measured by 2 .
John would like to have strong evidence that the mean package
weight is about 16 oz. George Williams, quality control manager,
advises him to examine a random sample of 25 packages of cereal.
From his past experience, George knew that the weight of the
9
packages follows a normal distribution with standard deviation 0.4
oz. At the significance level 05.0 ,
(a) What is the decision rule (rejection region) in terms of the
sample mean X ?
(b) What is the power of the test when 13.16 oz?
Sol) Let X denote the weight of a randomly selected package of
cereal, then )4.0,16(~ NX
16:
16:0
aH
H
16:
16:0
aH
H
(a) Test Statistic : )1,0(~0
00 N
n
XZ
H
if 160
ZcHcZP )|( 00
We reject 0H at 05.0 if
)(1316.16
25
4.0645.1160
00
oz
nZXZ
n
XZ
(b)
0
00
13.16:
16:
aaH
H
(n=25)
Power = P(Reject aHH |0 )
49.0)02.0()254.0
1613.16645.1(
)|(
)|(
)|(
0
0
0
ZPZP
nZ
n
XP
Zn
XP
ZZP
aaa
a
a
10
Sample size determination in the hypothesis
test scenario
1.
)(:
:
00
00
aaH
H
1st scenario, Normal population, 2 is known.
1 = )|( 0a
a Zn
ZP
, )1,0(~ NZ
Z
nZ
nZ aa
00
a
ZZn
0
)(
2
0
22
)(
)(
a
ZZn
2.
)(:
:
00
00
aaH
H
11
1st scenario, Normal population, 2 is known.
2
0
22
)(
)(
a
ZZn
(*the same result as in Scenario 1 โ in
summary, the formula is identical for the one-sided tests.)
3.
0
00
:
:
aaH
H
1st scenario, Normal population, 2 is known.
1 =
)|()|( 02
02 a
aa
a
nZZP
nZZP
(Assume 0 a . Then, 0)|( 02
a
a
nZZP
.
So, we can neglect it.)
12
ZZn
nZZ
nZZP
a
a
aa
2
0
0
2
0
2 )|(1
2
0
22
2
)(
)(
a
ZZn (* in summary, this hand-calculated formula
for the two sided test differs from that for the one-sided tests in
two aspects:
(1) ฮฑ is replaced by ฮฑ/2;
(2) it is an approximate formula, not an exact formula.)
13
Likelihood Ratio Test (one population mean, normal population, two-sided)
1. Please derive the likelihood ratio test for H0: ฮผ = ฮผ0 versus Ha: ฮผ โ ฮผ0, when the population is normal and population variance ฯ2 is known. Solution: For a 2-sided test of H0: ฮผ = ฮผ0 versus Ha: ฮผ โ ฮผ0, when the population is normal and population variance ฯ2 is known, we have:
0: and :
The likelihoods are:
n
i i
n
in
ix
x
LL
1
2
02
2
22
2
0
1 2
0
2
1exp
2
1
2exp
2
1
There is no free parameter in L , thus LL ห .
n
i i
n
in
ix
x
LL
1
2
2
2
22
2
1 2 2
1exp
2
1
2exp
2
1
There is only one free parameter ฮผ in L . Now we shall find
the value of ฮผ that maximizes the log likelihood
n
i ixn
L1
2
2
2
2
12ln
2ln
.
By solving
n
i ixd
Ld12
01ln
, we have xฬ
It is easy to verify that xฬ indeed maximizes the
loglikelihood, and thus the likelihood function. Therefore the likelihood ratio is:
14
2
0
2
0
1
22
02
1
2
2
2
2
1
2
02
2
20
0
2
1exp
/2
1exp
2
1exp
2
1exp
2
1
2
1exp
2
1
ห
maxห
ห
zn
x
xxx
xx
x
L
L
L
L
L
L
n
i ii
n
i i
n
n
i i
n
Therefore, the likelihood ratio test that will reject H0 when
* is equivalent to the z-test that will reject H0 when
cZ 0 , where c can be determined by the significance level ฮฑ
as / 2c z .
You see that from the beauty contest example that to set which theory as the null hypothesis may not always follow the same rule. That is why for the normality test, we put the hypothesis that โthe population from which the sample was drawn is a normal populationโ as the null hypothesis. Similarly, in the beauty contest problem, it is easier to interpret when we set the null hypothesis as โStony Brook is the most beautiful Universityโ, versus the alternative that we are not.
15
2. Please derive the likelihood ratio test for H0: ฮผ = ฮผ0 versus Ha: ฮผ โ ฮผ0, when the population is normal and population variance ฯ2 is unknown. Solution: For a 2-sided test of H0: ฮผ = ฮผ0 versus Ha: ฮผ โ ฮผ0, when the population is normal and population variance ฯ2 is unknown, we have:
2 2
0, : ,0 and
2 2, : ,0
The likelihood under the null hypothesis is:
n
i i
n
in
ix
x
LL
1
2
02
2
22
2
0
1 2
2
0
2
1exp
2
1
2exp
2
1
,
There is one free parameter, ฯ2, in L . Now we shall find the
value of ฯ2 that maximizes the log likelihood
22
02 1
1ln ln 2
2 2
n
ii
nL x
. By solving
2
02 2 4 1
ln 10
2 2
n
ii
d L nx
d
, we have
22
01
1ห
n
iix
n
It is easy to verify that this solution indeed maximizes the loglikelihood, and thus the likelihood function. The likelihood under the alternative hypothesis is:
n
i i
n
in
ix
x
LL
1
2
2
2
22
2
1 2
2
2
1exp
2
1
2exp
2
1
,
There are two free parameter ฮผ and ฯ2 in L . Now we shall
find the value of ฮผ and ฯ2 that maximizes the log likelihood
n
i ixn
L1
2
2
2
2
12ln
2ln
.
By solving the equation system:
2 1
ln 10
n
ii
Lx
and
2
2 2 4 1
ln 10
2 2
n
ii
L nx
16
we have xฬ and 22
1
1ห
n
iix x
n
It is easy to verify that this solution indeed maximizes the loglikelihood, and thus the likelihood function. Therefore the likelihood ratio is:
2
2
2
22 2
00 0 1
2 2
2,
2
1
2 2 22 2
0 0 01 1
2 2
1 1
exp2ห 2max , ,ห
ห ห หmax , ,
exp22
1
n
n
ii
n
n
ii
n nn n
i ii i
n n
i ii i
n n
xL LL
L LLn n
x x
x x x n x n x
x x x x
2 2
2
1
2 2
01
1
n
n
ii
n
x x
t
n
Therefore, the likelihood ratio test that will reject H0 when
* is equivalent to the t-test that will reject H0 when 0t c ,
where c can be determined by the significance level ฮฑ as
1, / 2nc t .
17
Likelihood Ratio Test (one population mean, normal population, one-sided)
1. Let ๐(๐ฅ๐|๐) =1
โ2๐๐2๐โ(๐ฅ๐โ๐)
2
2๐2 , ๐๐๐ ๐ = 1,โฏ , ๐, where ๐2 is
known. Derive the likelihood ratio test for the hypothesis