97
統統統 : 統統統統統 統 13 統 : 統統統統

統計學 : 應用與進階 第 13 章 : 假設檢定

  • Upload
    ryu

  • View
    231

  • Download
    8

Embed Size (px)

DESCRIPTION

統計學 : 應用與進階 第 13 章 : 假設檢定. 假設檢定的基本觀念 如何執行假設檢定 ? 假設檢定程序 檢定的 p- 值 誤差機率與檢定力 檢定力函數. Nonstatistical Hypothesis Testing. A criminal trial is an example of hypothesis testing without the statistics. In a trial a jury must decide between two hypotheses. The null hypothesis is - PowerPoint PPT Presentation

Citation preview

Page 1: 統計學 :  應用與進階 第 13  章 :  假設檢定

統計學 : 應用與進階第 13 章 : 假設檢定

Page 2: 統計學 :  應用與進階 第 13  章 :  假設檢定

假設檢定的基本觀念如何執行假設檢定 ?假設檢定程序檢定的 p- 值誤差機率與檢定力檢定力函數

Page 3: 統計學 :  應用與進階 第 13  章 :  假設檢定

Nonstatistical Hypothesis Testing

A criminal trial is an example of hypothesis testing without the statistics. In a trial a jury must decide between two hypotheses. The null hypothesis is

H0: The defendant is innocent

The alternative hypothesis or research hypothesis isH1: The defendant is guilty

The jury does not know which hypothesis is true. They must make a decision on the basis of evidence presented.

Page 4: 統計學 :  應用與進階 第 13  章 :  假設檢定

Nonstatistical Hypothesis Testing

In the language of statistics convicting the defendant is called

rejecting the null hypothesis in favor of the alternative hypothesis.

That is, the jury is saying that there is enough evidence to conclude that the defendant is guilty (i.e., there is enough evidence to support the alternative hypothesis).

Page 5: 統計學 :  應用與進階 第 13  章 :  假設檢定

Nonstatistical Hypothesis Testing

If the jury acquits it is stating that

there is not enough evidence to support thealternative hypothesis.

Notice that the jury is not saying that the defendant is innocent, only that there is not enough evidence to support the alternative hypothesis. That is why we never say that we accept the null hypothesis.

Page 6: 統計學 :  應用與進階 第 13  章 :  假設檢定

Nonstatistical Hypothesis Testing

There are two possible errors.

A Type I error occurs when we reject a true null hypothesis. That is, a Type I error occurs when the jury convicts an innocent person.

A Type II error occurs when we don’t reject a false null hypothesis. That occurs when a guilty defendant is acquitted.

Page 7: 統計學 :  應用與進階 第 13  章 :  假設檢定

Nonstatistical Hypothesis Testing

The probability of a Type I error is denoted as α (Greek letter alpha). The probability of a type II error is β (Greek letter beta).

The two probabilities are inversely related. Decreasing one increases the other.

Page 8: 統計學 :  應用與進階 第 13  章 :  假設檢定

Nonstatistical Hypothesis Testing

5. Two possible errors can be made. Type I error: Reject a true null hypothesis

Type II error: Do not reject a false null hypothesis.

P(Type I error) = αP(Type II error) = β

Page 9: 統計學 :  應用與進階 第 13  章 :  假設檢定

Decision Results

H0: InnocentJury Trial

Actual Situation

Verdict Innocent Guilty

Innocent Correct Error

Guilty Error Correct

H0 TestActual Situation

Decision H0 True H0False

AcceptH0

1 – Type IIError

()

RejectH0

Type IError ()

Power(1 – )

Page 10: 統計學 :  應用與進階 第 13  章 :  假設檢定

Nonstatistical Hypothesis Testing

In our judicial system Type I errors are regarded as more serious. We try to avoid convicting innocent people. We are more willing to acquit guilty people.

We arrange to make α small by requiring the prosecution to prove its case and instructing the jury to find the defendant guilty only if there is “evidence beyond a reasonable doubt.”

Page 11: 統計學 :  應用與進階 第 13  章 :  假設檢定

Nonstatistical Hypothesis TestingThe critical concepts are theses:1. There are two hypotheses, the null and the alternative

hypotheses.2. The procedure begins with the assumption that the

null hypothesis is true.3. The goal is to determine whether there is enough

evidence to infer that the alternative hypothesis is true.

