Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 ·...

30
가설검정의 기본원리 Hypothesis Testing

Transcript of Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 ·...

Page 1: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

가설검정의 기본원리

Hypothesis Testing

Page 2: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

학습내용

가설검정의 기본개념

귀무가설과 대립가설

가설검정의 오류

임계치와 기각역

단측검정과 양측검정

가설의 검정방법

p value

류문찬 [email protected]

Page 3: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

가설이란 ?

실증적인 증명단계 이전의 잠정적인 가정이나 주장

모집단의 특성에 대한 주장(가정)

I believe the mean GPA

of this class is 4.0!

류문찬 [email protected]

Page 4: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

귀무가설과 대립가설

대립가설(연구가설) H1 Alternative Hypothesis(Research Hypothesis)

실험을 통해 입증하고자 하는 가설

채택되면 기존 질서(학설)의 변화를 초래하게 됨

등호가 없음 : ,, or

귀무가설(歸無假說) H0

Null Hypothesis

대립가설의 반대

확실한 증거가 없을 때 받아들여야 할 일반적 관념(default possibility)

검정은 귀무가설이 옳다는 가정으로부터 시작

등호가 있음 : , or

가설검정의 결론 “H0를 기각한다.” (Reject H0.) ; “H1은 통계적으로 유의하다(significant).”

“H0를 기각하지 않는다.” ; “H1은 통계적으로 유의하지 않다.”

류문찬 [email protected]

Page 5: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

가설검정의 오류

제1종 오류(Type I error)

H0가 옳은데도 불구하고 H0

를 기각하는 오류

‘용의자가 무죄인데 유죄로

선고’

제1종 오류의 확률 =

유의수준(significance level)

실제 상황 의사결정

H0 옳음 H0 틀림

(H1 옳음)

H0 채택 옳은 결정 제2종 오류

H0 기각 제1종 오류 옳은 결정

제2종 오류(Type II error)

H0가 틀린데도 불구하고

H0를 기각하지 않는 오류

‘용의자가 유죄인데 무죄로 선고’

제2종 오류의 확률 =

류문찬 [email protected]

Page 6: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

검정통계량과 임계치

검정통계량(test statistic) : 가설 검정에 쓰이는 통계량

임계치(critical value) : 귀무가설의 기각 여부를 구분하는 의사결정의 기준점

기각역

rejection region

임계치 검정통계량

류문찬 [email protected]

Page 7: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

단측검정과 양측검정

단측검정

one-tailed(sided) test

H1이 < 혹은 > 인 경우

기각역이 한쪽에만 존재

양측검정

two-tailed(sided) test

H1이 인 경우

기각역이 양쪽에 존재

기각

기각 기각

기각

류문찬 [email protected]

Page 8: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

바람직한 검정의 기준

, β

기각역을 넓히면, ↗ β↘

기각역을 좁히면, ↘ β↗

표본의 크기를 크게 하면 , β

가 감소

You can’t reduce both

errors simultaneously!

류문찬 [email protected]

Page 9: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

가설검정의 순서

① 귀무가설(H0)과 대립가설(H1)을 설정

② 유의수준() 결정

③ 유의수준을 만족하는 임계치 결정

④ 검정통계량과 임계치를 비교하여 결론

⑤ 결과의 해석

류문찬 [email protected]

Page 10: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

가설의 설정과 검정 오류

H1 : 새로운 청구시스템이 비용효과적이다. (H1 : μ > 170) Ho : 새로운 청구시스템이 더 나을 것 없다. (Ho : μ ≤ 170 ; μ = 170)

의사결정 오류에 따른 대가(비용)

• 제1종 오류 :

• 제2종 오류 :

류문찬 [email protected]

Page 11: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

검정통계량

Ho : μ = 170 H1 : μ > 170

Ho가 기각되기 위해서는 1. 검정통계량이 커야 하나, 작아야 하나? 2. 그리고 그 크기는 얼마나 되어야 하나?

x : 검정통계량

류문찬 [email protected]

Page 12: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

decison rule

기각

x

C

. if HReject :ruledecision 0 Cx

류문찬 [email protected]

Page 13: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

기각역 설정

)/

