Transcript μ m > μ 0

http://cc.jlu.edu.cn/ms.html
Medical Statistics
6
Tao Yuchun
1
2014.3.18
Statistical inference
2. Hypothesis testing
( t test )
2
2014.3.18
2.1 The idea and steps of Hypothesis
testing
(1) The idea of Hypothesis testing
• See Example 6-1:
For most healthy male adults, their pulse is 72 times/min
averagely. A doctor randomly drew 25 healthy male adults
from a mountainous area, measured everyone’s pulse, got
sample mean and SD: mean=74.2 times/min, SD=6.0 times
/min.
• Question: Whether the population mean of
pulse for healthy male adults in this region is
different from 72times/min ?
3
2014.3.18
In this example,the population mean of pulse for the
healthy mountainous male adults denotes μm, for the
general denotes μ0。
μ0=72 times/min
X  74.2times / min
S  6.0times / min
μm= ?
n=25
General Pop.
Mountain Pop.
4
2014.3.18
The relation between μm and μ0 has only two
possibilities :
① μm=μ0
② μm≠μ0
μm>μ0
μm<μ0
For reasons :
① μm=μ0 (same)→ sampling error
② μm≠μ0 (not same)→ essential difference
5
2014.3.18
•Question: Which is the truth?
-- problem of hypothesis testing !
•Basic logic:
• First, set two hypotheses for two possibilities.
Null hypothesis :
H0: μm=μ0
Alternative hypothesis : H1: μm ≠μ0
• Second, How possible to occur the current
situation and even more unfavorable situation
to H0 under the null hypothesis ? Calculate a
probability (P-value).
6
2014.3.18
• Last, If it is less possible to occur the current
situation and even more unfavorable situation
to H0 , then reject H0 ; otherwise, not reject H0.
Given a small α , compare P and α , then draw
the conclusion. (α is called the level of a test)
(2) The steps of Hypothesis testing
I. Set hypotheses and the level of a test
•For Example 6-1:
H0: μm=μ0
H1: μm > μ0
One side,α= 0.05
7
2014.3.18
•Question: Why is one side for this exp. ?
What is a one side test or two sides test?
•one-sided test: For Alternative hypothesis H1,
only one probably exists from two possibilities.
For Exp. 6-1:
H1: μm > μ0
or
H1: μm < μ0
•two-sided test: For Alternative hypothesis H1,
any one probably exists from two possibilities.
For Exp. 6-1:
H1: μm ≠μ0
•You must choose it according to professional
knowledge before a test !
8
2014.3.18
•Question: Why did we choose this one
(μm > μ0 ) not another one (μm < μ0 ) from
two possibilities for this example ?
• According to medical professional knowledge,
anyone’s pulse in a mountainous area is not
possible less than it in general area. We may
eliminate one possibility (μm < μ0 ) from H1.
The final decision will be more certain, either
(μm > μ0 ) or (μm = μ0 ) !
• Be careful and considerate choosing one-sided
test ! It is safe and stable choosing two-sided
test anytime.
9
2014.3.18
• α is the level of a test, it is often chosen as the
standard of a small-probability event, is also the
probability for type I error (relate later)
• a small-probability event: indicates the probability
of an event that will happen to be very small, if this
kind of event appears, we think it will not occur !
Its standard often chooses P≤0.05 or P≤0.01.
• α is a limit to infer H0 to be rejected or not to be
rejected in hypothesis testing.
10
2014.3.18
II. Select an appropriate test and calculate
the test statistic
• According to the type of data, methods of
design, special suitable conditions, …etc, you
may select a proper test that has existed,
and calculate the value of the test statistic for
this test from sample data.
11
2014.3.18
•Question: Why must we choose a test
and calculate the test statistic ?
• Because it can give me the P-value for this
sample data !
•Question: What is the P-value ? Is it
really important ?
• I will explain it in next step.
• Yes, it is very important ! Because we can draw
a conclusion just by it.
12
2014.3.18
•We have known:
If X ~ N (  ,  ) , Then
2
X 
t
~ t ( )
S
n
  n 1
•For Example 6-1:
Pulse value ~ N (  m ,  m2 ) , then
X  m
t
~ t ( )
S
n
13
  n 1