4. There are two possible decisions:Conclude that there is enough evidence to support the alternative hypothesis.Conclude that there is not enough evidence to support the alternative hypothesis.

Page 12: 統計學 :  應用與進階 第 13  章 :  假設檢定

假設檢定假設 (hypothesis) 就是我們對於母體參數的宣稱

我宣稱本校學生的平均身高為 166 公分 , 我宣稱本校學生的平均智商為 130 分

假設檢定 (hypothesis testing) 的目的就是要對這些宣稱提供統計上的檢驗 , 以統計的檢定方法來推論假設的真偽決策為拒絕 (reject) 該假設 , 或是無法拒絕

(fail to reject) 該假設

Page 13: 統計學 :  應用與進階 第 13  章 :  假設檢定

假設檢定對於未知的母體參數 , 我們可以有各式各樣不同的假設 , 舉例來說 , [H1 ] [H2 ] [H3 ] 其中 , 與 分別代表某固定常數

Page 14: 統計學 :  應用與進階 第 13  章 :  假設檢定

虛無假設與對立假設在假設檢定中 , 我們考慮兩個互斥的假設 :a.虛無假設 (null hypothesis) 就是研究者所要檢定的假設 , 一般以 H0 的符號代表。b. 對立假設 (alternative hypothesis) 就是與虛無假設完全相反的假設 , 如果虛無假設不成立 , 則對立假設就為真 , 一般以 H1 或是 HA 的符號代表。

Page 15: 統計學 :  應用與進階 第 13  章 :  假設檢定

虛無假設What is testedHas serious outcome if incorrect decision

madeAlways has equality sign: , , or Designated H0 (pronounced H-oh)

Page 16: 統計學 :  應用與進階 第 13  章 :  假設檢定

對立假設Opposite of null hypothesisAlways has inequality sign: ,, or Designated Ha

Page 17: 統計學 :  應用與進階 第 13  章 :  假設檢定

虛無假設與對立假設舉例來說 , 若虛無假設為

則對立假設可以是

Page 18: 統計學 :  應用與進階 第 13  章 :  假設檢定

簡單假設 vs. 複合假設如果假設中 , 僅包含一個特定的假設值 , 如 μ =

166, 則該假設稱作簡單假設 (simple hypothesis)

假設中 , 可能的參數假設值不只一個 , 則該假設稱為複合假設 (composite hypothesis), 如 μ > 166

通常將虛無假設以簡單假設的方式呈現 , 而對立假設則為複合假設

Page 19: 統計學 :  應用與進階 第 13  章 :  假設檢定

ExampleTest that the population mean is not 3

Steps: State the question statistically ( 3) State the opposite statistically ( = 3)

— Must be mutually exclusive & exhaustive Select the alternative hypothesis ( 3)

— Has the , <, or > sign State the null hypothesis ( = 3)

Page 20: 統計學 :  應用與進階 第 13  章 :  假設檢定

ExampleIs the population average amount of TV

viewing different from 12 hours?Steps

State the question statistically: = 12 State the opposite statistically: 12 Select the alternative hypothesis: Ha: 12 State the null hypothesis: H0: = 12

Page 21: 統計學 :  應用與進階 第 13  章 :  假設檢定

ExampleIs the average cost per hat less than or

equal to $20?

Steps State the question statistically: 20 State the opposite statistically: 20 Select the alternative hypothesis: Ha: 20 State the null hypothesis: H0: 20

Page 22: 統計學 :  應用與進階 第 13  章 :  假設檢定

ExampleIs the average amount spent in the

bookstore greater than $25?

Steps State the question statistically: 25 State the opposite statistically: 25 Select the alternative hypothesis: Ha: 25 State the null hypothesis: H0: 25

Page 23: 統計學 :  應用與進階 第 13  章 :  假設檢定

假設檢定一般來說 , 透過統計上的檢定程序 , 我們的決策為

拒絕 H0 且接受 H1 為真 , 無法拒絕 H0 。

注意到我們不說「接受 H0 」的原因在於 , 即使我們 找不到證據推翻 H0, 並不代表 H0 就是無庸置疑地為 真 , 只不過是找不到充分證據來推翻 H0 罷了。你或 許會在某些場合或是某些書上聽到或看到「接受 H0 」的說法 , 但是請記得當別人如此宣稱時 , 並不代 表 H0 是無庸置疑地為真 (absolutely true)

Page 24: 統計學 :  應用與進階 第 13  章 :  假設檢定

Basic Idea

Sample Means = 50H0

Sampling DistributionIt is unlikely that we would get a sample mean of this value ...

20

... if in fact this were the population mean

... therefore, we reject the hypothesis that = 50.

Page 25: 統計學 :  應用與進階 第 13  章 :  假設檢定

Level of Significance

1. Probability

2. Defines unlikely values of sample statistic if null hypothesis is true

• Called rejection region of sampling distribution

3. Designated (alpha)• Typical values are .01, .05, .10

4. Selected by researcher at start

Page 26: 統計學 :  應用與進階 第 13  章 :  假設檢定

Rejection Region (One-Tail Test)

Ho

ValueCriticalValue

Sample Statistic

RejectionRegion

NonrejectionRegion

Sampling Distribution

1 –

Level of Confidence

Observed sample statistic

Page 27: 統計學 :  應用與進階 第 13  章 :  假設檢定

Rejection Region (One-Tail Test)

Sampling Distribution Level of Confidence

Ho

ValueCriticalValue

Sample Statistic

RejectionRegion

NonrejectionRegion

Sampling Distribution

1 –

Level of Confidence

Observed sample statistic

Page 28: 統計學 :  應用與進階 第 13  章 :  假設檢定

Rejection Regions (Two-Tailed Test)

Ho

Value CriticalValue

CriticalValue

1/2 1/2

Sample Statistic

RejectionRegion

RejectionRegion

NonrejectionRegion

Sampling Distribution

1 –

Level of Confidence

Observed sample statistic

Page 29: 統計學 :  應用與進階 第 13  章 :  假設檢定

Ho

Value CriticalValue

CriticalValue

1/2 1/2

Sample Statistic

RejectionRegion

RejectionRegion

NonrejectionRegion

Sampling Distribution

1 –

Level of Confidence

Rejection Regions (Two-Tailed Test)

Sampling Distribution Level of Confidence

Observed sample statistic

Page 30: 統計學 :  應用與進階 第 13  章 :  假設檢定

Ho

Value CriticalValue

CriticalValue

1/2 1/2

Sample Statistic

RejectionRegion

RejectionRegion

NonrejectionRegion

Sampling Distribution

1 –

Level of Confidence

Rejection Regions (Two-Tailed Test)

Sampling Distribution Level of Confidence

Observed sample statistic

Page 31: 統計學 :  應用與進階 第 13  章 :  假設檢定

One Population Tests

OnePopulation

Z Test(1 & 2tail)

t Test(1 & 2tail)

Z Test(1 & 2tail)

Mean Proportion Variance

c 2 Test(1 & 2tail)

Page 32: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定某藥廠宣稱只有 5% 的人在服用過他們的新藥

後 , 出現嚴重副作用。食品藥物管理局對此感到懷疑 , 決定應用統計方法予以檢定。在給予 287 個受試者服用此藥後 , 以 Xi = 1 代表第 i 個受試者有嚴重副作用 ,Xi = 0 代表沒有嚴重副作用產生。顯而易見地 ,

Page 33: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定假設為

倘若我們發現 , 在 287 名受試者有 25 位出現嚴重副作用 , 亦即 , = 25/287 = 0.0871 。根據這組樣本 , 我們如何檢定藥廠的宣稱 ?

Page 34: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定假設檢定的基本邏輯在於 , 且讓我們暫時相信 H0 為真在假設 H0 : μ = 0.05 為真的情況下 , 即使我們所抽出來的每一組樣本的平均值 不會「剛好」等於 0.05, 卻應該會「相當接近」 0.05換言之 , 給定虛無假設成立的情況下 , 樣本均數遠大於 0.05 的的可能性極低 (very unlikely), 亦即 , 在假設 H0 為真的情況下出現一個極端值的可能性將會十分微小

Page 35: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定因此 , 如果這種「不太可能」的事件真的發生了 ,我們就可以據此拒絕虛無假設簡而言之 , 如果 的值太大 , 大過於某個常數 c, 我們就拒絕虛無假設這樣的極端事件發生的機率要多小才算是「不太可能」 ? 一般來說 , 我們選取一個極小的機率 ,

α , 如 0.10, 0.05 或是 0.01, 來作為拒絕虛無假設的基礎

Page 36: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定亦即 , 根據虛無假設為真的機率分配下 ( 稱之為虛無分配 ), 的值大過於某個常數 c, 且發生此極端事件的條件機率 P( |H0 為真 ) 非常

