Professional Documents
Culture Documents
5.convergence Informatics Week5
5.convergence Informatics Week5
5.convergence Informatics Week5
Convergence
Informatics
Chapter 9 (Week 5)
Statistical hypothesis testing
Asst. Prof. Minseok Seo
mins@korea.ac.kr
Contents
1. Hypothesis testing
Main idea
Two types of Hypothesis
Two types of Errors
Confusion Matrix
Standard Error
Test statistic (Z statistic)
P-value
Significance Level
Power & Sample size
Hypothesis testing
Statistical test 01
Hypothesis testing (Remind)
Basic concept of hypothesis testing
• Difference
• Equivalency
• Null hypothesis
• Alternative hypothesis
What is P-value?
The reason is that you only have to find one counter example.
The reason is that you only have to find one counter example.
• Assuming that men and women are the same height, let's
examine the men's and women's heights, respectively, to find
the mean and variance.
𝑇𝑇𝑇𝑇
= = 1 - FPR
𝑇𝑇𝑇𝑇+𝐹𝐹𝐹𝐹
𝑇𝑇𝑇𝑇
= = 1 - FPR
𝑇𝑇𝑇𝑇+𝐹𝐹𝐹𝐹
𝑇𝑇𝑇𝑇
= = 1 - FDR
𝑇𝑇𝑇𝑇+𝐹𝐹𝐹𝐹
𝑇𝑇𝑇𝑇
= = 1 - FOR
𝑇𝑇𝑇𝑇+𝐹𝐹𝐹𝐹
𝐹𝐹𝐹𝐹
= = 1 - TPR
𝐹𝐹𝐹𝐹+𝑇𝑇𝑇𝑇
𝐹𝐹𝐹𝐹
= = 1 - TNR
𝐹𝐹𝐹𝐹+𝑇𝑇𝑇𝑇
𝐹𝐹𝐹𝐹
= = 1 - PPV
𝐹𝐹𝐹𝐹+𝑇𝑇𝑇𝑇
ACC (Accuracy)
𝑇𝑇𝑇𝑇+𝑇𝑇𝑇𝑇
=
𝑇𝑇𝑇𝑇+𝑇𝑇𝑇𝑇+𝐹𝐹𝐹𝐹+𝐹𝐹𝐹𝐹
𝐹𝐹𝐹𝐹+𝐹𝐹𝐹𝐹
= = 1 - ACC
𝑇𝑇𝑇𝑇+𝑇𝑇𝑇𝑇+𝐹𝐹𝐹𝐹+𝐹𝐹𝐹𝐹
The problem: In the 1970s, 20–29 year old men in the U.S.
had a mean μ body weight of 170 pounds. Standard deviation
σ was 40 pounds. We test whether mean body weight in the
population now differs.
x ~ N (µ , SE x )
σ
where SE x =
n
x ~ N (µ , SE x )
σ
where SE x =
n
copyrightⓒ 2018 All rights reserved by Korea University 20
Illustrative example
Z-statistic (Test statistic)
x − µ0
z stat =
SE x
where µ 0 ≡ population mean assuming H 0 is true
σ
and SE x =
n
x − µ0
z stat =
SE x
where µ 0 ≡ population mean assuming H 0 is true
σ
and SE x =
n
σ 40
SE x = = =5
n 64
If we found a sample mean of 173, then
x − µ 0 173 − 170
zstat = = = 0.60
SE x 5
x − µ 0 185 − 170
zstat = = = 3.00
SE x 5
Conventions*
P > 0.10 ⇒ non-significant evidence against H0
0.05 < P ≤ 0.10 ⇒ marginally significant evidence
0.01 < P ≤ 0.05 ⇒ significant evidence against H0
P ≤ 0.01 ⇒ highly significant evidence against H0
Examples
P =.27 ⇒ non-significant evidence against H0
P =.01 ⇒ highly significant evidence against H0
Reject H0 when P ≤ α
A. Hypothesis statements
H0: µ = µ0 vs.
Ha: µ ≠ µ0 (two-sided) or
Ha: µ < µ0 (left-sided) or
Ha: µ > µ0 (right-sided)
B. Test statistic
Data ⇒ {116, 128, 125, 119, 89, 99, 105, 116, 118}
A. Hypotheses:
H0: µ = 100 versus
Ha: µ > 100 (one-sided)
Ha: µ ≠ 100 (two-sided)
B. Test statistic:
σ 15
SE x = = =5
n 9
x − µ 0 112.8 − 100
zstat = = = 2.56
SE x 5
Ha: µ ≠100
Thus, two-sided P
= 2 × 0.0052
= 0.0104
Truth
Decision H0 true H0 false
Retain H0 Correct retention Type II error
Reject H0 Type I error Correct rejection
| µ0 − µ a | n
1 − β = Φ − z1− α +
σ
2
,where
| µ − µ | n
1 − β = Φ − z1− α + 0 a
σ
2
| 170 − 190 | 16
= Φ − 1.96 +
40
= Φ (0.04 )
= 0.5160
copyrightⓒ 2018 All rights reserved by Korea University 37
Calculation of Effective Sample size
Example to calculate effective sample size in Z test
n=
2
(
σ z1− β + z1− α
2
)
2
∆
2
, where
1 – β ≡ desired power
α ≡ desired significance level (two-sided)
σ ≡ population standard deviation
Δ = μ0 – μa ≡ the difference worth detecting
n=
(
σ 2 z1− β + z1− α
2
)
2
=
40 2 (1.28 + 1.96) 2
= 41.99
∆ 2
− 20 2