Hypothesis testing parameter a statement about the value
Hypothesis testing 假設檢定 觀 念 • 母體參數(parameter)為一個描述母體性質的 數量值。 • 假設為關於母體參數有可能的數值的陳述(a statement about the value or set of values that a parameter or group of parameters can take. ) ©Ming-chi Chen 社會統計 7
The null hypothesis H 0 and the alternative hypothesis H 1 觀 念 • The null hypothesis (虛無假設)H 0 是一組直 接被檢定,關於對於母體參數值的假定。通常 我們設定這個參數值為「無效果」。 • The alternative hypothesis (對立假設)H 1或 Haspecifies an alternative set of possible values of the population parameter that are not specified in the null hypothesis. 不包含在 虛無假設中的母體參數的可能值。 • The two hypotheses are mutually exclusive. 這 兩種假設為互斥。 ©Ming-chi Chen 社會統計 8
Which hypothesis is the null hypothesis? • (1)In many statistical applications, the null hypothesis should correspond to the assumption that no change occurs when some new process or technique is tried. 新的 過程或技術沒有造成任何改變的假設。(如 之前的抽水機例子) ©Ming-chi Chen 社會統計 15
Which hypothesis is the null hypothesis? • (2) Some statisticians argue that the null hypothesis should be the hypothesis that the decision maker wants to disprove. 希望被決策者否定的假設稱為虛 無假設。 • That is, the null hypothesis should specify the values of the population parameter that the researcher thinks does not represent the true value(s) of the parameter; the alternative hypothesis then specifies the values of the parameter that the researcher believes do hold. 虛 無假設中所假設的母體參數值為研究者認為不對的 母體參數值。 ©Ming-chi Chen 社會統計 16
Which hypothesis is the null hypothesis? • (3) another common practice is to assign no special meaning to either the null or the alternative hypothesis, but to let these hypotheses merely represent two different assumptions about the population parameter. 不特別去區分虛無假設及對立假設的意義, 讓兩者各自代表母體參數的一個可能值。 ©Ming-chi Chen 社會統計 17
Consequences of choosing H 0 and H 1 觀 念 • The null hypothesis has the status of a maintained hypothesis that will not be rejected because it is assumed to be true unless the sample data provide strong contrary evidence. • 由於我們只有在證據很充分的情況下才能 推翻虛無假設,因此虛無假設比對立假設 佔據更有利的地位,假設的寫法對於結果 有很大影響。 ©Ming-chi Chen 社會統計 22
Decision rules 觀 念 • 推翻null hypothesis的決策法則: • 我們根據檢定統計量(test statistics)來決 定是否推翻虛無假設,如樣本平均數、樣 本比率、Z 或t值等。 • Test statistic: a test statistic is a random variable whose value is used to determine whether we reject the null hypothesis. ©Ming-chi Chen 社會統計 29
Decision rules 觀 念 • Decision rule: The decision rule specifies the set of values of the test statistic for which the null hypothesis H 0 is rejected in favor of H 1 and the set of values for which H 0 is accepted (i. e. , not rejected). • 假設檢定中的決策法則為決定推翻或無法 推翻假設的檢定統計量的範圍值。 ©Ming-chi Chen 社會統計 30
Rejection Region and Acceptance Region觀 念 • 根據決策法則我們可以將檢定統計量分成 窮盡及互斥的兩組數值區域: • The rejection region (危險域或拒絕域) of a test, also called the critical region( 棄卻域), consists of all values of the test statistic for which H 0 is rejected. • The acceptance region (接受域) consists of all values of the test statistic for which H 0 is not rejected. ©Ming-chi Chen 社會統計 31
Critical Value臨界值 觀 念 • The critical value of the test statistic is the value that separates the critical region from the acceptance region. 區分 拒絕域及接受域的界線。 • 單邊對立假設(one-sided alternative hypothesis)有一個臨界值;雙邊對立假 設有兩個臨界值。 ©Ming-chi Chen 社會統計 32
Level of Significance (α risk) 觀 念 • 顯著水準:type I error發生的最大機率值。 • The level of significance of a test is the probability that the test statistic falls in the critical region given that H 0 is true. The level of significance is denoted by the symbol α ©Ming-chi Chen 社會統計 36
Probability of a Type II Error (βrisk) 觀 念 • β 風險:type II error發生的最大機率值。 • The probability of making a Type II error is the probability that the test statistic falls in the acceptance region when the null hypothesis is false, denoted by β ©Ming-chi Chen 社會統計 37
Testing Hypothesis about a Population 觀 Mean When Variance is Known 念 • H 0: u = u 0, H 1: u < u 0 • 我們以樣本的平均數X來推論母體的平均數。假 設母體為常態分配,如果H 0為真,則樣本平均數 X~N(u 0, σ2/n)。 • 只有當我們觀察到一個樣本平均數與u 0差異很大 時才會推翻H 0, Reject H 0 if and only if the observed sample mean x-bar is less than the critical value Area α ©Ming-chi Chen 社會統計 σ2/n u 0 42
Testing Hypothesis about a Population 觀 Mean When Variance is Known 念 • 如果H 0為真, 則樣本平均數 落在critical value 之下的 Area α 機率為: ©Ming-chi Chen 社會統計 σ2/n u 0 43
The critical value • 將critical value 轉成z-score Area α 觀 念 σ2/n u 0 1 Area α ©Ming-chi Chen 社會統計 0 45
The critical value • 如果H 0為真, 觀 念 1 Area α 0 ©Ming-chi Chen 社會統計 46
The critical value • 欲檢證 • H 0: u = u 0 vs. H 1: u < u. Area α 0 • 則critical value : ©Ming-chi Chen 社會統計 觀 念 1 0 47
Testing a Composite Null Hypothesis 觀 念 • 在顯著水準為 =. 01,critical value Z =Z. 01=2. 33. 0 2. 33 Reject the null hypothesis ©Ming-chi Chen 社會統計 54
雙尾檢定A two-tailed test of the population mean 觀 念 • H 0: u = u 0 vs. H 1: u u 0 • 如果觀察到的樣本平均數遠高於或遠低於u 0 則皆可拒絕H 0 Reject H 0 if z<-z /2 or if z>z /2 Reject H 0 if /2 1 - 0 /2 Acceptance region ©Ming-chi Chen 社會統計 58
A two-tailed test of the population mean 觀 念 • 雙尾檢定最常用的顯著水準 為 10%, 5%, 1%,其相對應的critical z-score為: 1 - /2 0 /2 Acceptance region ©Ming-chi Chen 社會統計 59
A two-tailed test of a mean of a normal population with known variance • 求上例中的樣本平均數的critical value? /2=. 025 1 - 300 /2 Acceptance region 280. 4 ©Ming-chi Chen 社會統計 319. 6 61 例 題
24 25 29 接受 ©Ming-chi Chen 27. 56 社會統計 拒絕 65
例題 • 從一個變異數為 2250的母體裡抽取一個大小為 100的樣本來 檢測下列假設: • H 0: u=1000, H 1: u 1000 • It is decided to reject H 0 if (1) Find the probability of type I error (2) Find the probability of a type II error if u=1005 ©Ming-chi Chen 社會統計 67
例題 Find the probability of a type II error if u=1005 ©Ming-chi Chen 社會統計 68
P-Value: Interpretation and Use The P-value of a test is the probability of obtaining a value of the test statistics as extreme as or more extreme than the observed sample value when the null hypothesis is true. P-value 告訴我們:「如果虛擬假設為真,我們觀 察到目前資料顯示的檢定統計量的機率有多高? 」如果這個機率很小,則我們可以拒絕虛擬假設, 因為如果假設為真,則僅有很小的機率抽取任意 的隨機樣本會得到目前的觀察值。 ©Ming-chi Chen 社會統計 70
Testing the mean of a normal population 例 with population variance known 題 1 0 • 求p-value=? Z=-3. 125 • P-value = P(z < -3. 125) = 0. 0009 如果H 0為真,則觀察到平均值=29. 5的機率僅有. 0009,表示H 0不太可能為真 rejected H 0 ©Ming-chi Chen 社會統計 72
Testing the mean of a normal population 例 with population variance known 題 1 0 Z=-3. 125 • 將α訂在 5%,則critical value = -1. 645 • 如果將α定在 1%的水準,則critical value = -2. 33, 我們依舊reject H 0 • 只要是顯著水準高於. 0009,我們都可以拒絕H 0, 也就是說,P-value是H 0會被拒絕的最小值。 ©Ming-chi Chen 社會統計 73
Testing the mean of a normal population with population variance known • 一般在研究報告中,研究者經常直接寫出pvalue而讓讀者自己去決定是否要拒絕H 0。pvalue 經常被稱為是觀察到的顯著水準(the observed significant level)。可以將它看成是 「在假設H 0為真的情況下,觀察到目前樣本, 或比此樣本更極端樣本的機率」。 • A statistically significant p-value means that the observed result is difficult to explain by random chance. ©Ming-chi Chen 社會統計 76
Two-tailed test of a population mean using a large sample • Solution: 由於樣本數夠大(n=100)我們可以用一 般檢定母體平均值假設的方法來進行檢證: • =5%, two tailed test, the two critical value z 1= -1. 96, z 2=1. 96 /2=. 25 0 /2 Acceptance region Reject H 0 ©Ming-chi Chen -1. 96 社會統計 1. 96 81
Finding the critical values of X-bar when variance is unknown • 找出前例中x的critical value /2=. 25 /2 Acceptance region 9. 804 ©Ming-chi Chen 社會統計 10. 196 82
Testing Hypothesis about the mean of a normal population with unknown variance • 如果母體為常態分配,但母體的變異數為未 知,且樣本數少於 30? • 改用student t分配而非用常態分配來做假設 檢證。 ©Ming-chi Chen 社會統計 83
Characteristics of t distribution • The t distribution is actually a family of distribution with a different density function corresponding to each different value of the Standard normal parameter . (d. f. = ) d. f. =4 d. f. =2 d. f. =1 ©Ming-chi Chen 社會統計 86
Value of t , • The symbol t , denotes the value of t such that the area to its right is and t has degree of freedom. The value t , satisfies the equation: • P(t > t , )= • Where the random variable t has the t distribution with degrees of freedom. ©Ming-chi Chen 社會統計 87
Testing Hypothesis about the mean of a normal population with unknown variance • • • 欲檢證下列假設: H 0: u = u 0 or H 0: u u 0 H 1: u > u 0 在顯著水準 之下,找出critical value t , P(t > t , )= 計算t-score: 決策法則:reject H 0 in favor of H 1 if t > t , n-1 ©Ming-chi Chen 社會統計 88
Testing Hypothesis about the mean of a normal population with unknown variance • • • 欲檢證下列假設: H 0: u = u 0 or H 0: u u 0 H 1: u < u 0 在顯著水準 之下,找出critical value t , P(t > t , )= 計算t-score: 決策法則:reject H 0 in favor of H 1 if t < -t , n-1 ©Ming-chi Chen 社會統計 89
Testing Hypothesis about the mean of a normal population with unknown variance • • • 欲檢證下列假設: H 0: u = u 0 H 1: u u 0 在顯著水準 之下,找出critical value t , P(t > t , )= 計算t-score: 決策法則:reject H 0 in favor of H 1 if t < -t /2, n-1 or t > t /2, n-1 ©Ming-chi Chen 社會統計 90
例:small-sample test of the mean of a normal population with unknown variance • 解)x 1=245, x 2=305, x 3=175, x 4=250, x 5=280, x 6=160, x 7=250, x 8=195, x 9=210 • 計算樣本平均值: d. f. = 9 -1 = 8, Critical value = t. 01, 8 =2. 896 ©Ming-chi Chen 社會統計 92
例:small-sample test of the mean of a normal population with unknown variance 或者我們可以用t = 1. 86找出其相對應的p-value 查表B可知, d. f. =8 P(t > 1. 86) =. 05 若d. f. = 8 , t = 1. 49, P(t > 1. 49) = ? 若d. f. = 8 , t = 1. 16, P(t > 1. 16) = ? ©Ming-chi Chen 社會統計 93
Sampling Distribution of the Sample Proportion • If the distribution of p^ is approximately normal, then random variable ©Ming-chi Chen 社會統計 96
11. 6 Tests of the population proportion 設np 5 and nq 5 檢證下列假說: H 0: p = p 0 or H 0: p p 0 H 1: p < p 0 如果H 0為真,則樣本比率~N(p 0, p 0 q 0/n) Reject H 0 if Z < -z or p^ < p^* ©Ming-chi Chen 社會統計 97
例:Testing a population Proportion We do not reject H 0 1 0 -1. 02 ©Ming-chi Chen 社會統計 100
• tabulate v 26 a ©Ming-chi Chen 社會統計 106
假設檢定 • H 0: μ=3 • ttest v 26 a == 3 • 或用Statistics>Summaries, tables, and tests>Classical tests of hypotheses>onesample mean comparison test ©Ming-chi Chen 社會統計 108
©Ming-chi Chen 社會統計 109
3. 665035±t 0. 025(0. 025913) =1. 11124/√ 1839 (3. 665035 -3)/0. 025913 One-sample t test ---------------------------------------Variable | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] -----+----------------------------------v 26 a | 1839 3. 665035. 025913 1. 11124 3. 614213 3. 715857 ---------------------------------------mean = mean(v 26 a) t = 25. 6642 Ho: mean = 3 degrees of freedom = 1838 Ha: mean < 3 Pr(T < t) = 1. 0000 Ha: mean != 3 Pr(|T| > |t|) = 0. 0000 均數≠ 3的對立假設p 值 ©Ming-chi Chen Ha: mean > 3 Pr(T > t) = 0. 0000 1839 -1 社會統計 兩個單尾檢定 的p值 110
- Slides: 110