小 , 我們就做出拒絕虛無假設的決策此微小機率 α 通常被稱作顯著水準

(significance level) 。假設檢定又被叫做顯著性檢定 (test of significance), 意指根據隨機樣本來決定是否足以顯著地拒絕 (具有充分證據拒絕 ) 虛無假設。

Page 37: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定因此 , 統計上的「顯著」並不是指「數值」的大

小 , 而是指「機率」的大小。發生此極端事件的機率小 , 才稱此極端事件具顯著性

Page 38: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定利用以上的例子說明 , 則我們就是要找出一個臨界值 c 使得

亦即我們定義了一個機率微小事件 : { > c}一旦我們找到 c 後 , 且得知 , 則決策為 :

{ 拒絕 H0, 當 > c}

以上又稱為拒絕域 (rejection region, RR)

Page 39: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定值得一提的是 , 我們的決策法則乃是樣本實現前所確立下來的法則 , 亦即 , c 值是在樣本實現前所找出來的臨界值 , 這又是一個樣本實現前 (ex

ante) 的概念至於拒絕與否的決策則是由樣本實現後的 與 c 做比較

Page 40: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定再者 , P( > c|μ = 0.05) = 有兩大特徵第一 , 這是一個樣本實現前 (ex ante) 的機率第二 , 這是一個條件機率 , 受限於 H0 : μ =

0.05 為真的這個條件

Page 41: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定我們回到藥廠的例子 ,

Page 42: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定由於

根據 CLT, 我們知道

Page 43: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定

Page 44: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定

則 c 值為

若選取的 α = 0.01, 則 = 2.33, 且 故

Page 45: 統計學 :  應用與進階 第 13  章 :  假設檢定

例子 : 執行假設檢定亦即 , 拒絕域為

RR ={ 拒絕 H0, 當 ≥ 0.08 }

在本例中 , = = 0.0871 > 0.08 = c, 我們據此拒絕 H0 : μ = 0.05, 接受 H1 : μ > 0.05

Page 46: 統計學 :  應用與進階 第 13  章 :  假設檢定

執行假設檢定的常用法事實上 , 我們有兩種方法執行假設檢定 , 第一種方法如上所示 , 找出臨界值 c 。當 , 則拒絕虛無假設另一種方法則是呼應上一章區間估計式的建構。我們可以建構一個與上一章相同的統計量 找出 的抽樣分配 , 接著根據 的抽樣分配找出臨界值 使得最後 , 求算 而決策法則為 : 當 則拒絕 H0

Page 47: 統計學 :  應用與進階 第 13  章 :  假設檢定

執行假設檢定的常用法若 的抽樣分配已知 , 稱之為實際檢定若 的抽樣分配未知 , 但符合 CLT 的條件 , 則當樣本夠大時 , 的抽樣分配可用 N(0, 1) 予以近似 , 我們稱之為近似檢定 , 或叫做大樣本檢定底下我們列出假設檢定程序

Page 48: 統計學 :  應用與進階 第 13  章 :  假設檢定

假設檢定程序 : θ 代表所欲檢定的母體參數[步驟一 ] 設立虛無假設 (H0) 與對立假設 (H1)H0 : θ=θ0

H1 : 三種可能a. θ > θ0 : 右尾檢定 (right-tailed test, RTT)b. θ < θ0 : 左尾檢定 (left-tailed test, LTT)c. θ ≠ θ0 : 雙尾檢定 (two-tailed test, TTT)

Page 49: 統計學 :  應用與進階 第 13  章 :  假設檢定

假設檢定程序 [步驟二 ] 建構統計量 並找出 的 抽樣分配 , ( 如標準常態分配 , t 分配 , 分

配 , F 分配 等 ) 。若實際抽樣分配未知 , 但是可以應用

CLT, 則 的抽樣分配可用標準常態分配予以近似 [步驟三 ] 選擇顯著水準 , α

Page 50: 統計學 :  應用與進階 第 13  章 :  假設檢定

假設檢定程序[步驟四 ] 根據 的抽樣分配或近似分配找出臨界值 , 或是 , 並建構拒絕

(rejection region, RR) 。 舉例來說 , 如果 ∼ N(0, 1), 則其臨界值為 (右尾檢定 ), − (左尾檢定 ), 或是 (雙尾檢 定 ) 。其拒絕域為

a. 拒絕 H0, 當b. 拒絕 H0, 當c. 拒絕 H0, 當[步驟五 ] 檢視 是否掉入拒

絕域並做出決策。

Page 51: 統計學 :  應用與進階 第 13  章 :  假設檢定

再以藥廠的例子來說明根據 CLT,

根據選取的 α = 0.01,

查表得知 , 則拒絕域為RR ={ 拒絕 H0, 當 }

Page 52: 統計學 :  應用與進階 第 13  章 :  假設檢定

藥廠的例子由於 μ = μ0 = 0.05, , 則

顯而易見地 , 落入拒絕域 , 因此 , 我們據此拒絕 H0 : μ = 0.05

注意到這是一個顯著水準近似於 0.01 的大樣本檢定

Page 53: 統計學 :  應用與進階 第 13  章 :  假設檢定

One Population Tests

OnePopulation

Z Test(1 & 2tail)

t Test(1 & 2tail)

Z Test(1 & 2tail)

Mean Proportion Variance

c 2 Test(1 & 2tail)

Page 54: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Sample Z Test for Proportion

1. Assumptions• Random sample selected from a binomial population

• Normal approximation can be used if

0 0ˆ ˆ15 and 15np nq

2. Z-test statistic for proportion0

0 0

p̂ pZp q

n

Hypothesized

population proportion

Page 55: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Proportion Z Test Example

The present packaging system produces 10% defective cereal boxes. Using a new system, a random sample of 200 boxes had11 defects. Does the new system produce fewer defects? Test at the .05 level of significance.

Page 56: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Proportion Z Test Solution

• H0: • Ha: • = • n =• Critical Value(s):

Test Statistic:

Decision:

Conclusion:

p = .10p < .10.05200

Z0-1.645

.05Reject H0

Page 57: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Proportion Z Test Solution

Test Statistic:

Decision:

Conclusion:

0

0 0

11 .10ˆ 200 2.12.10 .90

200

p pZp q

n

Reject at = .05

There is evidence new system < 10% defective

Page 58: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Proportion Z Test Thinking Challenge

You’re an accounting manager. A year-end audit showed 4% of transactions had errors. You implement new procedures. A random sample of 500 transactions had 25 errors. Has the proportion of incorrect transactions changed at the .05 level of significance?

Page 59: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Proportion Z Test Solution*

• H0: • Ha: • = • n = • Critical Value(s):

Test Statistic:

Decision:

Conclusion:

p = .04p .04.05500

Z0 1.96-1.96

.025Reject H 0 Reject H0

.025

Page 60: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Proportion Z Test Solution*

Test Statistic:

Decision:

Conclusion:

0

0 0

25 .04ˆ 500 1.14.04 .96

500

p pZp q

n

Do not reject at = .05

There is evidence proportion is not 4%

Page 61: 統計學 :  應用與進階 第 13  章 :  假設檢定

One Population Tests

OnePopulation

Z Test(1 & 2tail)

t Test(1 & 2tail)

Z Test(1 & 2tail)

Mean Proportion Variance

2 Test(1 & 2tail)

Page 62: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test for Mean ( Known)

1. Assumptions• Population is normally distributed• If not normal, can be approximated by

normal distribution (n 30)

2. Alternative hypothesis has sign

x

x

X XZ

n

3. Z-Test Statistic

Page 63: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test for Mean Hypotheses

H0:=0 Ha: ≠ 0

Z0

Reject H0

Reject H

Page 64: 統計學 :  應用與進階 第 13  章 :  假設檢定

.500 - .025

.475

Z0

= 1

Two-Tailed Z Test Finding Critical Z

What is Z given = .05?

= .025

Z .05 .07

1.6 .4505 .4515 .4525

1.7 .4599 .4608 .4616

1.8 .4678 .4686 .4693

.4744 .4756

.06

1.9 .4750

Standardized Normal Probability Table (Portion)

1.96-1.96

Page 65: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test Example

Does an average box of cereal contain 368 grams of cereal? A random sample of 25 boxes showed x = 372.5. The company has specified to be 15 grams. Test at the .05 level of significance.

368 gm.368 gm.

Page 66: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test Solution

• H0: • Ha: • • n • Critical Value(s):

Test Statistic:

Decision:

Conclusion:

= 368 368.0525

Z0 1.96-1.96

.025Reject H 0 Reject H0

.025

Page 67: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test Solution

Test Statistic:

Decision:

Conclusion:

372.5 368 1.501525

XZ

n

Do not reject at = .05

No evidence average is not 368

Page 68: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test Thinking Challenge

You’re a Q/C inspector. You want to find out if a new machine is making electrical cords to customer specification: average breaking strength of 70 lb. with = 3.5 lb. You take a sample of 36 cords & compute a sample mean of 69.7 lb. At the .05 level of significance, is there evidence that the machine is not meeting the average breaking strength?

Page 69: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test Solution*

• H0: • Ha: • = • n = • Critical Value(s):

Test Statistic:

Decision:

Conclusion:

= 70 70.0536

Z0 1.96-1.96

.025Reject H 0 Reject H0

.025

Page 70: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test Solution*

Test Statistic:

Decision:

Conclusion:

69.7 70 .513.536

XZ

n

Do not reject at = .05

No evidence average is not 70

Page 71: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test of Mean ( Known)

Page 72: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test for Mean ( Known)

1. Assumptions• Population is normally distributed• If not normal, can be approximated by

normal distribution (n 30)

2. Alternative hypothesis has < or > sign

3. Z-test Statistic

x

x

X XZ

n

Page 73: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test for Mean Hypotheses

H0:=0 Ha: < 0

Z0

Reject H0

Must be significantly below

Z0

Reject H0

H0:=0 Ha: > 0

Small values satisfy H0 . Don’t reject!

Page 74: 統計學 :  應用與進階 第 13  章 :  假設檢定

.500 - .025

.475

Z0

= 1

One-Tailed Z Test Finding Critical Z

What Is Z given = .025?

= .025

1.96

Z .05 .07

1.6 .4505 .4515 .4525

1.7 .4599 .4608 .4616

1.8 .4678 .4686 .4693

.4744 .4756

.06

1.9 .4750

Standardized Normal Probability Table (Portion)

Page 75: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test Example

Does an average box of cereal contain more than 368 grams of cereal? A random sample of 25 boxes showed x = 372.5. The company has specified to be 15 grams. Test at the .05 level of significance.

368 gm.368 gm.

Page 76: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test Solution

• H0: • Ha: • = • n = • Critical Value(s):

Test Statistic:

Decision:

Conclusion:

= 368 > 368.0525

Z0 1.645

.05Reject

Page 77: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test Solution

Test Statistic:

Decision:

Conclusion:

372.5 368 1.501525

XZ

n

Do not reject at = .05

No evidence average is more than 368

Page 78: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test Thinking Challenge

You’re an analyst for Ford. You want to find out if the average miles per gallon of Escorts is at least 32 mpg. Similar models have a standard deviation of 3.8 mpg. You take a sample of 60 Escorts & compute a sample mean of 30.7 mpg. At the .01 level of significance, is there evidence that the miles per gallon is at least 32?

Page 79: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test Solution*

• H0: • Ha: • = • n =• Critical Value(s):

Test Statistic:

Decision:

Conclusion:

= 32 < 32.0160

Z0-2.33

.01Reject

Page 80: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test Solution*

Test Statistic:

Decision:

Conclusion:

30.7 32 2.653.860

XZ

n

Reject at = .01

There is evidence average is less than 32

Page 81: 統計學 :  應用與進階 第 13  章 :  假設檢定

三種常用假設檢定法

Page 82: 統計學 :  應用與進階 第 13  章 :  假設檢定

標準檢定統計量法: p- 值 (p-value)在上一節假設檢定程序的討論中 , 我們的決策法則為 : 決定一顯著水準 α 後 , 找出 , 然後再比較 是否大於或小於這樣的作法有一個麻煩的地方 , 那就是給定任何一個不同的顯著水準 α , 我們就得查出相對應的 ; 以及找出相對應的拒絕域一個有用的概念 : p- 值 (p-value)所謂的 p- 值就是在 H0 為真的情況下 , 比觀測值至少同樣極端之區域的機率

Page 83: 統計學 :  應用與進階 第 13  章 :  假設檢定

檢定的 p- 值回到之前藥廠的例子 , 我們知道 = 0.0871 。給定 H0 為真的情況下 (μ = 0.05), 樣本均數 會大於 0.0871 的機率就是其 p- 值 : p- 值

Page 84: 統計學 :  應用與進階 第 13  章 :  假設檢定

檢定的 p- 值以 的方式表達 , p- 值就是

