๐ ์ผ๋ช '์ค์ฆ(Odds)'๋ผ๊ณ ํด์ ๋ก์ง์คํฑ ํ๊ท ๋ชจ๋ธ์ ๊ตฌํ๋ ์์ ์ฌ์ฉ๋๋ค๊ณ ์์ ๋ก์ง์คํฑ ํฌ์คํ ์์ ๋ฐฐ์ด ์ ์ด ์๋ค.
๐ '์ค์ฆ๋น'์ ๋ก๊ทธ๋ฅผ ์์ด '๋ก๊ทธ์ค์ฆ๋น' ๋ ๊ฐ์ง ๊ฐ๋ ์ ๋ํด์ ์์ธํ ์์๋ณด์ ๐ฆ
1> odds
ex) 'the odds in favor of my team winning the game are 1 to 4 ... ' → $\cfrac{1}{4}$
= 0.25 - ์ฆ ๋ด ํ์ด ๊ฒ์์ ์ด๊ธธ odds๋ 0.25์ด๋ค
๐ ์ฌ๊ธฐ์ ์ค์ํ ๊ฑด odds of p๋ probability of p ํ๋ฅ ์ด ์๋๋ผ๋ ์ ๐ซ
โซ odds๋ $\cfrac{p}{1-p}$๋ผ๋ฉด, probability๋ $\cfrac{p}{1}$์ด๋ค.
โซ (1-p)์ธ ํ๋ฅ ์ ๋ํ p์ธ ํ๋ฅ ์ odds๋ก ๋ํ๋ผ ์ ์๋ค. $\cfrac{P(p)}{P(1-p)}$ = $\cfrac{p}{1-p}$
2> log(odds)
๐ odds์ ๋ฒ์๋ฅผ ์ดํด๋ณด๋ฉด, ์ฐ๋ฆฌ๊ฐ ๊ด์ฌ์์ด ํ๋ ์ฑ๊ณตํ๋ฅ p์ ๋นํด ๋ฐ๋ ์คํจํ๋ฅ (1-p)๊ฐ ๋งค์ฐ ํด์๋ก odds๋ 0์ ๊ฐ๊น์์ง์ ํ์ธํ ์ ์๊ณ , ๊ทธ ๋ฐ๋๋ก ์ฑ๊ณตํ๋ฅ p๊ฐ ์คํจํ๋ฅ (1-p)์ ๋นํด ๋งค์ฐ ํด์๋ก 1์์ +$\infty$๊น์ง ๋ฒ์๊ฐ ๋ฌดํํจ์ ํ์ธํ ์ ์๋ค.
๐ 0์ ๊ธฐ์ค์ผ๋ก p>(1-p)์ด๋ฉด log(odds)๋ ์์๊ฐ, (1-p)>p์ด๋ฉด log(odds)๋ ์์๊ฐ์ด๋ค.
๐์ฌ๊ธฐ์ $log(\cfrac{p}{1-p})$๋ฅผ logit function์ด๋ผ๊ณ ํ๋ค. (๋ก์ง์คํฑ ํ๊ท์ basis)
๐ log๊ฐ์ ์ทจํ ์์น๋ 0์ ๊ธฐ์ค์ผ๋ก ๋์นญ์ธ, ๋ถํฌ๋ฅผ ์ด๋ฃฌ๋ค.
3> odds ratio
→ ์๋ ์๋ฅผ ์ด์ฉํด์ odds ratio๋ฅผ ์ฐ๋ ์ค์ํ ์์๋ฅผ ์ดํด๋ณด์
Has Cancer | Doesn't have Cancer | |
Has the mutated gene | 23 | 117 |
Doesn't have the mutated gene | 6 | 210 |
โ mutated gene์ ๊ฐ๊ณ ์๋ค๋ฉด, cancer๋ฅผ ๊ฐ์ง odds๋ $\cfrac{23}{117}$
โก mutated gene์ ๊ฐ๊ณ ์์ง ์๋ค๋ฉด, cancer๋ฅผ ๊ฐ์ง odds๋ $\cfrac{6}{210}$
→ odds ratio๋ฅผ ๋ฐ์ง๋ฉด $\cfrac{23/117}{6/210}$ = 6.88
→ ์ฆ mutated gene์ ๊ฐ๊ณ ์๋ ์ฌ๋์ด cancer๋ฅผ ๊ฐ์ง odds๋ 6.88๋ฐฐ ๋ ๋๋ค๋ ๊ฒ์ ์ ์ ์๋ค.
→ log(odds)๊ฐ์ 1.93
๐ ์ ์์์ ๋ณผ ์ ์๋ฏ์ด odds ratio๋ cancer ์ ๋ฌด์ mutated gene ์ฌ๋ถ ์์๊ฐ ์ํฅ์ ๋ผ์น๋ ์ง, ์ข์ predictor์ธ์ง ํ๋ณํ ์ ์๋ ์์น์ด๋ค. (R-squared ์ฒ๋ผ). odds ratio๊ฐ์ด ๋์์๋ก(๋๋ log(odds ratio)๊ฐ) cancer ์ ๋ฌด์ ๊ดํ good predictor๋ผ ํ ์ ์๋ค.
๐ ์ฌ๊ธฐ์ ์ฐ๋ฆฌ๋ ๊ณ์ฐ์ผ๋ก ์๊ฒ ๋ odds ratio๊ฐ ๋น์ฐํ statistically significantํ์ง test๋ฅผ ๊ฑฐ์ณ์ผ ํ๋ค
(fisher's exact test, chi-square test(p-value), the wald test(confidence interval) ์ธ test๋ฅผ ์ฃผ๋ก ์ฌ์ฉํ๋ค. ๋ฌด์์ด best ์ธ์ง๋ ์์)
โ chi-square test
→ ๋จผ์ cancer ์ฌ๋ถ์ mutated gene ์์๊ฐ ์ํฅ์ ๋ผ์น์ง ์๋๋ค๊ณ ๊ฐ์ ํ๋ค.
→ ๊ฐ ์นธ์ expected value ๊ตฌํ๊ธฐ
- mutated gene ์ฌ๋ถ์ ์๊ด์์ด ์ ์ฒด cancer๋ฅผ ๊ฐ๊ณ ์๋ ํ๋ฅ ์ $\cfrac{29}{356}$ = 0.08
- ์ฆ, mutated gene ์ฌ๋ถ์ ์๊ด์์ด ๊ตฌํ cancer ์ฌ๋ถ ํ๋ฅ ๋ก ๊ธฐ๋๊ฐ์ ๊ตฌํ ๊ฒ์ด๋ค.
expected values | Has Cancer | Doesn't have Cancer |
Has the mutated gene | 11.2 (=140*0.08) | 128.8 |
Doesn't have the mutated gene | 17.3(=216*0.08) | 198.7 |
→ expected values์ ์ค์ observed values ๋น๊ตํ๊ธฐ - p-value ๊ตฌํ๊ธฐ
โก the wald test
โป log(odds ratios)๊ฐ์ด ์ ๊ท๋ถํฌ๋ฅผ ๋ณด์ธ๋ค๋ ๊ฐ์ ๊ณผ ํจ๊ป ์ถ๋ฐํ๋ค.
→ 1000๊ฐ์ sample์ด ๋๋ log(odds ratio)๊ฐ๋ค์ด ๋ชจ์ธ ์ ๊ท๋ถํฌ
→ ์ํ size๋ 300์์ 400๊ฐ ์ฌ์ด
→ ๊ฐ ์ํ๋ง๋ค 0์์ 1์ฌ์ด์ ๋๋ค๊ฐ์ ์ ํ๊ณ , 0.08 ์ดํ์ ๊ฐ์ cancer๊ฐ ์๋ค๊ณ ๊ฐ์ฃผ
→ ๋ค์ 0์์ 1์ฌ์ด์ ๋๋ค๊ฐ์ ์ ํ๊ณ , 0.39 ์ดํ์ ๊ฐ์ mutated gene์ด ์๋ค๊ณ ๊ฐ์ฃผ
→ ๋๋คํ๊ฒ ๋ฝ๊ณ ๊ฐ์ฃผํ ๊ฒฐ๊ณผ๋ฅผ ๋ถ๋ฅํด ๊ฐ์๋ฅผ ์ธ๋ฉด ์๋์ ๊ฐ๋ค.
using random values | has cancer - yes | has cancer - no |
has the mutated gene - yes | 14 | 141 |
has the mutated gene - no | 15 | 222 |
→ ์ด๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ์ฝ 10,000๋ฒ ์ํํด histogram์ ๊ทธ๋ฆฌ๋ฉด ์ ๊ท๋ถํฌ ํํ๊ฐ ๋์จ๋ค. standard deviation ๊ฐ์ ์ฝ 0.43์ด ๋์ด
→ observed values์์ standard deviation ๊ฐ์ ๊ตฌํ๋ฉด 0.47
→ ์๋ก ๊ฐ์ด ๋งค์ฐ ๋น์ทํ๋ค
→ log(odds ratio)์์ standard deviation๊ฐ์ ๋๋๋ฉด 4.11 (์ฆ ๊ตฌํ log(odds ratio)๊ฐ์ ๋ถํฌ์ ํ๊ท ์ผ๋ก๋ถํฐ ์ฝ 4.11 ํ์คํธ์ฐจ ๋ฐฐ์๋งํผ ๋จ์ด์ก๋ค๋ ๋ป์ด๋ค.
(์ผ๋ฐ์ ์ผ๋ก 2๋ฐฐ์๋ณด๋ค ํฐ ๋ฐฐ์๋งํผ ๋จ์ด์ก๋ค๋ ๊ฑด p-value๊ฐ์ด 0.05๋ฏธ๋ง์ผ๋ก log(odds ratio)๊ฐ์ด statistically significantํ๋ค๊ณ ๊ฒฐ๋ก ์ ๋ด๋ฆด ์ ์๋ค.)
* ์ถ์ฒ1) STATQUEST - odds & log(odds) https://www.youtube.com/watch?v=ARfXDSkQf1Y
* ์ถ์ฒ2) STATQUEST - odds ratio & log(odds ratio) https://youtu.be/8nm0G-1uJzA
'Math & Linear Algebra > Concepts' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Linear Equation & Linear System / Rank & det(A) (0) | 2023.02.01 |
---|---|
Matrix (fundamentals) (0) | 2022.07.31 |
eigenvalue & eigenvector (0) | 2022.05.14 |
linear & non-linear โ span, basis, rank, projection (0) | 2022.05.13 |
Pearson & Spearman correlation coefficients (0) | 2022.05.13 |
๋๊ธ