Try   HackMD

應用統計 R 101-7

檢定的架構

統計假設由虛無、對立假設組成:

虛無假設

H0(null hypothesis)
對立假設
Ha
(alternative hypothesis):「虛無假設」相反的陳述

虛無假設和對立假設為互斥 (mutually exclusive) 證據推論後只能取其一

檢定的想法

1.計畫一個抽樣的程序以取得樣本與資訊
2.再決定拒絕(或不拒絕)虛無假設,

H0. 基本上我們假設
H0
是真的, 除非證據偏向
Ha
.
3.建立準則, 標示是否已達統計上的顯著性. 告訴何時拒絕或不拒絕虛無假設
H0

4.接下來透過實驗取得樣本去推論: 是否拒絕或不拒絕虛無假設.

統計的顯著性

因此, 為解決信心程度衡量上的問題, 需用檢定統計量的抽樣 分配來做必要的判定.

單母體相關的抽樣分配

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

p-值

1.比(樣本)檢定統計量更不利於虛無假設的機率
2.p-值越小, 檢定統計量越是偏離虛無假設

H0.
3.p-值越小, 代表我們「拒絕」虛無假設
H0
的信心(強度)越大.
4.雙尾檢定的話 p-value*2

例子

1.從樣本,

n=180, 大樣本,
X¯
= 77.3639, 樣本變異數
s=10.3071.

計算檢定統計量
t=77.36397510.3071/180=3.07701

當顯著水準
α=0.05
,
t0.05,179=1.6534

t=3.077>1.653=t(0.05,179)
, 拒絕虛無假設 H0:μ≤75. i.e., 在顯著水準
α=0.05
下, 證據顯示有信心以為 μ 比 75 大.
從另一角度, 手上的資料 (樣本平均數
X¯
或檢定統計量
t
) 和虛無假設 H0:μ≤75 偏離有多大?

(a)若

X¯ = 77.3639, 樣本變異數
s=10.3071
. 且顯著水準
α=0.05
. 檢定腰圍平均水準μ,
H0:μ=75.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

(b)若
X¯
= 76.6, 樣本變異數
s=10.3071
. 且顯著水準
α=0.05
. 檢定腰圍平均水準μ,
H0:μ75.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

(c)若

X¯ = 76.6, 樣本變異數
s=10.3071
. 且顯著水準
α=0.01
. 檢定腰圍平均水準μ,
H0:μ75.

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

2.檢定一宣稱服用 A 品牌減肥藥物10個月體重將減少10公斤. 今有49人参與實驗, 得實驗資料平均減少12.5公斤, 標準差7公斤.
(a)在顯著水準 α = 2% 下, 做雙尾檢定.
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

(b)計算檢定的 p 值?
2P(t(48)>2.5)=0.0124

3.假設製造裝填藥物機器的廠商宣稱: 他所生產的某藥物自動裝填器平均裝填的重量(μ)為8毫克. 假設其分配重量為標準差為0.2毫克的常態分配. 今隨機抽查一組樣本 (n = 16), 計算樣本平均重量是8.1毫克。試以顯著水準 α= 0.01、0.05,
檢定統計假設
H0:μ=0.8
Ha:μ8
.
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

4.臺中科技大學過去女性新生的平均高度為162.5公分. 當有一組來自女性新生隨機樣本大小為50人, 平均高度為165.2公分及標準差7公分,
是否有理由相信平均高度已經改變?設顯著水準為0.02.
承上題, 試以 p 值方法寫下檢定結論.
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

5.假設某大批貨物瑕疵品比例一般不應該超過產品的15%,買主松田想要檢定瑕疵品的比例是否超過該限制。松田從100件產品的隨機樣本中,發現19件瑕疵品。是否有理由相信瑕疵品的比例超過該限制?假設顯著水準為 0.01。
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

6.給予一資料如下:159.9、187.2、180.1、158.1、225.5、163.7、217.3,且假設其來自常態分配。若樣本變異數為753.04,當顯著水準為 0.1,試欲檢定:
H0:σ2=750
Ha:σ2750

形式錯誤


α=P()=P(H0H0)β=P()=P(H0H0)=P(H1H1)

例子

1.從一變異數為 144 的常態母體中抽取一組樣本大小為 36 的樣本, 欲檢定母體平均數 μ,

H0:μ200
Ha:μ200
, 今假設給予決策準則: 若
X¯
<196, 則拒絕虛無假設.
求此檢定的 α 型(型一)錯誤.
若 μ=194, 求此檢定 β 型(型二)錯誤

2.
保險公司檢視其當前保單費率。當初費率設定時,平均理賠金額是1,800元,他們憂慮現在平均理賠金額比過去要高因而會導致公司利潤損失,今欲檢定
H0:μ1800

假設有一決策準則為:若樣本平均數
X¯
>1,940,則拒絕虛無假設。假設隨機樣本大小為40且假設理賠金額的標準差為500元。
(a)此決策的型一錯誤為多少? (0.0382)

(b)假設 μ=1,965元,則型二錯誤為多少? (0.3759)

(c)又 μ=1,980 元,則型二錯誤為多少? (0.3064)

3.
考慮統計假設
H0:μ=8
Ha:μ8
。 若控制型一錯誤 α=0.01,則犯下型二錯誤的機率為何? 假設資料來自常態母體 N(μ,0.22) 且 n=16。

4
檢定紅豆的比例
若檢定
H0:p=0.4
相對
Ha:p=0.6
。 決策準則:當隨機抽樣的 5 顆豆子中,紅豆的個數(Y)是 5 顆時,拒絕虛無假設 H0:p=0.4。
(a)試計算此檢定的型一錯誤與型二錯誤。(0.01024, 0.92224)
(b)使用相同的決策準則,即「若為5顆紅豆,拒絕虛無假設」,檢定統計假設: H0:p=0.4 對 Ha:p≠0.4。試計算此檢定的型一錯誤與型二錯誤。(0.01024,
1p05
)