由於 0.0019 很小 , 代表在 H0 為真的情況下 , 我們觀察到一件「幾乎不可能發生的事」 , 因此 , 這將使我們懷疑原先的 H0 為真的假設 , 進而獲致拒絕 H0 的決策

Page 85: 統計學 :  應用與進階 第 13  章 :  假設檢定

p- 值在研究上相當便利好用 , 對於研究者而言 ,p- 值讓我們不必再一個一個辛苦查表。許多的統計套裝軟體都會幫我們計算出檢定的 p- 值

你只需決定喜愛的顯著水準 , 再比較 p- 值與 α 孰大孰小即可。決策法則為 :a. 拒絕 H0, 當 p- 值≤ αb. 無法拒絕 H0, 當 p- 值 > α

舉例來說 , 給定 p- 值 =0.048 。當 α = 0.05 時 , 我們拒絕 H0; 然而 , 當 α = 0.01 時 , 我們的決策為無法拒絕 H0

Page 86: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test p-Value Example

Does an average box of cereal contain 368 grams of cereal? A random sample of 25 boxes showed x = 372.5. The company has specified to be 15 grams. Find the p-Value.

368 gm.368 gm.

Page 87: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test p-Value Solution

Z0 1.50Z value of sample statistic (observed)

372.5 368 1.501525

XZ

n

Page 88: 統計學 :  應用與進階 第 13  章 :  假設檢定

1/2 p-Value1/2 p-Value

Two-Tailed Z Test p-Value Solution

Z value of sample statistic (observed)

p-value is P(Z -1.50 or Z 1.50)

Z0 1.50-1.50From Z table: lookup 1.50

.4332

.5000- .4332

.0668

Page 89: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test p-Value Solution

1/2 p-Value.0668

1/2 p-Value.0668

p-value is P(Z -1.50 or Z 1.50) = .1336

Z value of sample statistic

From Z table: lookup 1.50

.5000- .4332

.0668

Z0 1.50-1.50

Page 90: 統計學 :  應用與進階 第 13  章 :  假設檢定

Two-Tailed Z Test p-Value Solution

0 1.50-1.50 Z

Reject H0Reject H0

1/2 p-Value = .06681/2 p-Value = .0668

1/2 = .0251/2 = .025

(p-Value = .1336) ( = .05). Do not reject H0.

Test statistic is in ‘Do not reject’ region

Page 91: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test p-Value Example

Does an average box of cereal contain more than 368 grams of cereal? A random sample of 25 boxes showed x = 372.5. The company has specified to be 25 grams. Find the p-Value.

368 gm.368 gm.

Page 92: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test p-Value Solution

Z0 1.50

Z value of sample statistic

372.5 368 1.501525

XZ

n

Page 93: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test p-Value Solution

Use alternative hypothesis to find direction

p-Value is P(Z 1.50)

Z value of sample statistic

p-Value

Z0 1.50From Z table: lookup 1.50

.4332

.5000- .4332

.0668

Page 94: 統計學 :  應用與進階 第 13  章 :  假設檢定

One-Tailed Z Test p-Value Solution

p-Value.0668

Z value of sample statistic

From Z table: lookup 1.50

Use alternative hypothesis to find direction

.5000- .4332

.0668

p-Value is P(Z 1.50) = .0668

Z0 1.50

.4332

Page 95: 統計學 :  應用與進階 第 13  章 :  假設檢定

= .05

One-Tailed Z Test p-Value Solution

0 1.50 Z

Reject H0

p-Value = .0668

(p-Value = .0668) ( = .05). Do not reject H0.

Test statistic is in ‘Do not reject’ region

Page 96: 統計學 :  應用與進階 第 13  章 :  假設檢定

p-Value Thinking Challenge

You’re an analyst for Ford. You want to find out if the average miles per gallon of Escorts is at least 32 mpg. Similar models have a standard deviation of 3.8 mpg. You take a sample of 60 Escorts & compute a sample mean of 30.7 mpg. What is the value of the observed level of significance (p-Value)?

Page 97: 統計學 :  應用與進階 第 13  章 :  假設檢定

Use alternative hypothesis to find direction

p-Value Solution*

Z0-2.65Z value of sample statistic From Z table:

lookup 2.65

.4960

p-Value.004 .5000

- .4960.0040

p-Value is P(Z -2.65) = .004.p-Value < ( = .01). Reject H0.