2014.3.18
•When H0: μm=μ0 =72 times/min holds,
X  72
t
~ t ( )
S
n
  n 1
•Based on the current sample, you can get:
74.2  72
t
~ t (25  1)
6.0
25
t  1.833 ~ t (24)
•Question: Where is the P-value ?
• See next step.
14
2014.3.18
III. Determine P-value, and make decision
•P-value is the area of the tail(s) in the distribution
of the test statistic beyond the value(s) of the test
statistic calculated based on the sample. See figure
t ( )
below.
ν =24
H0:μm=μ0=72
P
t=1.833
15
2014.3.18
•For Example 6-1:
•When H0 holds, the probability of the current
situation (sample mean=72) and even more
unfavorable situation (sample mean>72) to H0
is the P-value.
•Question: How much is the P-value ?
• Two methods:
1. You can get exact the P-value by statistical
software;
2. You can contrast the P-value with a frame
of reference (i.e. the level of a test).
16
2014.3.18
• You will animatedly see how to get the P-value
for this example from a animation.
click me

•Question: How do I draw a conclusion
by the P-value ?
• If P ≤α,then reject H0 at significance level
α=0.05.
• If P >α,then not reject H0 at significance
level α=0.05.
•The P-value also indicates the probability of H0
holding.
17
2014.3.18
•Question: Why is H0 rejected if P ≤α ?
• Because the probability of H0 holding (i.e. Pvalue) is a small-probability event ! We may
think it will not occur, so we rejected H0.
Otherwise, we can’t reject H0 (accepted H0),
because the P-value has exceeded the limit of
frame of reference (i.e. the level of this test,
α=0.05).
• The conclusion of Hypothesis testing
bases on the size of the probability !
18
2014.3.18
•For Example 6-1:
•The conclusion is:
ν=24,Checked one side tα,ν= t0.05,24=1.711,
now t =1.833>1.711,then P<0.05,reject H0 at
significance levelα=0.05. We may consider the
population mean of pulse for the mountainous
healthy male adults to be higher than the
general’s.
19
2014.3.18
•The entire process of Hypothesis testing for Example
6-1 is:
H0: μm=μ0
H1: μm > μ0
One side,α= 0.05
X  m X  0 74.2  72
t


 1.833
SX
S n
6.0 25
ν=24,Checked one side tα,ν= t0.05,24=1.711,now
t =1.833>1.711,then P<0.05,reject H0 at significance
levelα=0.05. We may consider the population mean of
pulse for the mountainous healthy male adults to be higher
than the general’s.
20
2014.3.18
2.2 t tests
(1) Comparing to a given population
mean ( One-sample t test)
• Example 6-1 belongs to this kind of t test.
• Example 6-2: For most healthy male adults, their blood
sugar is 4.70mmol/L averagely. A researcher randomly
drew 26 healthy male adults from a manager population,
measured everyone’s blood sugar , got sample mean and
SD: mean= 4.84mmol/L, SD=0.85mmol/L. Please check
whether theμ of blood sugar for the managers is 4.70 ?
21
2014.3.18
H0: μ=μ0 = 4.70mmol/L
H1: μ≠μ0 = 4.70mmol/L
α= 0.05
X   X  0 4.84  4.70
t


 0.840
SX
S n
0.85 26
ν=25,Checked two sides tα,ν= t0.05,25=2.060,now
t =0.840<2.060,then P>0.05,no reason to reject H0
at significance levelα=0.05. We may consider the μ of
blood sugar for the managers to be same as the general’s.
22
2014.3.18
• You will animatedly see how to get the P-value
for this example from a animation.
click me

(http://en.wikipedia.org/wiki/Forbidden_City)
23
C
2014.3.18
H0: μm=μ0
t ( )
ν=24
α=0.05
P <0.05
α=0.05
P
One side: tα,ν= t0.05,24
μm=μ0
t=1.833
μm>μ0
Accepted area
24
1.711 Rejected area
2014.3.18
α=0.05
t ( )
H0: μ=μ0
ν=25
α=0.05
P
tα/2,ν= t0.05/2,25
t=-0.840
μ<μ0
Rejected area -2.060
t=0.840
μ=μ0
tα/2,ν= t0.05/2,25
μ>μ0
Accepted area 2.060
25
P >0.05
Rejected area
2014.3.18