170(

)170;(

) trueis H when Hreject ( 00

n

CZP

CXP

P

nzC

170

) trueis H when Hreject ( 00P

.170 if HReject 0n

zx

류문찬 [email protected]

Reject H0

C 170

)./,170(~ 옳으면 가Ho 2 nNX

25.3400/65 x

Page 14: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

예제로 돌아와서...

34.175400

65)645.1(170

170

05.

nzC

178,400 xn

기각한다. 를H 이므로 178 0Cx

류문찬 [email protected]

Page 15: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

기각역 ...

류문찬 [email protected]

Ho : μ = μ0

H1 : μ > μ0

Ho : μ = 170 H1 : μ > 170

.170 if HReject 0n

zx

. if HReject 00n

zx

Page 16: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

검정통계량의 표준화

nzx

0

z

n

xz

/

0

0100 :H vs:H

기각역

.

645.1

46.2400/65

170178

/

0

05.

0

를기각한다이므로Hzz

zz

n

xz

예제 10.1

류문찬 [email protected]

Page 17: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

Solution Template

선택

H0:

H1:

test statistic :

= , n =

Critical Value(s):

계산

통계량 :

검정통계량 값:

p 값 :

Decision:

해석

류문찬 [email protected]

Page 18: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

Z값과 꼬리확률

류문찬 [email protected]

1.645

0.05

z

0 2.46

0.0069

Page 19: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

What if = .005 ?

선택

H0: 170

H1: >170

test statistic :

= 0.005 , n = 400

Critical Value(s):

계산

통계량 :

검정통계량 값:

p 값 :

Decision:

해석

575.2005. zz

2.575

0.005

z 0

46.2/

0

n

XZ

n

XZ

/

0

Do not reject H0 at = .005.

류문찬 [email protected]

Page 20: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

p-value

검정통계량의 z값

2.46

0.0069

z 0

p-value= P(Z > 2.46) = 0.0069

170 178

모평균이 170 이라면(귀무가설이 옳다면), 표본평균이 178보다 큰 값이 나올 가능성이 0.69%이다.

류문찬 [email protected]

Page 21: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

p-value의 정의

귀무가설이 옳다고 할 때, 검정통계량의 실제 값보다 더 극단적인(크거나 작은) 값이 관측될 확률

H0 를 기각할 수 있는 유의수준의 최소값

p-value <유의수준이면 H0를 기각하게 되므로

검정통계량의 관측치로 H0를 기각했을 경우 그 결정이 잘못될 확률

류문찬 [email protected]

Page 22: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

rejection decision

류문찬 [email protected]

If p-value , do not reject H0

If p-value < , reject H0

Page 23: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

Evaluating p-value

not significant significant

highly

significant

0 0.01 0.05

有意하다

확신도가 높아진다.

류문찬 [email protected]

Page 24: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

단측검정

z

n

xz

/ if HReject 0

0 ./

if HReject 00

z

n

xz

류문찬 [email protected]

Page 25: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

양측검정

2/0

0 |/

||| if HReject

z

n

xz

류문찬 [email protected]

Page 26: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

모평균의 가설검정( 알 때)

n

xz

/

0

. || if Hreject ;:HFor

. if Hreject ;:HFor

. if Hreject ;:HFor

2/001

001

001

zz

zz

zz

귀무가설 H0 : =0

검정통계량

류문찬 [email protected]

Page 27: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

Solution Template

H0:

H1:

=

n =

Critical Value(s):

Test Statistic:

Decision:

Conclusion:

z

류문찬 [email protected]

Page 28: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

p-value :양측검정

H1 : 0 일 때 |}|{*2 zZPvaluep

0 z

.5* p-value

류문찬 [email protected]

Z

Page 29: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

p-value :단측검정

H1 : < 0 일 때

z

p-value

0

}{ zZPvaluep

검정통계량의 관측치

류문찬 [email protected]

Z

Page 30: Hypothesis Testing - KOCWcontents.kocw.net/KOCW/document/2013/koreasejong/Ryu... · 2016-09-09 · Alternative Hypothesis(Research Hypothesis) 실험을 통해 입증하고자 하는

양측검정과 신뢰구간

nzx

nzx

zn

xzz

2/2/

2/0

2//

||

양측검정에서의

채택역 신뢰구간

1- /2 /2

Q1: μ 에 대한 신뢰구간? Q2: 양측검정에서 μ 에 대한 채택역?

류문찬 [email protected]

양측검정에서는 μ0가 신뢰구간에포함되지 않으면 H0 를 기각한다.