有關貝氏定理: 利用貝氏定理估算出事後機率
圖1、貝氏定理進行的程序
台灣截至今天(25/4)已經驗了59,840件,確診人數429(疾管署網頁資料),確診率0.7%。(圖2)(全臺平均值)
假設台灣真實患病率高出一倍,就是1.4%(事前機率),98.6%沒病,試劑準確的不得了,高達99%(條件機率),如果普篩,會發生什麼事(求事後機率)?
請見圖3,根據貝氏定理,驗出陽性而且真的有病的機率只有58.43%,相對的是,驗出陽性,但其實沒病的機率是41.57%。(表1)
如果試劑準確度只有60%時,則根據貝氏定理,驗出陽性而且真的有病的機率只剩2.09%,相對的是,驗出陽性,但其實沒病的機率高達97.91%。(表2)
因此,現階段在確診率(事前機率)很低的狀況下,需不需要去做普篩? 根據貝氏定理的估算,可以做為評估的參考之一。
如果試劑準確度只有60%時,則根據貝氏定理,驗出陽性而且真的有病的機率只剩2.09%,相對的是,驗出陽性,但其實沒病的機率高達97.91%。(表2)
因此,現階段在確診率(事前機率)很低的狀況下,需不需要去做普篩? 根據貝氏定理的估算,可以做為評估的參考之一。
圖3、根據貝氏定理,驗出陽性而且真的有病的機率
表1、當試劑準確度(條件機率)在99%時,各種病患率(事前機率)根據貝氏定理所估算出對應的篩檢結果(事後機率)
條件機率(試劑準度)
準 | 99% |
不準 | 1% |
先驗機率 確診率(有病) | 0.0% | 0.1% | 0.2% | 0.3% | 0.4% | 0.5% | 0.6% | 0.7% | 0.8% | 0.9% | |
事後機率 預測結果 | 陽性 | 0.00% | 9.02% | 16.56% | 22.95% | 28.45% | 33.22% | 37.41% | 41.10% | 44.39% | 47.34% |
陰性 | 100% | 90.98% | 83.44% | 77.05% | 71.55% | 66.78% | 62.59% | 58.90% | 55.61% | 52.66% | |
先驗機率 確診率(有病) |
1.0% | 1.1% | 1.2% | 1.3% | 1.4% | 1.5% | 1.6% | 1.7% | 1.8% | 1.9% | |
事後機率 預測結果 | 陽性 | 50.00% | 52.41% | 54.60% | 56.60% | 58.43% | 60.12% | 61.68% | 63.13% | 64.47% | 65.72% |
陰性 | 50.00% | 47.59% | 45.40% | 43.40% | 41.57% | 39.88% | 38.32% | 36.87% | 35.53% | 34.28% | |
先驗機率 確診率(有病) |
2.0% | 3.0% | 4.0% | 5.0% | 6.0% | 7.0% | 8.0% | 9.0% | 10.0% | ||
事後機率 預測結果 | 陽性 | 66.89% | 75.38% | 80.49% | 83.90% | 86.34% | 88.17% | 89.59% | 90.73% | 91.67% | |
陰性 | 33.11% | 24.62% | 19.51% | 16.10% | 13.66% | 11.83% | 10.41% | 9.27% | 8.33% | ||
先驗機率 確診率(有病) |
20.0% | 30.0% | 40.0% | 50.0% | 60.0% | 70.0% | 80.0% | 90.0% | 100% | ||
事後機率 預測結果 | 陽性 | 96.12% | 97.70% | 98.51% | 99.00% | 99.33% | 99.57% | 99.75% | 99.89% | 100% | |
陰性 | 3.88% | 2.30% | 1.49% | 1.00% | 0.67% | 0.43% | 0.25% | 0.11% | 0.00% |
圖4、貝氏定理 -試劑99%準確率時,由確診率估算篩檢陽性、陰性之變化(4月25日製圖)
表2、當試劑準確度(條件機率)在60%時,各種病患率(事前機率)根據貝氏定理所估算出對應的篩檢結果(事後機率)
條件機率(試劑準度)
準 | 60% |
不準 | 40% |
先驗機率 確診率(有病) | 0.0% | 0.1% | 0.2% | 0.3% | 0.4% | 0.5% | 0.6% | 0.7% | 0.8% | 0.9% | |
事後機率 預測結果 | 陽性 | 0.00% | 0.15% | 0.30% | 0.45% | 0.60% | 0.75% | 0.90% | 1.05% | 1.20% | 1.34% |
陰性 | 100% | 99.85% | 99.70% | 99.55% | 99.40% | 99.25% | 99.10% | 98.95% | 98.80% | 98.66% | |
先驗機率 確診率(有病) | 1.0% | 1.1% | 1.2% | 1.3% | 1.4% | 1.5% | 1.6% | 1.7% | 1.8% | 1.9% | |
事後機率 預測結果 | 陽性 | 1.49% | 1.64% | 1.79% | 1.94% | 2.09% | 2.23% | 2.38% | 2.53% | 2.68% | 2.82% |
陰性 | 98.51% | 98.36% | 98.21% | 98.06% | 97.91% | 97.77% | 97.62% | 97.47% | 97.32% | 97.18% | |
先驗機率 確診率(有病) | 2.0% | 3.0% | 4.0% | 5.0% | 6.0% | 7.0% | 8.0% | 9.0% | 10.0% | ||
事後機率 預測結果 | 陽性 | 2.97% | 4.43% | 5.88% | 7.32% | 8.74% | 10.14% | 11.54% | 12.92% | 14.29% | |
陰性 | 97.03% | 95.57% | 94.12% | 92.68% | 91.26% | 89.86% | 88.46% | 87.08% | 85.71% | ||
先驗機率 確診率(有病) | 20.0% | 30.0% | 40.0% | 50.0% | 60.0% | 70.0% | 80.0% | 90.0% | 100% | ||
事後機率 預測結果 | 陽性 | 27.27% | 39.13% | 50.00% | 60.00% | 69.23% | 77.78% | 85.71% | 93.10% | 100% | |
陰性 | 72.73% | 60.87% | 50.00% | 40.00% | 30.77% | 22.22% | 14.29% | 6.90% | 0.00% |
圖5、貝氏定理 -試劑60%準確率時,由確診率估算篩檢陽性、陰性之變化(4月25日製圖)
延伸閱讀資料:
留言
張貼留言