You are on page 1of 11

Statistics Method

Tests of Hypothesis ( 假設檢定 )


假設檢定的步驟

 Step1: 設定 虛無假設 (null hypothesis H0) 與 對立假設 (alternative


hypothesis H1)

 Step2: 選擇檢定統計量 (test statistic)


 Step3: 選擇顯著水準 (level of significance) 並決定決策法則
 Step4: 比較樣本統計量 與 臨界值
 Step5: Conclusion

2
Step1: Set Null Hypothesis and Alternative Hypothesis

 設定 虛無假設 (null hypothesis H0) 與 對立假設 (alternative hypothesis


H1)
 H0 (presumed to be true) and H1 (has the burden of proof) are mutually
exclusive and collectively exhaustive.
 A random sample is used to “reject H0”.
 If we conclude “do not reject H0”, this does not necessarily mean that the null
hypothesis is true, it only suggests that there is not sufficient evidence to
reject H0. If we reject the null hypothesis, then it suggests that the
alternative hypothesis may be true.
 Equality is always part of H0 (e.g. “=” , “≥” , “≤”).
 “≠” “<”,” >” is always part of H1

3
Step1: How to Set Up a Claim as Hypothesis

 Null Hypothesis – H0 ( 現狀、常態 )

 Alternative Hypothesis – H1 ( 改變現狀的、犯不得錯的、檢測成本高的 )


( 這部分是真正要用統計方法去檢測的 Error 的 )
 Example:
 法庭上: H0 : 無罪; H1 : 有罪
 花生工廠: H0 : 一包重 100g ; H1 : 不等於 100g
 (要有足夠證據才能說機器有問題,否則需花錢修理!)
 藥廠發明新藥: H0 : 對人體有害; H1 : 對人體無害
 (要有足夠證據才能說新藥不傷身,否則造成身體傷害!)

4
Step1: Type of Tests of Hypothesis

 Two-Tailed Test
 H0 : θ=θ0 ; H1 : θ≠θ0

 One-Tailed Test
 Upper Tailed Test:
 H0 : θ ≥ θ0 ; H1 : θ<θ0
 Lower Tailed Test
 H0 : θ ≤ θ0 ; H1 : θ>θ0

5
Step1: Error of Tests of Hypothesis

 Error Type
 Type 1: H0 is true, but been rejected
 Type 2:
 H0 is false, but fail to be rejected. (Not Enough Data to prove H1 is true)

 Error Prob
 Type 1: α = P(Reject H0 | H0=True)
 Type 2: β = P(Unable to reject H0 | H1=True equiv. H0=False )
α rise  β fall, α fall  β rise
無法同時使 Type1 Error 與 Type2 Error 同時變小
• 一般認為 Type1 Error 的後果比較嚴重,因此希望 α 較
小。 ( 必須有足夠的證據才能推翻 H0)
• α 越小,表示 H1 檢驗越嚴格,不容易接受 H1
6
Step2: Select Test Statistic ( 假說檢定量 )
 A test statistic is a random variable that is calculated from sample data and used in a
hypothesis test
 used to determine whether to reject the null hypothesis.
 test statistic compares your data with what is expected under the null hypothesis.
 used to calculate the p-value.

 A test statistic measures the degree of agreement between a sample of data and the null
hypothesis.
 A test statistic contains information about the data that is relevant for deciding
whether to reject the null hypothesis
 The sampling distribution of the test statistic under the null hypothesis is called the null
distribution.
 When the data show strong evidence against the assumptions in the null hypothesis, the
magnitude of the test statistic becomes too large or too small depending on the
alternative hypothesis. This causes the test's p-value to become small enough to reject
the null hypothesis.

7
Step2: Select Test Statistic ( 假說檢定量 )

 Different hypothesis tests use different test statistics based on the


probability model assumed in the null hypothesis. Common tests and
their test statistics include
Hypothesis Test Test Statistic
Z-test (Normal Distribution) Z-statistic
T-test T-statistic
ANOVA F-statistic
Chi-square test Chi-square statistic

•  Case1: 如果 母體 已知,無論樣本大小,皆採用 Z-test


• Case2:
• 如果 母體 未知,當樣本數 n 可以使用 Z-test , 用 取代。 ( 為 sample variance)
• 如果 母體 未知,當樣本數 n 使用 t-test (degree of freedom = n – 1 )

8
Step2: Select Test Statistic ( 假說檢定量 )

 T-test
 measure the reliability of difference of means)
 part of inferential statistics, allowed to make inference about the population
beyond our data.

 𝑡 = 𝑉𝑎𝑟𝑖𝑎𝑛𝑐𝑒 𝐵𝑒𝑡𝑤𝑒𝑒𝑛 𝐺𝑟𝑜𝑢𝑝𝑠


𝑉𝑎𝑟𝑖𝑎𝑛𝑐𝑒 𝑊𝑖𝑡h𝑖𝑛 𝐺𝑟𝑜𝑢𝑝𝑠

Large t-value : Difference Group


( 決定顯著差異由 p-value 決定 ,p-value 又受到 Sample Size 影響 )
Small t-value : Similar Group

9
Correlation

Supplement:
This formular could be referred as the cosine.

10
Analysis of Variance

11

You might also like