ArishHank
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    2
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 生統第七章 假設檢定-統計推論 ###### 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類型錯誤 ![](https://i.imgur.com/7KLL1QK.jpg) * 檢測結果會有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%> ![](https://i.imgur.com/L03mBJN.jpg)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    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

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully