9.4 t test and u test
DESCRIPTION
9.4 t test and u test. Hypothesis testing for population mean. Example : Hemoglobin of 280 healthy male adults in a region: Question: Whether the population mean in this region is 140.0 g/L?. - PowerPoint PPT PresentationTRANSCRIPT
9.4 t test and u test9.4 t test and u test
null hypothesis 零假设、原假设、解消假设
alternative hypothesis 对立假设、备择假设
significant difference 有意义的差别
significance level 有意义的水平、显著性水平
test statistic 检验统计量
p-value P-值
reject 拒绝
paired design 配对设计
pooled estimation 联合估计
type I error 第一类错误
type II error 第二类错误
Hypothesis testing for population meanHypothesis testing for population mean
Example :
Hemoglobin of 280 healthy male adults in a region:
Question: Whether the population mean in this
region is 140.0 g/L?
LgsLgx /0.6,/0.136
Two possibilities:Two possibilities:(1) The population is 140, the sample mean (1) The population is 140, the sample mean =136.0 is due to the sampling error=136.0 is due to the sampling error
(Null hypothesis)(Null hypothesis)(2) The population is not 140 at all so that the (2) The population is not 140 at all so that the sample mean =136.0sample mean =136.0 (Alternative hypothesis)(Alternative hypothesis)
Question: Which is the truth?Question: Which is the truth? -- problem of hypothesis test! -- problem of hypothesis test!
140:0 H
140:1 H
Basic logic:Basic logic:Under the null hypothesis
How possible to occur the current situation and
even more unfavorable situation to ?
-- Calculate a probability ( -value)
If it is less possible to occur the current situation
and even more unfavorable situation to ,
then reject ; otherwise, not reject .
-- Given a small , compare and
( is called the level of the test)
140:0 H
0H
0H0H
P
P
0H
Example 9-15: The content (mg/L) of within a material
was independently measured 15 times, resulting in:
20.99, 20.41, 20.62, 20.75, 20.10, 20.00, 20.80,
20.91, 22.60, 22.30, 20.99, 20.41, 20.50, 23.00, 22.60. Please check whether the true value was 20.7mg/L.
1. Comparing to a given population mean1. Comparing to a given population mean
CaCo3
98.0115
15
)98.316(98.6711
115
)(
1
)(
13.2115
98.316
2
22
2
n
xx
n
xxs
x
ii
i
(1) Set hypotheses and the level of test
To make decision: reject or accept ?
If reject , the probability of miss reject should not be greater than .
05.0
7.20:
7.20:
1
0
H
H
0H
0H
0H0H
(2) Select an appropriate test and calculate the test statistics
If X follows a normal distribution Then ),( 2N
ondistributit
n
S
Xt ~
When holds,
Based on the current sample:
ondistributit
n
S
Xt ~
7.20
70.1
15
98.07.2013.217.20
n
S
Xt
7.20:0 H
(3) Determine P value, and make decision
- 3 - 2 - 1 0 1 2 3
0 1.7 0 2.145
05.0
t
distribution
14
P value
表 9-9 t界值表 概率 P 概率 P
双侧: 0.10 0.05 0.02 0.01 双侧: 0.10 0.05 0.02 0.01 自由度 ν
单侧: 0.05 0.025 0.01 0.005
自由度 ν
单侧: 0.05 0.025 0.01 0.005 1 6.314 12.706 31.821 63.657 21 1.721 2.080 2.518 2.831 2 2.920 4.303 6.965 9.925 22 1.717 2.074 2.508 2.819 3 2.353 3.182 4.541 5.841 23 1.714 2.069 2.500 2.807 4 2.132 2.776 3.747 4.604 24 1.711 2.064 2.492 2.797 5 2.015 2.571 3.365 4.032 25 1.708 2.060 2.485 2.787 6 1.943 2.447 3.143 3.707 26 1.706 2.056 2.479 2.779 7 1.895 2.365 2.998 3.499 27 1.703 2.052 2.473 2.771 8 1.860 2.306 2.896 3.355 28 1.701 2.048 2.467 2.763 9 1.833 2.262 2.821 3.250 29 1.699 2.045 2.462 2.756
10 1.812 2.228 2.764 3.169 30 1.697 2.042 2.457 2.750 11 1.796 2.201 2.718 3.106 40 1.685 2.021 2.423 2.704 12 1.782 2.179 2.681 3.055 50 1.676 2.009 2.403 2.678 13 1.771 2.160 2.650 3.012 60 1.671 2.000 2.390 2.660 14 1.761 2.145 2.624 2.977 70 1.667 1.994 2.381 2.648 15 1.753 2.131 2.602 2.947 80 1.664 1.990 2.374 2.639 16 1.746 2.120 2.583 2.921 90 1.662 1.987 2.368 2.632 17 1.740 2.110 2.567 2.898 100 1.660 1.984 2.364 2.626 18 1.734 2.101 2.552 2.878 200 1.653 1.972 2.345 2.601 19 1.729 2.093 2.539 2.861 500 1.648 1.965 2.334 2.586 20 1.725 2.086 2.528 2.845 ∞ 1.645 1.960 2.326 2.576
When holds, the probability of the
current situation (sample mean=21.13) and
even more unfavorable situation (sample
mean>21.13) to is greater than 0.05.
The probability of the current situation and
even more unfavorable situation to is
called P value.
Now P > , no reason to reject .
0H
0H
0H
0H
2. Comparison for Paired Data 2. Comparison for Paired Data
Example 9-13 (A paired design)8 patients with hypertension were treated
with a medicine and the DBP was measured before and after the treatment. Data list in the table 9-10.
DBP variation before and after treatment No. Before After Difference
1 96 88 8
2 112 108 4
3 108 102 6
4 102 98 4
5 98 100 -2
6 100 96 4
7 106 102 4
8 100 92 8
Total 36
α=0.05
υ=8-1=7
t > t0.05,7=2.365, P < 0.05, is rejected at
significance level α=0.05.
0:0 dH 0:1 dH
02.48/16.3
50.4
/
0
ns
dt
d
0H
3. Comparison between 3. Comparison between
Two Sample MeansTwo Sample Means
Example9-18: Two group of rats were fed by different food. One contains high protein, another contains low protein. Comparing the effects of different food on increasing weight.
表 9-11 用两种不同蛋白质含量饲料喂养大鼠后体重增加的克数
高蛋白组 134 146 104 119 124 161 107 83 113 129 97 123
低蛋白组 70 118 101 85 107 132 94
α=0.05The pooled estimation of sample variance is
210 : H211 : H
891.105.10
101120
05.10)7
1
12
1(12.446)
11(
12.4462712
7/7077395912/1440177832
2
/)(/)(
2
)()(
21
1
21
21
2
222
21
222211
21
21
222
2112
XX
cXX
c
c
s
XXt
nnss
s
nn
nXXnXX
nn
XXXXs
x
υ=n1+n2-2=12+7-2=17
P>0.05, the null hypothesis is not rejected at the significance level α=0.05.
a. What does P-value mean?
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.
If the null hypothesis is rejected, the probability of mistake = P
-- A smaller P-value implies the better quality of your rejection.
If the null hypothesis is not rejected, the bigger P-value implies the better quality of your acceptation.
4. Attention for Hypothesis Test
b. What does the significance level α mean?
αshows the quality of the inference.
If you reject the null hypothesis, the probability of making mistake is limited by α
c. What is the situation that t-test could be applied?
The variable follows a normal distribution;
Sample size is small;
The variances are equal.
Thank You