# 生統第七章 假設檢定-統計推論 ###### tags: `生統` ## P值(顯著水準/significant level) * 將樣品均值標準化,得到Zscore,再查表可以知道==機率大小== * P值通常以==α==表示 * 通常選定α===0.05==,但是也可以選0.01 or 0.10 * 當p值=α<0.05時,表示樣品出現的機會,在==100==次中少於==5==次,因此推論==樣品並非來自某族群== * P值,換句話說表示==結論判斷<font color="dd0000">錯誤</font>的機率== * <font color="660066">P值越小,拒絕null hypothesis的可信度越高</font> >P值的分配有兩個可能性 >1.常態分佈的==單尾== >只有一個<font color="dd0000">拒絕區</font>。 >拒絕區在左邊=左尾檢定:拒絕區在右邊=右尾檢定 >個拒絕區的機率=$\alpha$ >2.常態分佈的==雙尾== >有兩個拒絕區=雙邊檢定 >雙尾各個拒絕區的機率=$\frac{\alpha}{2}$ <img src="https://i.imgur.com/wHM5lRk.jpg" width=75% height=75%> <img src="https://i.imgur.com/uUz5CFn.jpg" width=100% height=100%> ## 假設檢定程序(必考) 1. 虛無假設(null hypothesis) >對族群母數值的某一假設,通常定義這個假設is true, >通常以==H~0~== 表示 2. 對立假設(alternative hypothesis) >對族群母數值提出與虛無假設==相反==的假設, >通常以==H~1~== 表示 3. 設定P值(significant level) >α=0.05 or 0.01 4. 計算==樣品均值== 的==標準化值== Z score > Z=(𝑥-u~0~)/(𝜎/√𝑛) >若|Z|<Z~1-α~,則接受H~0~的假設 >相反地, >若|Z|≥Z~1-α~,則接受H~1~的假設 ```mermaid graph LR A[set null hypothesis]-->B(set alternative hypothesis) B -->C{Z score} C -->|lZl小於 Z1-α| D[Accept null hypothesis] C -->|lZl大於等於Z1-α| E[Accept alternative hypothesis] ``` ### 設定虛無假設、對立假設的原則 #### Principle 1 * R.A. Fisher原則 * 把==希望得到的結果==當作==alternative hypothesis== * 則將完全相反的結果當作null hypothesis * [理由] 要證明一個敘述為true不容易,但是讓一個敘述false只需要==一個反例== * [研究員期望]落入<font color="dd0000">拒絕區</font> * [我的思路]通常檢定樣本=族群母值,如果希望的結果是要==不等於==,則這個原則好用! #### Principle 2 * 一般來說==公認==的原則作為null hypothesis * ex1. 是否符合常態分佈 * ex2. 是否符合國家標準 * [研究員期望]==不要==落入拒絕區 #### Principle 3 * 有==等號==部分只會出現在null hypothesis * [研究員期望]對自己==有利==落入<font color="dd0000">拒絕區</font>,對自己無利的==不要==落入拒絕區 ## 例題一 設一般人血液中平均膽固醇含量為180 mg%/ml,其標準偏差σ=50 mg%/ml。今調查某地區16個成人之平均膽固醇為200 mg%/ml,試問==某地區成人膽固醇是否合乎標準值==。 1. H~0~:u=u~0~=180 2. H~1~:u≠u~0~ 3. set significant level \begin{align} p=α & =0.05 \end{align} 5. calculate Z score \begin{align} Z & =\frac{200-180}{50/\sqrt{16}}=1.6 \end{align} 6. |z|=1.6 <Z~0.975~=1.96,故accept null hypothesis,表示某地區成人膽固醇含量合乎標準值。 ## 2類型錯誤  * 檢測結果會有4種結果 #### 1.推論正確(1-α) * 樣品確實from族群 * 結果為==Accept null hypothesis== * 這樣的推論為<font color="dd0000">正確</font> * 此推論正確的==機率===1-α #### 2.<font color="660066">第一型錯誤</font> * 樣品確實from族群 * 結果為<font color="dd0000">拒絕</font>null hypothesis * 也就是==Accept alternative hypothesis== * 此推論==錯誤率===α #### 3.<font color="660066">第二型錯誤</font> * 樣品==不是==from族群 * 結果為<font color="dd0000">接受</font>null hypothesis * 此推論==錯誤率===β #### 4.推論正確(1-β) * 樣品==不是==from族群 * 結果為<font color="dd0000">拒絕</font>null hypothesis * 也就是==Accept alternative hypothesis== * 此推論正確的==機率===1-β * 在統計上稱為==檢定力==(test of power) ## 例題二 設今欲試驗某飼料添加魚骨粉後,對於雞每月的平均產蛋量是否提高。而一般的飼料,每隻雞每月平均產量為μ~0~=21個,標準差σ=9,假設今試驗100隻雞,每月平均產蛋量為𝑥 ̅=24個,試問添加魚骨粉是否能提高產蛋量? 1. H~0~:u=u~0~=21 2. H~1~:u>u~0~ 3. set significant level \begin{align} p=\alpha & =0.05 \end{align} 4. calculate Z score \begin{align} Z & =\frac{24-21}{9/\sqrt{100}}=3.33 \end{align} 5.|Z|=3.33>Z~0.95~=1.645,故accept alternative hypothesis,表示添加魚骨粉可提高產蛋量。 [Z=1.645]u~0~=22.48,也就是說只要x>22.48,就會accept alternative hypothesis ## $\alpha$、$\beta$、檢定力(1-$\beta$)與樣品大小的關係 * 假如選取較小的$\alpha$,以限制第一型錯誤發生的機會,卻會增加第二型錯誤的機會。 * 研究員期望==兩種錯誤能夠<font color="dd0000">both均</font>能盡量減少 <img src="https://i.imgur.com/gcVpE72.jpg" width=85% height=85%> ## 例題三 <font color="660666">依據大學聯招分數高低分發於甲乙大學學生IQ是否有差別</font>,我們想測驗甲大學學生IQ是否比乙大學高出5個單位。設乙大學學生平均IQ=110,標準偏差σ=20,今從甲大學隨機抽取n=64位學生,測得其平均IQ=113 1. H~0~:u~甲~=u~乙~(=110) 2. H~1~:u~甲~(=113)>u~乙~(=110) 3. set significant level \begin{align} p=\alpha & =0.05 \end{align} \begin{align} Z~0.95~ & =1.645 \end{align} 4. calculate Z score \begin{align} Z & =\frac{113-110}{20/\sqrt{64}}=1.2<Z~0.95~=1.645 \end{align} 5. accept null hypothesis,表示甲乙大學學生IQ沒有差別。 6. 計算==檢定力==(1-$\beta$) \begin{align} u~甲~ & ≥u~0~+Z~0.95\frac{\sigma}{\sqrt{n}}=110+1.645x\frac{20}{\sqrt{64}}=114.1 \end{align} 推論:要Accept alternative hypothesis,u~甲~>114.1,才會認為甲大學生IQ=115。 若判斷正確,則判斷正確的機率為 \begin{align} 1-\beta & =Pr(u~甲~≥114.1) \\ & =Pr(Z≥\frac{114.1-115}{20/\sqrt{64}}) \\ & =Pr(Z≥-0.36) \\ & =1-Pr(Z≤−0.36) \\ & =1-0.3594 \\ & =64.06% \\ \end{align} <img src="https://i.imgur.com/c83DuAc.png" width=50% height=50%> 
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.